Notifications
Clear all

[Closed] Custom Attributes totally driving me crazy

 JHN

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.
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

5 Replies
2 Replies
(@lonerobot)
Joined: 1 year ago

Posts: 0

most certainly not. I used paul’s CA management utility in his rigging utilsfor years until max changed to dotnet – since then i have usedgrant adam’s CA manager. Hey paul, is your one retired now or have you swapped the old AX stuff over?

 PEN
(@pen)
Joined: 1 year ago

Posts: 0

Not fully retired but I really need to get it set up with Dotnet. Just another one of those things on my very long list of things to do. It is on the list just after putting my feet up and enjoying life at the moment.

 PEN

First off if you are in 2009 make sure that you have the service packs installed as it will solve the problems of the breaking wires. This has nothing to do with the CA Defs as far as I know but I param wire to a CA def problem.

As for CA defs in general I use them all the time and I don’t have a problem with them. One thing to note is to make sure that you are using unique defs when you need them, this can be a bit more of a hassle them you are reusing an existing rig in which case you should just be able to do as you suggest and make it unique.

I don’t know why the help files show the name of the attribute in a string, this isn’t how you write it so don’t.

def=attributes testAttrib
(
   --Local variables

   Parameters paramsP rollout:paramsR
   (
   ) 

   --Functions

   rollout paramsR "Params:"
   (
   )
)

That is generaly how I setup my CA Defs. I also setup scripted plugins the same way. I use scripted modifier plugins a lot for custom UI controls instead of CA defs. If I have a section of code and UI controls that I know will be used on all characters or objects then I create a modifier for it. I can then apply CA Defs to that modifier that are unique to that character. The modifier knows to search it self for CA Defs that are on if for operations like keying or resetting lets say.

I never use the attribute editor and I can’t see that it will ever be robust enough for me to do so.There is unlimited possibilities when you code it all your self.

And right above that code is this:

The name is a descriptive name for the definition and can be either a <name> or a <string>.
It appears it will convert the string to a name.

-Eric

 eek
attributes 'this is my attribute' 
  • i think is possible too. But I never do that, tend to just keep it simple like weaponAttribs.