JHN
04-24-2009, 02:00 PM
I have no problem wanting to work with custom attributes, but what a pain it is to set it up and or change.
Example.
I want to use the same type custom attributes on several objects, each with their own parameters. I use a setup like described here (http://forums.cgsociety.org/showthread.php?f=98&t=756450).
I doesn't work, I get errors when starting up after that there are no problems any more... !?
In the manual there's different samples on setting up CA's.
On the "Scripted Custom Attributes" page is the weapon CA example
weaponDataCA = attributes weaponData
(
parameters main rollout:params
(
hitPoints type:#float ui:hits default:10
cost type:#float ui:cost default:100
sound type:#string
)
rollout params "Weapon Parameters"
(
spinner hits "Hit Points" type:#float
spinner cost "Cost" type:#float
dropdownlist sound_dd "Sound" items:#("boom", "sparkle", "zap", "fizzle")
on sound_dd selected i do sound = sound_dd.items[i]
)
)
Especially notice the first declaration. The name of the CA is not a string type.
On the same page a little above is this
gameDataCA = attributes "Game Data"
(
...
)
The attribute declaration now has name in string format... why?!
Then there's also this thread: http://forums.cgsociety.org/showthread.php?f=98&t=669801
I propose that you create a CA from a string each time you need an unique CA, but shouldn't
custAttributes.add $ CA #unique
take care of that?!
I also tried the string approach on my other thread and still errors.... I would like to know what I do wrong, and really would like this custom attributes documentation not so scattered all over the place like stuff in scripted plugins and stuff in CA documentation.
And max should definitely improve on the handling and editing of the CA. The parameter editor is not a tool to do serious tool work with...
Please share your thoughts or show me the light or something...
Thanks for bearing with me...
-Johan
Example.
I want to use the same type custom attributes on several objects, each with their own parameters. I use a setup like described here (http://forums.cgsociety.org/showthread.php?f=98&t=756450).
I doesn't work, I get errors when starting up after that there are no problems any more... !?
In the manual there's different samples on setting up CA's.
On the "Scripted Custom Attributes" page is the weapon CA example
weaponDataCA = attributes weaponData
(
parameters main rollout:params
(
hitPoints type:#float ui:hits default:10
cost type:#float ui:cost default:100
sound type:#string
)
rollout params "Weapon Parameters"
(
spinner hits "Hit Points" type:#float
spinner cost "Cost" type:#float
dropdownlist sound_dd "Sound" items:#("boom", "sparkle", "zap", "fizzle")
on sound_dd selected i do sound = sound_dd.items[i]
)
)
Especially notice the first declaration. The name of the CA is not a string type.
On the same page a little above is this
gameDataCA = attributes "Game Data"
(
...
)
The attribute declaration now has name in string format... why?!
Then there's also this thread: http://forums.cgsociety.org/showthread.php?f=98&t=669801
I propose that you create a CA from a string each time you need an unique CA, but shouldn't
custAttributes.add $ CA #unique
take care of that?!
I also tried the string approach on my other thread and still errors.... I would like to know what I do wrong, and really would like this custom attributes documentation not so scattered all over the place like stuff in scripted plugins and stuff in CA documentation.
And max should definitely improve on the handling and editing of the CA. The parameter editor is not a tool to do serious tool work with...
Please share your thoughts or show me the light or something...
Thanks for bearing with me...
-Johan
