• Append string the node path in retrieving the port?

    python r25
    3
    0 Votes
    3 Posts
    338 Views
    B
    @ferdinand Thanks for the clarification and offering some alternatives. I guess it has something do with how it was designed. There is a FindChild equivalent in other DCC API too like in maya there is a GetAttr or something. But again, if you know the actual parameter/attribute path like texturenode.tex0.colorspace texturenode.uv.uv_channel texturenode.remape.scale.x There's no need. It's straightforward. You use that instead. Anyhow, will close this thread now.
  • API for Project Asset Inspector?

    r25 python
    3
    0 Votes
    3 Posts
    720 Views
    B
    @ferdinand Thanks for the response. RE: we never expose managers themselves Gotcha. Thanks for the clarification RE: Code Works as expected. Closing this thread now.
  • Change the ColorSpace of Redshift Texture Node?

    r25 python
    6
    1
    1 Votes
    6 Posts
    1k Views
    B
    @Dunhou @Manuel Thanks for the response. I ended up going for the ctrl+C on the node editor Pretty straightforward and works as expected. Functions like how you copy/paste nodes on Fusion and Nuke.
  • Creation of UVW tag for a plane

    Moved
    2
    1
    0 Votes
    2 Posts
    465 Views
    ManuelM
    hi, you can use CallUVCommand. The forum also has different thread already talking about it. This one for example, explain how to use command to pack your UVs. It shows how to automatically unwarp your model and answer what you are looking for. This is done using SendModelingCommand with some parameters, those parameters can be found here in the c++ documentation. Of course, you can also create the uvw tag yourself and define the uvw coordinates as you wish. You have this thread for example that shows how to do a planar projection. Cheers, Manuel
  • Python scripting tag editing object position and points

    python
    3
    0 Votes
    3 Posts
    369 Views
    C
    Hi Ferdinand, Thanks a lot for your in-depth answer! I was assuming it was possible, but now I know for sure! Cheers, Casimir Smets
  • Selection Order Flag for GetActiveMaterials?

    r25 python
    3
    0 Votes
    3 Posts
    318 Views
    B
    @Manuel Gotcha. Thanks for the confirmation.
  • String values for the "FindChild"?

    python r25
    13
    0 Votes
    13 Posts
    1k Views
    B
    @Manuel Gotcha. Thanks for the clarification. Sorry for the trouble. Works as expected. Will close this thread now.
  • Set c4d.InExcludeData() has something didn't expect.

    s26 python windows
    3
    0 Votes
    3 Posts
    469 Views
    DunhouD
    @ferdinand Thanks for that solution. It's happy to hear that , I do try to make win-win clear post as I can to don't waste our time , hope it's a worthy work I tested the new GetUpdatedInexcludeData function , it worked well , The "click twice" thing never happen again . It's the None condition I didn't realize before . It does happend when no or single object in the list . And for the "odd place" and the "exception ", it is a test to make sure all the things above work well( after that are all the settings ) . I forgot move to the right place . sorry to that Thanks for the caring code for c4d.utils.DegToRad(360) , I haven't notice this before and just stupid import radians
  • How to select directories in a CUSTOMGUI_FILENAME?

    s26 python
    3
    0 Votes
    3 Posts
    706 Views
    P
    Hi @ferdinand , Thanks a lot, that's exactly what I was looking for ! flags: c4d.BaseContainer = c4d.BaseContainer() flags[c4d.FILENAME_DIRECTORY] = True # Add a CUSTOMGUI_FILENAME with our flags settings. self.AddCustomGui(id=MyDialog.ID_FILENAME, pluginid=c4d.CUSTOMGUI_FILENAME, name="Path", flags=c4d.BFH_SCALEFIT, minw=0, minh=0, customdata=flags)
  • Plug-in running fine on one OS but not another

    windows sdk
    13
    1
    0 Votes
    13 Posts
    2k Views
    Y
    @ferdinand Yes. it's solved. Thank you.
  • ActiveObjectManager_SetObject to display BaseObject in a GetListHead

    c++ sdk
    2
    0 Votes
    2 Posts
    422 Views
    ferdinandF
    Hello @kbar, Thank you for reaching out to us. This is a tricky one to answer, and my first instinct was that this is not too surprising due to what you do with your GeListHead, but the devil lies in the detail. In general, I would say that the safest route would be the one many of our implementations take: Displaying elements that are not part of the "standardized" branches of a scene graph via a DescriptionCustomGui wrapped by a custom GUI of yours which is part of a description of a (set of) node type(s) you provide. The FieldList data type/GUI does this for example. Overview Simply adding a custom branch in form of a GeListHead to a node of your choice will not make this custom branch discoverable via BranchInfo. This is because there is hard-coded data in the Cinema 4D core for this branch discovery. You can of course manually traverse the branches of your node. In the Attribute Manager SetObject implementation, this hardcoded branch structure is not being checked directly as far as I can see, but the Attribute Manger modes rely implicitly on it. You can register new Attribute Manger modes with ActiveObjectManager_RegisterMode which binds than that mode to a hook as for example shown in [1] (for materials in this case), see the MESSAGEHOOK documentation for details. It shows the case for tags as used internally. The object mode case is much more complex, but it will effectively fail on AOM_MSG_GETATOMLIST in your scene setup because the traversal done there assumes objects to appear in "object " branches only - which is not true in your case. Solutions I personally would still consider the DescriptionCustomGui route the safest way, especially because the GUI has the DESCRIPTION_OBJECTSNOTINDOC flag which allows you to also display orphaned nodes. Implement your custom attribute manager mode, which can deal with your custom scene traversal structure and mark your nodes with NBIT_ACTIVE so that the hook can find them. Regarding Xpresso nodes: They have their own branches which are respected in the AM implementation. As a warning: There are also quite a few hacks in the AM for Nodes API and shader nodes, especially regarding the traversal. In general, I would consider this non-regular scene structure of yours a problem with the AM because of how often Cinema 4D internally relies on a specific makeup of branches. It could very well be that you implement your AM mode, and everything will then work fine, but I cannot guarantee that. Which is a further point why I personally would gravitate towards the first solution. Cheers, Ferdinand [1]: static GeData MaterialMessageHook(const BaseContainer &msg, void *data) { switch (msg.GetId()) { case AOM_MSG_ISENABLED: return true; case AOM_MSG_GETATOMLIST: { BaseDocument *doc = GetActiveDocument(); if (!doc) break; doc->GetActiveMaterials(*((AtomArray*)data)); return true; } break; } return false; }
  • Can i get global input event ?

    python s26
    3
    0 Votes
    3 Posts
    399 Views
    gheyretG
    @ferdinand Wow~ Thank you so much bro
  • Get Node By Name?

    r25 python
    3
    0 Votes
    3 Posts
    351 Views
    B
    @Manuel Ah gotcha. It's only available R26 onwards. That's why I can't see something related in my R25 documentation.
  • Get asset from asset browser python

    python
    5
    0 Votes
    5 Posts
    1k Views
    K
    @ferdinand Thanks a lot Ferdinand for this detailed and complete answer! This is exactly what I hoped to do! I tested the code and it works great! Since a few of the fixes you use are not recommended, i will solve it in another way for now, until it gets fixed for python, or i switch to C++. I got my plugin doing what i want, for the moment. Pretty sure this will also help someone else in the future. Have a nice day!
  • Iterate through all Inputs and Outputs of a Given Node?

    r25 python
    5
    0 Votes
    5 Posts
    560 Views
    B
    @manuel ah gotcha. the node kinda. thanks. will close this thread for now.
  • Project Tool Stops At Non-Existent Path

    project tool sdk
    4
    1
    0 Votes
    4 Posts
    949 Views
    M
    Hi @Yakuza just in case you do have space in your Cinema 4D space, so the projectool don't understand clearly your input so you need to escape it by adding "" so something like: kernel_app_64bit.exe g_updateproject="D:\MAXON_CODE\Maxon Cinema 4D 2023_CODE\sdk" Cheers, Maxime.
  • Undo for InsertUnder() is not right. Why?

    python
    4
    4
    0 Votes
    4 Posts
    753 Views
    ferdinandF
    Thanks! Sorry, I am so careless that I ignore the message "Needs to be called before the change.". No worries, you are not the first one who trips over Undo call order, including myself at some point
  • Python. Cinema4d. All iterations in the Text value

    9
    2
    0 Votes
    9 Posts
    1k Views
    S
    @ferdinand thx very much! ill save this
  • create_nodematerial.py from Github not working

    r25
    5
    0 Votes
    5 Posts
    601 Views
    M
    Hi @bentraje I think there was a small misscommunication what was fixed on Github was the fact that the file does not contain the information of which Cinema 4D version they are working. We are not going to adapt our GitHub script to make it work for R25. If you want code that is going to work for R25, the only solution is to download the python SDK for R25. Cheers, Maxime.
  • Sample Code for Connecting Ports/Nodes?

    r25 python
    4
    1
    0 Votes
    4 Posts
    463 Views
    ManuelM
    hi, There are no particular reasons. Muting a connection is less intuitive than connect two nodes. If there was a function like Connect to mute the connexion, we would not have created that example neither. Cheers, Manuel