Notifications
Clear all
[Closed] Adding modifier to the first created object
May 19, 2015 9:08 pm
Hi,
I’ve noticed that I can’t add a modifier to the first created object in the scene.
This is a piece of code to test:
try(destroyDialog ModiferTest)catch()
rollout ModiferTest "ModiferTest" width:150 height: 450 (
button __createBox "Create Box" pos:[10,85] width:130 height:45
on __createBox pressed do (
myBox = box isSelected:on
modPanel.addModToSelection (Edit_Mesh())
)
) createDialog ModiferTest
The first box (in the scene) that is created does not have a modifier.
This piece of code is from my original and more complicated script. But it fails as well.
How do I make the object to be created always with the modifier?
3 Replies
May 19, 2015 9:08 pm
try it like this
try(destroyDialog ModiferTest)catch()
rollout ModiferTest "ModiferTest" width:150 height: 450 (
button __createBox "Create Box" pos:[10,85] width:130 height:45
on __createBox pressed do
(
setCommandPanelTaskMode mode:#modify
myBox = box isSelected:on
modPanel.addModToSelection (Edit_Mesh())
)
) createDialog ModiferTest
May 19, 2015 9:08 pm
If you don’t want to have the node selected, which is slower, you can use addModifier():
(
try(destroyDialog ::ModiferTest)catch()
rollout ModiferTest "ModiferTest" width:150 height: 450
(
button __createBox "Create Box" pos:[10,85] width:130 height:45
on __createBox pressed do
(
myBox = box()
addmodifier myBox (Edit_Mesh())
)
)
createDialog ModiferTest
)