defining an array as a custom attribute
Ok, at the moment, I am trying to make an array as a custom attribute.. Only problem, I'm getting the following weird error:
-- Error occurred in anonymous codeblock; filename: J:\Dropbox\ICT312 (1)\scripts\entityAttribs.ms; position: 579; line: 30 -- Unable to convert: #() to type: String
for the following code:
newAttrib = attributes entityAttrib ( parameters posParam rollout:entParams ( isStatic type:#boolean ui:isStatic checked:false castShadow type:#boolean ui:castShadow checked:false isChild type:#boolean childeren type:#() ) rollout entParams "Entity Atributes" ( checkbox isStatic "Static Entity" checkbox castShadow "Casts Shadows" edittext isChildTxt "is child" text:"no" on isChild changed do ( if isChild == true then ( isChildTxt.text = "yes" ) else ( isChildTxt.text = "no" ) ) ) ) custAttributes.add $ newAttrib --and then use >> $.baseObject.entityAttrib.castShadow = on $.baseObject.entityAttrib.isStatic = on $.baseObject.entityAttrib.isChild = on $.baseObject.entityAttrib.childeren = on isProperty $.baseObject #castShadow isProperty $.baseObject #isStatic isProperty $.baseObject #isChild isProperty $.baseObject #childeren
if I follow tutorials on how to make an array inside of just any odd script, not inside of a custom paramater, i.e.
childeren = #()
I get the following error:
-- Error occurred in anonymous codeblock; filename: J:\Dropbox\ICT312 (1)\scripts\entityAttribs.ms; position: 231; line: 8 -- Syntax error: at =, expected name -- In line: childeren = #
I know it's probably something silly.. But I can't for the life of me understand why my array isn't working inside of a parameters :(
Is there a proper way??
If anyone's curious, the reason why I need an array is because I'm holding children meshes inside of an array (needed for proper extraction of scene data for exporter)
Comments
Maybe this is not best solution
bga
Ill try that in a second, but
Ill try that in a second, but I think I found a solution anyway:
Right now my issue is that I need to get my script to deselect the current object, and then add the next selected item to the childerens list.. so far this is my script:
I thought scripts ran as a subroutine, aparently not.. as soon as it reaches the while loop 3ds max freezes =.= is there a better/proper way to get the user to select another object?
Who'da known, you can
Who'da known, you can multitask in ms after all, ok, so that's all handled, now I would love to know, how can I make a dynamicly sized maxObjectTab
I get the following error:
the definition of the datatype is this:
and the error is caused by:
Is there any dynamic types so I can add to somthing simular to maxObjectTab?
This is en excellent example
This is en excellent example by DenisT
This is the way how to solve the array problem
bga