View Full Version : "Add ...tag to active object" as a button in the interface
Creature 12-13-2007, 04:53 PM Is there a way to add buttons for adding tags to the active object to the interface? For example I'm using the Compositing Tag quite a lot. It would be nice to have a button for it which just adds it to the object that is selected when I press it.
|
|
govinda
12-13-2007, 05:39 PM
Doesn't look possible with the core. Probably easy enough as a script, maybe even something a scriptard like me can do.
I second this, definitely.
Managing comp tags is kind of a hole in C4D. Comp tags need unique names so that they can be filtered usefully using View>Vertical Tags and then the search field (that part is mostly up to the user obviously), and the object passes they produce need to have customizeable names also (that part is a significant shortfall of the app).
A compositing tag manager to track what pass does what would be very nice, if a bit of a chore, reducing the need to use separate text files that might become error-ridden in the hands of a sloppy user.
Rantin Al
12-13-2007, 05:54 PM
There is a collection of 15 scripts by MJV available over at the Cafe (http://www.c4dcafe.com) downloads section which allow for this.
I have the XPresso and Constraint tag buttons as main menu features.
Cheers, Alan.
tcastudios
12-13-2007, 07:50 PM
Hey there.. With a liiiitle bit of attention, some intention to use the search function (especially in the dedicated Script thread up on top) as well as a small portion of imagination most of you would get this. You will see the similarities with the "Add Object" thread.
Paste the lot in ScriptManager, put something pretty in the Viewport, hit "Render Icon".
Drag the Icon where you want it into your Layout and (re-) save the Layout.
Cheers
Lennart
// Add Tag Example 1
// Add a Tag on all selected objects
var doc = GetActiveDocument(); // Should be really since you are working in it,
if(!doc) return; // but better safe than sorry. More of a plugin issue
var obj = doc->GetFirstObject(); // We are scanning from first object in document
if(!obj) return; // No object in document, nothing to do
if(obj->GetBit(BIT_AOBJ)) obj=obj; // If first object is selected we start from it
else obj=obj->SearchNext(BIT_AOBJ); // else we search for the next selected
doc->StartUndo(); // Start the Undo process
var count = 1; // Start number for the naming process
while(obj) // For each selected object we scan we add a tag....
{
var objname = obj->GetName(); // Get name of obj
var tag = AllocTag(Tcompositing); // Create a CompTag
tag#ID_BASELIST_NAME = stradd(objname,"_Comp_",tostring(count));// Set a numbered name based on obj
doc->AddUndo(UNDO_TAG_NEW,tag); // load the Undo cue
//tag#COMPOSITINGTAG_BACKGROUND = 1; // Optional pre set a Compositing function
//tag#COMPOSITINGTAG_SEENBYCAMERA = 0; //
obj->InsertTag(tag); // Add the tag to obj
count++; // Increase the naming number
obj=obj->SearchNext(BIT_AOBJ); // Get next selected object as long as there is any
}
doc->EndUndo(); // Done and regrettable
LucentDreams
12-13-2007, 11:03 PM
Or if its your own personal command you can make it as simple as:
main(doc, op)
{
var myTag = AllocTag(XXXXXXX);
op->InsertTag(myTag);
myTag->SetBit(BIT_ATAG);
doc->AddUndo(UNDO_TAG_NEW, myTag);
}
where XXXXXXX is the ID number for the specific tag.
govinda
12-13-2007, 11:10 PM
Thanks Lennart, as much for the 'Render Icon' tip as for the script. A little clapperboard icon now sits on my interface. And on an unrelated matter there went my third (fourth?) purchase of SteadyCam off to you for processing.
Kai, what do you mean by 'your own personal command'?
LucentDreams
12-14-2007, 06:06 AM
well just that lennarts while being the much better code is pretty overkill if its a script for yourself. Its much easier to edit a script if theres little to decipher and edit so if I'm not sharing a script I keep it super simple. The ones I make for Cineversity take a lot longer than when I first make them because I add a lot of notations and extra commands that make for a more professional script.
so basically if its a script your not sharing then I'd keep it simple.
Creature
12-14-2007, 08:10 AM
Thanks a lot folks. I was using the search function but "add tag", "tag script" and search strings like this gave me nothing. Thanks again
Augustronīc
12-20-2007, 02:32 PM
I have a ready made script for adding the compositing tag.
Come over and get it. :-)
Have a nice day!
Aloha Achim
Horganovski
12-29-2007, 11:01 PM
Probably a dumb question, but where can you find the ID numbers for Tags? They don't seem to show up in the Command manager.
Cheers,
Brian
Cactus Dan
12-30-2007, 03:25 AM
Probably a dumb question, but where can you find the ID numbers for Tags? They don't seem to show up in the Command manager.
Cheers,
Brian
Howdy,
if you look in the folder resource/_api for a file named "ge_prepass.h" and open it in any text editor, scroll down until you see the line:
// tags
... and following that you'll see a list of the tags and their ID's. ;)
Adios,
Cactus Dan
Horganovski
12-30-2007, 03:46 AM
Many thanks Dan, I don't think I would have found that by accident :)
If I could ask one more question, is there usually a file that most 3rd party plugins use to define the ID for plugin tags or do they work differently to the inbuilt ones ?
Cheers,
Brian
Cactus Dan
12-30-2007, 03:56 AM
Howdy,
Plugin ID's are usually compiled right into the plugin, so the only ones you can find are the ones that show up in the Command Manager.
Adios,
Cactus Dan
Horganovski
12-30-2007, 04:10 AM
That's great to know thanks, I was just searching to see if I could tame a couple of errant but usefull plugins by adding icons for them :), my brain has a hard time remembering all of the options I have to tackle a particular task sometimes and I find plugins that are 'Tag-only' tend to get forgotten about..
Of course all the better plugins (not looking at anyone in particular :D) come with sample icon pallets in the folder !
Thanks again,
cheers,
Brian
CGTalk Moderation
12-30-2007, 04:10 AM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.