Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
On 08/04/2017 at 07:09, xxxxxxxx wrote:
Hello,
Is it possible to set the attribute manager mode, via a script, for example? Would it need to be active/in focus first? It would be nice to have the modes as buttons or tabs for quicker/easier access. Maybe this post would be better suited for the plugin requests, I wasn't sure.
On 08/04/2017 at 07:38, xxxxxxxx wrote:
I guess this function is made for that. https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.gui/index.html?highlight=manager#c4d.gui.ActiveObjectManager_SetObject
On 08/04/2017 at 08:36, xxxxxxxx wrote:
This seems to work sometimes, I made this super minimalist script https://github.com/NNNenov/C4Dhandy/blob/master/scripts/setAttributeManagerWindow.py
In the cases it doesn't work, e.g. ACTIVEOBJECTMODE_TOOL; I have an editable poly cube and I set the attribute manager to a mode other than tool mode, when I execute the script with id as c4d.ACTIVEOBJECTMODE_TOOL
It shows project settings mode instead, noticed this happens with other modes too. Maybe I didn't set up the script properly and it defaults to project settings mode..
On 08/04/2017 at 08:58, xxxxxxxx wrote:
Basicly c4d help you and set the mode according to the op you pass throught it. Here you have a quick exemple...
import c4d def main() : #obj obj = op c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_OBJECT, obj, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN) #tag tag = op.GetTags()[0] c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_TAG, tag, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN) #mat mat = doc.GetActiveMaterial() c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_MATERIAL, mat, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN) #shader sha = mat.GetFirstShader() c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_SHADER, sha, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN) #tool tool = c4d.plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL) c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_TOOL, tool, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN) if __name__=='__main__': main()
On 08/04/2017 at 10:07, xxxxxxxx wrote:
Ahh I see, that makes sense! thanks a lot!