PDA

View Full Version : Creating new layer in MaxScript


CBruce
12-01-2010, 06:50 PM
I'm fairly new to MaxScript, and having some issues doing something that should be pretty simple. I want to look for a layer based on it's name. If it doesn't exist, then I want to create it. Then when I create new nodes I try and assign them to this layer. Here's what I currently have in code:


global layerNameBones="bones"
--Setup Layer for Rig controls
if LayerManager.getLayerFromName layerNameBones == undefined
then
(
bonesLayer=LayerManager.newLayerFromName layerNameBones
bonesLayer=LayerManager.getLayerFromName layerNameBones
)
else
(
bonesLayer=LayerManager.getLayerFromName layerNameBones
)
-- Turn viewport update and undo off to speed up script
with redraw off
undo off
(
-- Hips
boneHips = BoneSys.createBone $Hips.position $Waist.position boneOrient
boneHips.name = "BoneHips"
bonesLayer.addnode boneHips
-- Waist
etc...


This sometimes works, and other times does not. Am I going about this the wrong way?

lo
12-02-2010, 01:35 PM
answered you here http://area.autodesk.com/forum/autodesk-3ds-max/maxscript/layermanger

CGTalk Moderation
12-02-2010, 01:35 PM
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.