How to avoid object's name?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
Old 04 April 2014   #1
How to avoid object's name?

Hi everybody,
I'm wondering if there is another way to call an object than with its name.
For a controller picker, for example, I would like to rely on something else than the name just in case the animator change the name by mistake.
I would like to store some information in the object like an "hidden" name and other parameters like "right" "left" etc.
Thanks for your help.
 
Old 04 April 2014   #2
There are multiple ways to which you could do this.

1 - You could add a hidden attribute to the controllers that contains a certain TAG you want, so now if you created your character picker through DotNet you could add a .tag to each button with the same value as the TAG in the respective controller, now everytime someone clicks on this button you just have to look for the controller that has the same TAG attribute as the .tag property in your button.

2 - (This is the way I usually do it) Use week references to the controllers http://paulneale.com/tutorials/Scri...kReferences.htm this will make so you can always find the node regardless of the name on it.

Both ways will work , but they have their limitations that would require you to find ways to get around!

Hope that helps.
__________________
Felipe Nogueira aka: PePeTD
Technical Artist/Character TD
http://felipenogueira3d.com
 
Old 04 April 2014   #3
depends on the object, for nodes you can use the
.handle
property
 
Old 04 April 2014   #4
Thank you for your answers.
Everything seems a bit more complicated than what I thaught. I will have to study that more carefully.
Today I was thinking of something else as well, would it be possible to use user defined parameters for that? Anybody tried that before?
 
Old 04 April 2014   #5
From personal experience handles will change when you start merging things in and out of scenes.

I have not tested this in a while and not able to open max right now, but:

1 - reset max
2 - make a box (its handle should be = 1 I believe)
3 - save file as whatevername.max
4 - merge file you just saved
5 - check the handles
6 - merged box should have a handle = 2


Now imagine you refereed to handles in your rig and you merge said rig into a animation scene with sets and props! you got problems! Please let me know if I am mistaken by this or if they have implemented a way to handle this.
__________________
Felipe Nogueira aka: PePeTD
Technical Artist/Character TD
http://felipenogueira3d.com
 
Old 04 April 2014   #6
Thanks a lot for that help.
I have tried the weak references system, it's amazing. Exactly what I was after.
The ".handle" solution would be a lot simplier but I read somewhere else as well about the merging problem.

Thanks again!
 
Old 04 April 2014   #7
Originally Posted by youn3d: Thanks a lot for that help.
I have tried the weak references system, it's amazing. Exactly what I was after.
The ".handle" solution would be a lot simplier but I read somewhere else as well about the merging problem.

Thanks again!

Also you can try GetHandleByAnim and GetAnimByHandle fn's to avoid .handle property problem
__________________
Looking in the right side. [bgaTools]
 
Old 04 April 2014   #8
I wouldn't recommend using handle. I generally use weak references where necessary, however there are two other options to consider -

userpropbuffer
appdata

Userpropbuffer is useful but not the most robust as a user can still mess with it (via the tab in object properties) but does persist with merged and cloned nodes/systems.
Appdata is quick and robust but doesn't transfer with things like cloning operations. It is great from a TD perpective, as it not possible to change except via script.
__________________
Regards,
Pete

Read my technical blog - lonerobot.net
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:02 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.