  | | | Objects 2 particles scripts not working!? | Objects 2 particles scripts not working!? 2005-04-23 - By brad
Back Below is a function that creates a null on each point of any input object (poly , nurb, or cloud). It can be parsed and made into a command button which will work on any selected object. It should be pretty easy to hack if you need to replace the nulls with your own collection of objects:
function NullsOnPoints(inObj) { // If nothing input, use the selection if(!inObj) inObj = selection(0);
// Get global transform from inObj var gTrans = inObj.kinematics.global.transform; var pTrans = XSIMath.CreateTransform(); // Get point collection from inObj var points = inObj.ActivePrimitive.geometry.points; // For each point, create a null and transform it to the point var rootNull = ActiveSceneRoot.AddNull('PosNulls'); for(var i=0; i<points.count; i++){ // Get position vector of point var pos = points(i).position;
// Multiply position by the global transform of the object center pos.MulByTransformationInPlace(gTrans); pTrans.SetTranslation(pos); // Create null and set global transform var node = rootNull.AddNull('pnt' + i + 'Null'); node.kinematics.global.transform = pTrans; } } // END FUNCTION -- ---- ---- ---- ---- ---- ---- ---- ---
-Brad CG Soup
-- ----Original Message-- ---- > I need to put objects on particles - not particle instances as I need to > see where objects intersect with a collision surface. I tried the various > scripts for attaching objects to particles, but they all fail :( > > I tried Olivier Lelardoux original one as well as the modified ones by > Todd Akita and Eric Lampi. They fail with different messages and I can't > seem to get them to work, so I'm thinking maybe they don't work in 4.2!? > > I have tried all different combinations on picking sessions, but still no > go - has anyone tried and made one of these scripts work in 4.2 and if so, > could you give me a short do's and dont's list? > > TIA! > > > -- > best regards > > Morten Bartholdy > Colorshop VFX > Denmark > --- > Unsubscribe? Mail Majordomo@(protected) with the following text in body: > unsubscribe xsi -- ----Original Message-- ---- --- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|
 |