RE: [scripting] Overwriting the Hair PositionArray?

Date : Wed, 21 Nov 2007 16:19:53 -0500
To : <XSI(at)Softimage.COM>
From : "Vincent Fortin" <vincent.fortin(at)ubisoft.com>
Subject : RE: [scripting] Overwriting the Hair PositionArray?

Many thanks Guillaume, you rock. Thanks to Kim as well for your previous mail about accessing the root points and geometry source.

 

My plugin is done now, it’d have taken me a lot more time without that precious information.

 

Cheers!

 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Guillaume Laforge
Sent: Wednesday, November 21, 2007 9:18 AM
To: XSI(at)Softimage.COM
Subject: Re: [scripting] Overwriting the Hair PositionArray?

 

Hi Vincent

See attached plugin scop of tea ;-).

This plugin drive the guides scale with a weight map.

Copy the file in your plugin directory, open xsi and run those jscript lines below to see it in action on a hair object.

//create a grid
CreatePrim("Grid", "MeshSurface", null, null);
SetValue("grid.grid.ulength", 16, null);

//add a weight map
CreateWeightMap(null, null, "Weight_Map", null, null);
SetValue("grid.polymsh.cls.WeightMapCls.Weight_Map.weightmapop.weight ", 1, null);
SetValue("grid.polymsh.cls.WeightMapCls.Weight_Map.weightmapop.type", 1, null);
SetValue("grid.polymsh.cls.WeightMapCls.Weight_Map.weightmapop.wmax", 5, null);

//create a hair object
ApplyHairOp("grid", null);
SetValue("Hair.hair.AllowStretch", true, null);

//scale guides with a weightmap
guil_CutGuidesWithWmap("grid.polymsh.cls.WeightMapCls.Weight_Map");


It is not a self installing plugin so you can inspect the code from a scripted operator editor.

If you want to use it on your own hair :
Set hair stresh on. Select your hair object,  go to Property and choose "Cute Guides With a Weight Map", then pick a weight map  (no need to transfert map ).
I test it only on xsi 5.11 at home but it should be ok for xsi 6.xx too.

Hope this help

Cheers

Guillaume Laforge | La Maison



Vincent Fortin a écrit :

Oh dear, what about a nice scop of tea?

 


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

 

perhaps to protect from ugly haircuts...

sorry, not very helpfull is it?

 

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.