get Object Visible when is it active [SOLVED]
-
On 11/01/2015 at 04:12, xxxxxxxx wrote:
Hey
is there a way to make sure that a object plugin is visible when is it selected - and after that back to the original visibility
Thanks
-
On 11/01/2015 at 09:06, xxxxxxxx wrote:
Hi Conner,
not sure, but do you mean like activating "Viewport Solo Single" and "Viewport Solo Selection"? -
On 11/01/2015 at 10:26, xxxxxxxx wrote:
By selecting the Objekt in the Objekt manager - i like to make it visible even when parent objects are hidden in the editor
-
On 13/01/2015 at 01:58, xxxxxxxx wrote:
Just to make sure, I'm not searching into the wrong direction, are we talking about arbitrary objects here? Or to you want to achieve this behavior only for objects created by your own object plugin?
-
On 13/01/2015 at 03:03, xxxxxxxx wrote:
Primary I like to achieve this for my own Object from my object plugin.
Secondary it will be a nice option to achieve this behavior for all children of my Object
-
On 15/01/2015 at 04:35, xxxxxxxx wrote:
Hi,
I did some research on this.
You have several options to achieve this for your own object.
Both the GetVirtualObjects() as well as the Execute() function of your ObjectData plugin get called on selection changes. You can check the BIT_ACTIVE and based on that call SetEditorMode() accordingly.Just be careful, to make this behavior clearly understandable for your user. He should have an option to turn off such functionality. Otherwise he may get confused, as he might set the visibility of the object manually and may wonder, why it gets overridden.
For arbitrary objects you can basically use the same techniques, but would implement them in a SceneHookData plugin.
Sorry, I keep forgetting, I'm in the Python subform... So for arbitrary objects you'd use a SceneHookData plugin and the same techniques described above, if you were writing it in C++. As you try to do it in Python, you unfortunately have no SceneHook. So I don't think, this is possible to do in Python. Sorry.I hope, this helps.
-
On 11/03/2015 at 12:02, xxxxxxxx wrote:
Just want to ask, if my answer helped and if you made progress with your project?
-
On 11/03/2015 at 12:05, xxxxxxxx wrote:
Hey Andreas,
Yes absolut - not the beautiful solution but in this case it work.
def GetVirtualObjects(self, op, hh) : if op.GetBit(c4d.BIT_ACTIVE) == True: op.SetEditorMode(c4d.MODE_ON) else: op.SetEditorMode(c4d.MODE_UNDEF) return None