Maxscript tutorials

 
 
 
Posted by:6ill9re9
Data created:24 March 2017

I am trying to use maxscript to operate on the Edit Guides modifier and either the doc is outdated or I am an idiot but I can't seem to have it work.

When I ask show interface on either getGudes() or asHair() the list differs from the documentation and it simply doesn't do anything.

For exemple if I do

G = (modPanel.getCUrrentObject()).GetGuides()
sel = G.GetStrandSelection()

I get a bitArray of my selection... Fine
But then

G = (modPanel.getCUrrentObject()).GetGuides()

G.SetStrandSelection sel

isn't doing anything... same goes for G.DeleteStrands sel which seems to stand for DeleteRootSet which doesn't even exist...

You should not be calling SetStrandSelection directly on the guides, it won't do much since you're just calling the function on the resulting object of the evaluation pipeline. Instead you should do it through EditGuidesModifier. If you want to select some guides (excert from one of our unit tests):

local distributionObject = Plane lengthsegs:2 widthsegs:1 isSelected:on
max modify mode
modPanel.addModToSelection (Ox_Guides_from_Surface method:4 randomness:0 NumSegs:2)
local editGuidesInstance = Ox_Edit_Guides()
modPanel.addModToSelection editGuidesInstance

-- Move all 4 roots somewhere
subobjectLevel = 1
editGuidesInstance.SelectRoots #{1,2,3,4,5,6}
editGuidesInstance.MoveSelectedControlPoints [-5,-5,0]

-- Change guide count
distributionObject.lengthsegs = 1

-- Move control points somewhere
subobjectLevel = 2
editGuidesInstance.SelectRoots #{1,2,3,4}
editGuidesInstance.MoveSelectedControlPoints [1,1,0]

Marsel Khadiyev (Software Developer, EPHERE Inc.)