$.modifiers[#MultiRes].reqGenerate Help!!!!

Hi folks,
I'm trying to apply the MultiRes modifier by script to reduce the vertex numbers for a lowpoly output, but don't work, I opened the modifer list and the modifier is there and works only if I click the Generate button. I need it automatic controlled by the script.

I'm stucked, please help a noob (me) to finish his first 3dMax script :)

my code:
...

select obj

--add modifier
modPanel.addModToSelection (MultiRes ()) ui:on

$.modifiers[#MultiRes].BoundaryMetric = on
$.modifiers[#MultiRes].baseVertices = on
$.modifiers[#MultiRes].mergeVertex = on
$.modifiers[#MultiRes].mergeThreshold = 0.25
$.modifiers[#MultiRes].mergeWithinMesh = on
$.modifiers[#MultiRes].reqGenerate = off
$.modifiers[#MultiRes].vertexCount = 1056
update $

-- don't work, still a high mesh vertex!!!!!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Graph's picture

(--OPEN local scope   local

(--OPEN local scope
 
	local mod1 = MultiRes BoundaryMetric:true baseVertices:true mergeThreshold:0.25 mergeWithinMesh:true vertexPercent:50  --create a multiRes mod and assign to variable
 
	local objs = selection as array  --get the current selection as an array
 
	max modify mode  --switch mod panel to modify mode
 
	addModifier objs mod1  --add the modifer to the selection (instanced)
 
	mod1.reqGenerate = not mod1.reqGenerate  --press the generate button
 
	max create mode  --switch back to create panel
 
)--END local scope

Raphael Steves

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.