[SOLVED]How to hide tags in Object Manager?
-
On 26/01/2017 at 20:06, xxxxxxxx wrote:
Hi,guys.
Why does this code don't work from Python tag?
tag.ChangeNBit(c4d.NBIT_THIDE, c4d.NBITCONTROL_SET)
what am I doing wrong? Please help
Thank you.
-
On 27/01/2017 at 03:03, xxxxxxxx wrote:
Hello,
welcome to the Plugin Café forums !
Smile
[URL-REMOVED]I have moved this thread to the Python sub-forum, I felt, that's more appropriate.
It's not possible to dynamically hide tags. The bit NBIT_THIDE has nothing to do with tags, but is for hiding objects in the timeline. Unfortunately this information is missing currently in the Python docs, in such cases it can be a good idea to check our C++ Docs, where there's at least a bit more info on NBIT_THIDE.
But you can hide your own custom TagData plugin (assuming it's your Python tag, you want to hide), when it is registered (info parameter, tag plugin flag
TAG_VISIBLE). This of course means, you'd have to move your code from a Python tag into a TagData plugin, but that's nothing you should be afraid of. Basically the code from your Python tag would go into the Execute() function of the plugin and you'd basically need to add the registration stuff around. Therefore I'd say, take a look at the Python examples on GitHub, e.g. the Py-LookAtCamera.
[URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.
-
On 27/01/2017 at 17:27, xxxxxxxx wrote:
You actually can with NBIT_OHIDE. Not sure if NBIT_THIDE is used somewhere, since there's also flags
to hide a node in each timeline window separately.Container object does just that, btw.
Cheers,
-Niklas -
On 27/01/2017 at 20:47, xxxxxxxx wrote:
Hello Niklas,
Thank you very much for your answer. -
On 30/01/2017 at 02:44, xxxxxxxx wrote:
Uh oh!
I'm terribly sorry for delivering false informationThanks Niklas for correcting me.
To be honest, I believed in our documentation and wasn't aware NBIT_OHIDE (in C++ docs) works for tags as well. Indeed it does and I will correct the docs accordingly.
Sorry, guys! -
On 30/01/2017 at 20:41, xxxxxxxx wrote:
Hi,Andreas
Thanks so much for your detailed response!
I am trying this code below,and it works well!import c4d def main() : obj = op.GetObject() tag = obj.GetTag(1001149) tag.ChangeNBit(c4d.NBIT_OHIDE,c4d.NBITCONTROL_SET)