RE: [scripting] Overwriting the Hair PositionArray?

Date : Wed, 21 Nov 2007 13:45:46 -0000
To : <XSI(at)Softimage.COM>
From : "kim aldis" <xsi(at)kim-aldis.co.uk>
Subject : RE: [scripting] Overwriting the Hair PositionArray?

This applies to all geometry, not just hair. The reason being that your scripted change isn’t being added to the construction stack so the next refresh would run the stack and overwrite it. A custom op, scripted or otherwise, is on the stack so it gets refreshed.

 

You can also script in translate commands but that’s only sensible if you can use only a few. Translating all your hair points could easily take a couple of hours if not more. The time seems to rise exponentially with the number of transform commands.

 

Phil, I was using scripted ops back then too. I’m not sure if that bug is still around but I had the same problem and I did find a workaround. Lord knows what it was but I made extensive use of ops for grooming and symmetry.  I think it was in 4.0 there was a bug where the custom op was ignored when freezing. There was no workaround for that but subsequent point releases did fix it. If I remember what the fix was I’ll post. It wasn’t something to do with dynamics, was it?

 

 

 

From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Vincent Fortin
Sent: 21 November 2007 13:09
To: XSI(at)Softimage.COM
Subject: RE: [scripting] Overwriting the Hair PositionArray?

 

Thank you for the enlightenment Stephen and Phil… and Stephen!

 

 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Stephen Blair
Sent: Tuesday, November 20, 2007 5:05 PM
To: XSI(at)Softimage.COM
Subject: RE: [scripting] Overwriting the Hair PositionArray?

 

 

Outside of a scop, you can modify the PositionArray only on a frozen object.

 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Stephen Blair
Sent: Tue 20 November 2007 4:53 PM
To: XSI(at)Softimage.COM
Subject: RE: [scripting] Overwriting the Hair PositionArray?


 
You can modify the PositionArray only on a frozen object.
Hair is generated so it cannot be frozen.

Try connecting a scripted op on the hair primitive (as input and output).

 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Vincent Fortin
Sent: Tue 20 November 2007 4:41 PM
To: XSI(at)Softimage.COM
Subject: [scripting] Overwriting the Hair PositionArray?

Is it possible?

I get an “access denied” whatever I try…

 

// JSCRIPT

var oObj = selection(0);

var aPos = oObj.ActivePrimitive.Geometry.Points.PositionArray.toArray();

FreezeObj(oObj);

oObj.ActivePrimitive.Geometry.Points.PositionArray = aPos;

 

Thanks,

Vincent


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.