Re: [scripting] Overwriting the Hair PositionArray?

Date : Wed, 21 Nov 2007 15:17:56 +0100
To : XSI(at)Softimage.COM
From : Guillaume Laforge <guillaume(at)alamaison.fr>
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

Attachment: guil_CutGuidesWithWmap.js.rar
Description: application/rar


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.