<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Automatically solo objects by using the &#x27;path&#x27; of the object manager?]]></title><description><![CDATA[<p dir="auto">Hey there,<br />
I'd love to be able to automatically solo the object that are inside the current 'path' parameter in the object manager. Is this possible using python or an easier method. This way the object manager and the viewport would have continuity with each other.<br />
Thanks</p>
]]></description><link>http://developers.maxon.net/forum/topic/16219/automatically-solo-objects-by-using-the-path-of-the-object-manager</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 22:46:51 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/16219.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 May 2025 12:35:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Automatically solo objects by using the &#x27;path&#x27; of the object manager? on Wed, 07 May 2025 13:05:37 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/lionlion44">@<bdi>lionlion44</bdi></a>,</p>
<p dir="auto">Well, doing what you want to do is only halfway possible. An object being soloed just means setting the flag <code>EHIDE</code> on all othe objects. And while there is <code>OHIDE</code> which can be used to hide scene elements in managers, e.g., an object in the Object Manager, it is not being used by the 'Set as Root/Path Bar'-function of the Object Manager. So, you cannot hook into that.</p>
<p dir="auto">What you can do is just write a simple script which operates both flags for you. But to make this air-tight, you will have to implement a plugin (to avoid accidentally saving a scene with hidden elements).</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
<h4>Result</h4>
<p dir="auto"><video class="embed-video-local" controls src="/forum/assets/uploads/files/1746623027330-vid.mp4">
<h4>Code</h4>
<pre><code class="language-py">"""Demonstrates how to set the visibility of objects in the viewport and the managers.

- When CTRL is not pressed while the script is invoked, the visibility state of the selected objects 
  is set, i.e., everything that is not selected will be hidden.
- When CTRL is pressed, the visibility state of the selected objects is cleared.
- When HIDE_DESCENDANTS_OF_SELECTED_OBJECTS is set to True, the descendants of selected objects will 
  be considered selected as well.

WARNING: The visibility state is written PERMANENTLY into the scene graph, i.e., when one hides 
objects and saves the scene, the visibility state will be saved as well. One can of course just run 
the script while pressing CTRL to clear the visibility state of such saved and then loaded back 
scene, but this could possibly brick scenes for other users. To make this air-tight, one would have
to implement a plugin which handles un-hiding objects before a scene is being saved (which is not 
super trivial in Python atm).

Use this script at your own risk.
"""
__author__ = "Ferdinand Hoppe"
__copyright__ = "Copyright 2025, Maxon Computer GmbH"

import c4d
import mxutils

doc: c4d.documents.BaseDocument  # The currently active document.
op: c4d.BaseObject | None  # The primary selected object in `doc`. Can be `None`.

# Wether to hide objects that are descendants of selected objects. I.e., when you have A-&gt; B -&gt; C, 
# and A is selected, B and C will be considered selected as well.
HIDE_DESCENDANTS_OF_SELECTED_OBJECTS: bool = True

def IsSelected(node: c4d.BaseObject) -&gt; bool:
    """Returns if #node is selected or if any of its predecessors are selected (when selecting 
    descendants implicitly is enabled).
    """
    while node:
        if node.GetBit(c4d.BIT_ACTIVE):
            return True
        if not HIDE_DESCENDANTS_OF_SELECTED_OBJECTS:
            break
        node = node.GetUp()
    
    return False

def SetObjectVisibility(doc: c4d.documents.BaseDocument, clearSate: bool = False) -&gt; None:
    """Sets the visibility of the object in the managers and the viewport.
    """
    for node in mxutils.IterateTree(doc.GetFirstObject(), True, True, True):
        isSelected: bool = clearSate or IsSelected(node)
        node.ChangeNBit(c4d.NBIT_OHIDE, c4d.NBITCONTROL_CLEAR if isSelected else c4d.NBITCONTROL_SET)
        node.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_CLEAR if isSelected else c4d.NBITCONTROL_SET)

