PDA

View Full Version : Creating controls for Tags in the Attributes Panel?


Scott212
03-07-2008, 09:52 PM
Can't seem to find anywhere how this relation ship works in COFFEE. Say I've already created a PluginTag class that works but want to give the user some control over it's variables, how do I get my options into the Attributes panel?

Per-Anders
03-07-2008, 10:07 PM
[Edit, just noticed you were using COFFEE]

You would get the object the tag was on, then simply write the variable name without a semicolon after it and then if you drag & drop the element from the AM into the coffee editor after that it'll fill it in with something like myobject#ID_USERDATA:1 then you can simply use that to set/get anything from the GUI as if it's a standard variable e.g. myobject#ID_USERDATA:1 = 10.0; or var myvar = myobject#ID_USERDATA:1; etc

Scott212
03-07-2008, 10:39 PM
Thanks for your reply but perhaps I didn't explain myself well enough. What you demonstrated was how to get and set attributes from COFFEE, but I need to CREATE attributes for my custom Tags. So for example:

class Test_ExpTagPlugin : PluginTag
{
public:
Test_ExpTagPlugin();
GetID();
GetName();
UseMenu();
Execute();
}

Test_ExpTagPlugin::CamOverscan_ExpTagPlugin()
{
super();
}

Test_ExpTagPlugin::GetID()
{
return 1001;
}

Test_ExpTagPlugin::GetName()
{
return "Test_Tag";
}

Test_ExpTagPlugin::UseMenu()
{
return TRUE;
}

Test_ExpTagPlugin::Execute()
{
println("hello expression world");
}

When I run this code by right-clicking on the object and running "Test_Tag", it does create a tag on that object. When you select the tag it gives it's name and layer in the attributes panel, but I want to add my own attributes to interact with it. Is this common enough that someone might know how it's done?

Kuroyume0161
03-07-2008, 10:45 PM
Buy Rui Batista's COFFEE book. You'll have everything you need. It is a bit complicated to explain how to set up attributes for plugin tags (etc.). It requires a resource file (.res) and possibly a string file (.str) and then setting and getting the attributes in the tag's methods.

Scott212
03-07-2008, 10:54 PM
Thanks man, I think I shall do that. Now I at least know what I'm looking for! Also looks like the HelloWorld2 example does just this.

CGTalk Moderation
03-07-2008, 10:54 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.