CrazyDamo
09-28-2011, 11:54 PM
Yullo All,
I'm trying to script some custom attributes to a simple box object in order to store some information about the layers in the scene. My issue is that, I need to store several separate parameters, and I can't seem to code/script a unique name for either the Custom Attribute name or the rollout parameter name, or even the editable box unique name. I have tried using a variable to assign the name, but get errors, I have also tried using a for loop inside the rollout creation component, in order to add several 'edittext' box's of separate names... but get errors...
The following is the basic setup:
fn createCustomAttrs layerArgs=
(
renderLayersCA = attributes "LayerList"
(
parameters main rollout:params
(
attrNameType type:#string
)--end parameters
rollout params "Render_Layer"
(
edittext attrName_EB "Layer Names" fieldWidth:200
)--end rollout
)--end attributes
)--end function
but this is what I want to do:
fn createCustomAttrs layerArgs=
(
renderLayersCA = attributes "LayerList"
(
parameters main rollout:params
(
for x = 1 to layerArgs.count do
(
attrTypeName = "LayerInfo_" + x
attrTypeName type:#string
)--end for loop
)--end parameters
rollout params "Render_Layer"
(
for a = 1 to layerArgs.count do
(
editTextUniqueName = " attrName_EB_" + a
edittext editTextUniqueName "Layer Names" fieldWidth:200
)--end for loop
)--end rollout
)--end attributes
)--end function
layerInfoArray = #("Info1", "Info2", "Info3")
createCustomAttrs(layerInfoArray)
but this produces errors. Any help would be great. I'm usually working in Maya with Python but need to work in Maxscript.. finding the lack of doco to be a tad tiresome :)
Cheers
D.
I'm trying to script some custom attributes to a simple box object in order to store some information about the layers in the scene. My issue is that, I need to store several separate parameters, and I can't seem to code/script a unique name for either the Custom Attribute name or the rollout parameter name, or even the editable box unique name. I have tried using a variable to assign the name, but get errors, I have also tried using a for loop inside the rollout creation component, in order to add several 'edittext' box's of separate names... but get errors...
The following is the basic setup:
fn createCustomAttrs layerArgs=
(
renderLayersCA = attributes "LayerList"
(
parameters main rollout:params
(
attrNameType type:#string
)--end parameters
rollout params "Render_Layer"
(
edittext attrName_EB "Layer Names" fieldWidth:200
)--end rollout
)--end attributes
)--end function
but this is what I want to do:
fn createCustomAttrs layerArgs=
(
renderLayersCA = attributes "LayerList"
(
parameters main rollout:params
(
for x = 1 to layerArgs.count do
(
attrTypeName = "LayerInfo_" + x
attrTypeName type:#string
)--end for loop
)--end parameters
rollout params "Render_Layer"
(
for a = 1 to layerArgs.count do
(
editTextUniqueName = " attrName_EB_" + a
edittext editTextUniqueName "Layer Names" fieldWidth:200
)--end for loop
)--end rollout
)--end attributes
)--end function
layerInfoArray = #("Info1", "Info2", "Info3")
createCustomAttrs(layerInfoArray)
but this produces errors. Any help would be great. I'm usually working in Maya with Python but need to work in Maxscript.. finding the lack of doco to be a tad tiresome :)
Cheers
D.