def main() -&gt; None:
    """Called by Cinema 4D whhen the 
    """
    if not op:
        c4d.gui.MessageDialog("No object selected.")
        return

    state: c4d.BaseContainer = c4d.BaseContainer()
    if not c4d.gui.GetInputState(c4d.BFM_INPUT_MOUSE, 0, state):
        raise RuntimeError("Failed to get input state")
    ctrlIsPressed: bool = state[c4d.BFM_INPUT_QUALIFIER] &amp; c4d.QUALIFIER_CTRL
    
    # If Ctrl is pressed, clear the visibility state, otherwise set it.
    SetObjectVisibility(doc, True if ctrlIsPressed else False)
    c4d.EventAdd()

if __name__ == '__main__':
    main()
</code></pre>
</video></p>]]></description><link>http://developers.maxon.net/forum/post/76426</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/76426</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Wed, 07 May 2025 13:05:37 GMT</pubDate></item><item><title><![CDATA[Reply to Automatically solo objects by using the &#x27;path&#x27; of the object manager? on Tue, 06 May 2025 16:54:36 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/ferdinand">@<bdi>ferdinand</bdi></a> ,</p>
<p dir="auto">Thanks for the quick response. To describe my request more specifically, I was wondering if the path bar in an object manager could be used to solo objects. This way I could  have multiple nulls containing different parts of the project, then by setting the root of the path bar to a null it would solo the things in that null. This would also mean I'm only seeing the soloed objects in the object manager. That's what I meant by continuity, the object manager and the viewport would have the same content.</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1746520996041-e7f74689-3d79-4599-937a-3b2dff4fd1da-image.png" alt="image.png" class=" img-fluid img-markdown" /><br />
<img src="/forum/assets/uploads/files/1746521025364-50f8d049-cbc9-4a6d-bd13-330c6d2a7fb7-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Ultimately, I'm trying to find a workflow that allows for isolating chunks of the project to be worked on one at a time but the basic solo feature is a bit. After doing a bit more research it looks like layers is the way to go. When using layers the solo feature hides the other layers in the viewport and the object manager. If the original idea is still possible I'd be interested, simply because I think it would be a bit more frictionless (no need to add object to layers, soloing tied to object hierarchy, workspaces inside of workspaces). But I understand it's a strange request. I'm comfortable using the standard layers and soloing features for now.</p>
<p dir="auto">Cheers,<br />
Leo</p>
]]></description><link>http://developers.maxon.net/forum/post/76411</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/76411</guid><dc:creator><![CDATA[lionlion44]]></dc:creator><pubDate>Tue, 06 May 2025 16:54:36 GMT</pubDate></item><item><title><![CDATA[Reply to Automatically solo objects by using the &#x27;path&#x27; of the object manager? on Mon, 05 May 2025 13:55:05 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/lionlion44">@<bdi>lionlion44</bdi></a>,</p>
<p dir="auto">Welcome to the Maxon developers forum and its community, it is great to have you with us!</p>
<h4>Getting Started</h4>
<p dir="auto">Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.</p>
<ul>
<li><a href="/forum/topic/15242/">Forum Overview</a>: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.</li>
<li><a href="/forum/topic/15244/">Support Procedures</a>: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.</li>
<li><a href="/forum/topic/15243/">Forum Features</a>: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.</li>
</ul>
<p dir="auto">It is <strong>strongly</strong> recommended to read the first two topics carefully, especially the section <a href="/forum/topic/15244/support-procedures/4">Support Procedures: How to Ask Questions</a>.</p>
<h4>About your First Question</h4>
<p dir="auto">I do not really understand your question, specifically what you mean with <em>'current path of the object manager'</em> and the Object Manager and viewport having <em>'continuity'</em>. An Object Manager has no <em>'current path'</em> and there is also more than one Object Manager (up to four). You can already link the active object state to the solo state of the scene graph, i.e., just select objects to solo them (see below). The only way to provide more <em>'continuity'</em> would be to hide objects in the Object Managers which are not soloed. That would be technically possible, but not really a good idea, as you  would then have no way to deselect these soloed objects as everything else would be hidden both in the viewport and Object Managers.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
<p dir="auto"><video class="embed-video-local" controls src="/forum/assets/uploads/files/1746453144231-123.mp4">
</video></p>]]></description><link>http://developers.maxon.net/forum/post/76403</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/76403</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Mon, 05 May 2025 13:55:05 GMT</pubDate></item></channel></rss>