Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / SDK / Getting Control name
  RSS 2.0 ATOM  

Getting Control name
Rate this thread
 
33319
 
Permlink of this thread  
avatar
  • qwas-
  • Posted: 18 August 2009 02:15 AM
  • Total Posts: 8
  • Joined: 17 August 2009 08:28 AM

Hello everybody,
I have such problem - I am making export plugin and one of the parms I need to export contained in float control(CTRL_FLOAT_CLASS_ID), i do can cast it to Control* and get it’s value using GetValue function, but i also need to have something like name of it control? Is this possible?



Replies: 0
avatar
  • malmer
  • Posted: 24 August 2009 10:08 PM

The name is not stored in the control, since it can be instanced and put all over the place. The name can be found in the subanim that you get the control from. So for instance if you have an object with a property called “Amount” then call SubAnimName on the object/owner. I suspect you are using SubAnim(int) to get the controller, so SubAnimName is the sister function for this.



Replies: 0
avatar
  • qwas-
  • Posted: 25 August 2009 04:00 AM

Tanks for the reply, but situatin is not so easy( This Control is not referenced by sub anim. It can be found from it’s “parent"(actualy not parent but object that references it) only via Reference system. Hovewer, I get this “parent” via subAnim(i), but when I call subAnimName(i) function returns void string…



Replies: 2
/img/forum/dark/default_avatar.png

So you have a Control* pointer and want the name? How about using the ClassDirectory? I haven’t tried this, but in theory it should work:

void MCHAR* GetClassName(Animatable* a)
{
DllDir* lookup = GetCOREInterfaces()->GetDllDirectory()
ClassDirectory& dirLookup = lookup->ClassDir()
ClassDesc* desc = dirLookup.FindClass(a->SuperClassID(), a->ClassID())
return desc->ClassName()
}</pre>

Let me know if it does the trick.

Author: Christopher Diggins

Replied: 27 August 2009 08:02 AM  
/img/forum/dark/default_avatar.png

Yeah, it works, but… it is not actually what I wanted;) The code that You provided gives me name of the plugin class(it returned “Bezzier Float"), but what I need is something like name of the instance of this class, if any…
In general, this control is a pretty strange thing. It represents value of interpolation combo-box from “gradient ramp” map, and can be found deeply inside RefTargets tree. I can’t find it anywhere else, so at this moment it is the only way for me to get it’s value. Maybe someone knows other ways to get both: name and value of this combo-box?

Author: qwas-

Replied: 31 August 2009 03:02 AM