- Select the Galaxy strokes
- Convert to Polys
The resulting polys will all be named "polySurface" + an index number. Take note of the number of surfaces created.
- Create an emitter with speed 0 and rate 10000000 (really high)
- Set the resulting particle's max count to the number of surfaces created
- Advance a frame
- Select the particles
- Solver > Set Initial State for selected
- Delete the emitter
- Execute the following script and be sure to set the startRange, endRange of the polygons produced by the convert to polys command. In my case the command produced polyShape2 - polyShape859. Also set the particle name and particle name shape variables.
[codebox]//------------------------------------------------------------
// Setup
int $startRange = 2;
int $endRange = 859;
string $pName = "pStars";
string $pShapeName = "pStarsShape";
string $name;
float $_p[];
vector $p;
int $i = $startRange;
int $pIndex = 0;
// Iterate over the geometry
for ($i; $i<$count; ++$i) {
$name = "polySurface"+$i;
select -r $name;
// Center Pivot
xform -cp;
// Get Scale Pivot Position
$_p = eval("getAttr " + $name + ".scalePivot");
$p = <>;
$pIndex = $i-2;
eval("select " + $pShapeName + ".pt[" + $pIndex+ "]");
eval("setParticleAttr -vv " + $p + "-at position " + $pName);
}
//-----------------------------------------------------------[/codebox]
- Select the particles and set their initial state again
- You can then just use the Instancer to instance a bunch of star colored spheres to your particles.
This could obviously be streamlined, but for a one off here you go.
.xX