[Closed] Subdivide bug in function or misuse?
Hey everyone, I am having a bit of trouble modifying the ‘size’ attribute on a subdivide modifier through maxscript, in certian situations.
When trying to access the attribute when executing the code in a function, it doesn’t catch whatever changes I apply to it, however in just a vanilla script, it does work.
This will make a plane, apply a subdivide, and set the subdivision size correctly.
max modify mode
obj = plane()
addmodifier obj (subdivide())
obj.modifiers[#Subdivide].size = .5
This however, will not. Setting other vars like the ‘manualupdate’ however, do work.
function myFunction =
(
max modify mode
obj = plane()
addmodifier obj (subdivide())
obj.modifiers[#Subdivide].size = .5
)
myFunction()
However manually selecting the mesh and updating the modifier that way does work, like this
function myFunction =
(
max modify mode
obj = plane()
addmodifier obj (subdivide())
select obj
$.modifiers[#Subdivide].size = 0.5
)
myFunction()
Unfortunately neither of the working versions are an acceptable way to make this change in my script, because I would like to keep this in a function for easy use, and with the selection, it causes the ui to flicker, and have a very significant slowdown in speed, when doing this across multiple objects.
Am I doing something wrong here, or has anyone else encountered this issue?
Thanks for any help
This very specific problem was discussed in excruciating depth on this forum about 1-2 months ago, search for that thread…
edit: http://forums.cgsociety.org/showthread.php?f=98&t=1049903
Wow, thank you very much, that had all the answers I was looking for.