CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
reply share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 04-08-2014, 07:09 PM   #1
youn3d
New Member
Lionel CHAUVIN
United Kingdom
 
Join Date: Apr 2004
Posts: 3
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-09-2014, 08:22 PM   #2
PePeTD
The One and Only
 
PePeTD's Avatar
portfolio
Felipe Nogueira
Technical Artist
Bethesda Softworks
Rockville, USA
 
Join Date: Jul 2008
Posts: 208
Send a message via ICQ to PePeTD Send a message via MSN to PePeTD
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-09-2014, 08:28 PM   #3
Klvnk
Lord of the posts
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 699
depends on the object, for nodes you can use the
Code:
.handle
property
 
Old 04-09-2014, 08:40 PM   #4
youn3d
New Member
Lionel CHAUVIN
United Kingdom
 
Join Date: Apr 2004
Posts: 3
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-10-2014, 04:45 AM   #5
PePeTD
The One and Only
 
PePeTD's Avatar
portfolio
Felipe Nogueira
Technical Artist
Bethesda Softworks
Rockville, USA
 
Join Date: Jul 2008
Posts: 208
Send a message via ICQ to PePeTD Send a message via MSN to PePeTD
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-11-2014, 11:44 AM   #6
youn3d
New Member
Lionel CHAUVIN
United Kingdom
 
Join Date: Apr 2004
Posts: 3
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-11-2014, 12:53 PM   #7
gazybara
Architect
 
gazybara's Avatar
portfolio
Branko Živković
Freelancer
Niš, Serbia
 
Join Date: Apr 2011
Posts: 1,103
Quote:
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-12-2014, 06:19 PM   #8
LoneRobot
Swami Lama's Lovechild
 
LoneRobot's Avatar
portfolio
Pete Addington
Technical Director
Nexus
United Kingdom
 
Join Date: Dec 2004
Posts: 1,784
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 11:59 PM.


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