PDA

View Full Version : How can use a function name as object name?


onetera
03-18-2008, 02:47 AM
I would like to use that function name (popo) as the object name.
But It was "undefined"
How do I modify the function below?



fn CreateConObject ConOBJ OBJRadius =
(
local conObject = ConOBJ
conObject = Circle radius:OBJRadius pos:[0,0,0]
conObject.name = ConOBJ as string
convertToSplineShape conObject
conObject_copy = copy conObject
rotate ConObject_copy (angleaxis 90 [0,1,0])
addAndWeld conObject ConObject_copy 100
conObject.render_displayRenderMesh = true
conObject.render_thickness = 1.5
)
CreateConObject popo 10

RustyKnight
03-18-2008, 05:13 AM
Maxscript thinks (correctly) that the name "popo" is a variable...but because the variable is has not yet been initalised, it is, correctly, been interrupted as undefined...CreateConObject popo 10is where you are making your mistake, it should readCreateConObject "popo" 10
Shane

CGTalk Moderation
03-18-2008, 05:13 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.