View Full Version : Need help with a script command
04-19-2012, 01:18 PM
I need to know what the script command for adding a mesh to skinwrap modifier is.
Can anyone help?
04-19-2012, 01:55 PM
append myObj.modifiers["skin_wrap"].meshlist otherObj
04-20-2012, 09:11 AM
Thanks Drea :)
Though I get this error:
append Sphere001.modifiers["skin_wrap"].meshlist Sphere002
-- Unknown property: "modifiers" in undefined
Think its something to do with the physx plugin? Is there a workaround for this?
04-20-2012, 09:35 AM
"Sphere001" sounds like the Max name of your object. You need to insert a '$' before the name to access it in maxscript.append $Sphere001.modifiers["skin_wrap"].meshlist $Sphere002
04-20-2012, 12:31 PM
Yay! It works! Thanks for that Raytracer05 :) and thanks again Drea for the initial code.
04-20-2012, 12:59 PM
One more thing if anyone can help as I cant find anything on google :(
I would like to copy the edit poly modifier from sphere001 and paste it onto sphere002
I would also like the same function but this time paste the edit poly modifier underneath another modifier allready applied to sphere002
Any ideas what the script would be for this?
04-20-2012, 01:13 PM
For your first question...
addModifier $Sphere002 $Sphere001.modifiers["edit_poly"]
That will add an instance of the edit_poly modifier to the top of Sphere002's stack.
To insert the modifier elsewhere, use the "before" keyword argument. The insert point is counted from the top of the stack.
addModifier $Sphere002 $Sphere001.modifiers["edit_poly"] before:1
04-20-2012, 04:19 PM
Thank you Drea, will try this out :)
Also I'm having a problem with this line when I make a copy of an object
actionMan.executeAction 0 "40213" -- Edit: Clone
maxOps.cloneNodes $ cloneType:#copy newNodes:&nnl
The problem is it always brings up the clone panel which interupts the process. I would just like it to bypass the panel and clone me a copy. any idea why this isn't automatic?
04-20-2012, 05:03 PM
04-21-2012, 12:34 PM
Ahh simples! Thanks again Drea :)
04-23-2012, 10:52 AM
You're most welcome.
04-23-2012, 01:18 PM
The copy edit poly works great, though it pasts it as an instance and the edits dont appear to show.
Is there a way to paste it as a copy?
Also the copy object command doesnt seem to work? I replace the obj with sphere001 and nothing seems to happen and the listener doesnt say anything. any ideas why?
04-23-2012, 06:32 PM
Ah, I think your in trouble. AddModifier doesn't work in the same way as copy/paste in the UI, so edits aren't copied over. I don't think there's any way to do what you want in script.
For your copy problem, is this the missing "$" issue again? If not, can you try this following and tell me what appears in the listener.
newObj = copy $Sphere001
04-25-2012, 09:28 AM
yep that works :) nice one!
04-25-2012, 09:28 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.