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?
perhaps to protect from ugly haircuts...
sorry, not very helpfull is it?
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