PDA

View Full Version : Selecting object from outputed text


Raven5326
05-28-2009, 10:08 PM
hi all,

im trying to write a script that will output bone names in the skin of an object to a text file,

i am then loading those back in to a new maxfile and applying those bones to a new skin modifier.

The problem i am running in to while in the new file is that max wont recognize the bones as actual node, but when i copy the string manually from the text file and use that it works fine. Im guess there is a step im missing but i am stuck ATM.

here are some code snippets:




--creation of outputed text
boneName = skinOps.GetBoneName obj x 0
format ("$'" + boneName +"'\n") to:out_file


--reading of text to add bones to modifier
curBone = readLine read_file
format "%\n" curBone
skinOps.Addbone obj curBone 1


anyone have any alternate ideas?

DaveWortley
05-28-2009, 11:59 PM
Look up Getnodebyname()

PiXeL_MoNKeY
05-29-2009, 04:49 AM
You need to convert the string to a node reference. You can use getnodebyname() like Dave suggested or use the execute command to convert the string to a node:boneNode = execute ("$"+curbone)
skinOps.Addbone obj boneNode 1-Eric

ZeBoxx2
05-29-2009, 05:28 PM
getNodeByName is the proper way, though. here's a third, just for kicks...

for o in objects where (o.name == curbone) do ( <something> )

CGTalk Moderation
05-29-2009, 05:28 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.