• Get the Name of the Node?

    Cinema 4D SDK r25 python
    7
    0 Votes
    7 Posts
    2k Views
    M
    You have to be careful since the value returned by effectivename will change according of the Cinema 4D language. The best way is really to work with IDs. Cheers, Maxime
  • A SetBit problem aka cann't select node.

    Cinema 4D SDK python windows
    5
    2
    0 Votes
    5 Posts
    670 Views
    DunhouD
    @ferdinand Thanks for the new solution for SetActiveObject . It works as expected. Much appreciated !
  • How to change bitmap in layered shader?

    Cinema 4D SDK python r19
    3
    0 Votes
    3 Posts
    2k Views
    V
    Perfect! Thank you so much!
  • How to Use ListAllNodes?

    Cinema 4D SDK r25 python
    5
    0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hello @bentraje @bentraje said in How to Use ListAllNodes?: doc: c4d.documents.BaseDocument # The active document. I'm not too familiar with the Python 3 syntax but this line returns an empty graph down the line. Tha is a bit odd, especially since I tested and ran the code with R25. This line or code such as below # Without type hinting. def foo(a): return f"{a}" # With type hinting. def foo(a: typing.Any) -> str: return f"{a}" makes use of type hinting. It tries to rectify ambiguities that come with the fact that Python is dynamically typed. For now, type hinting has no real impact on code run on CPython (i.e., the "standard" Python), unless you use special libraries to run your CPython code or use interpreters other than CPython which support static or at least asserted typing out of the box. All the line doc: c4d.documents.BaseDocument # The active document. does for now is: Make code more readable by telling humans what the module attribute doc is and that it exists in the first place. Enable auto-complete engines as provided by, for example, VSCode to give you smart suggestions. Enable linters or runtime libraries to run type assertions on your code. Adding or removing this line should have zero impact on the execution, unless you added there an equals sign and overwrote the value of doc. Cheers, Ferdinand
  • Append string the node path in retrieving the port?

    Cinema 4D SDK python r25
    3
    0 Votes
    3 Posts
    430 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?

    Cinema 4D SDK r25 python
    3
    0 Votes
    3 Posts
    1k 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.
  • Python tag wrong angle output in console

    Cinema 4D SDK python
    3
    2
    0 Votes
    3 Posts
    487 Views
    C
    Hi Ferdinand, Thanks for your in-depth answer! Cheers, Casimir Smets
  • Geometry Axis asset node and LoadAssets

    Cinema 4D SDK python s26
    7
    1
    1 Votes
    7 Posts
    2k Views
    M
    @Dunhou said in Geometry Axis asset node and LoadAssets: Hi there, In C4D 2024, the Geometry Axis can not accessible in python anymore, how can I fix that? from typing import Optional import c4d doc: c4d.documents.BaseDocument # The active document op: Optional[c4d.BaseObject] # The active object, None if unselected def main() -> None: for i, (bc, descid, _) in enumerate(op.GetDescription(c4d.DESCFLAGS_DESC_0)): name = bc[c4d.DESC_NAME] if name == "Axis X": print(i,descid) print(op[descid]) if __name__ == '__main__': main() 2024 [image: 1699255573905-832ba1ea-2683-4deb-95de-67444dbcf033-image.png] 2023 [image: 1699255607788-d37942ef-53b5-4e13-9cab-2946766c3fd6-image.png] Cheers~ DunHou Hi, this issue have been fixed in 2024.2 and your code is working as it was previously. Cheers, Maxime.
  • Normal Move command has no effect in R2023

    Moved Bugs python
    3
    0 Votes
    3 Posts
    1k Views
    bacaB
    @m_adam thanks!
  • 1 Votes
    6 Posts
    2k 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.
  • Selection Order Flag for GetActiveMaterials?

    Cinema 4D SDK r25 python
    3
    0 Votes
    3 Posts
    385 Views
    B
    @Manuel Gotcha. Thanks for the confirmation.
  • 0 Votes
    3 Posts
    534 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
  • Ability to Drag Nodes to the Console?

    General Talk r25 python
    7
    0 Votes
    7 Posts
    1k Views
    B
    @ferdinand Gotcha. Thanks for the clarification. Will close this thread now.
  • 0 Votes
    3 Posts
    584 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 render a animation preview ?

    Cinema 4D SDK sdk s26 python
    7
    0 Votes
    7 Posts
    2k Views
    M
    Hi @Dunhou you can't control the Make Preview plugin, you have to rewrite the function yourself with all the tips previously shared in this topic. Cheers, Maxime.
  • update error?

    Cinema 4D SDK r20 python
    10
    0 Votes
    10 Posts
    3k Views
    JH23J
    I want to finish with this in case someone reads it. Years ago, I asked about the outdated methods when using these techniques. I tried to adjust the depth of the IK spline controls with the actual length of the spline itself. Today, I understand my mistake, as I was trying something that didn’t make logical sense. At the time, I thought it was the best option for what I was looking for. In short, this was never a problem, and the low response time is normal because the length depends on the depth of the controls. I thought there would be a solution, but choosing this path was not useful. In conclusion, what eventually satisfied my requirements was directly referencing the angles of the controls, meaning identifying how oriented each control is to another. I took this angle and used it as a factor to multiply by the depth. This model is much more logical and doesn’t have any flaws. At the time, I couldn’t think of a direct solution, but I didn’t want to leave this post like that. Thanks anyway, Ferdinand, for trying to help me. Cheers JH
  • How to select directories in a CUSTOMGUI_FILENAME?

    Cinema 4D SDK s26 python
    3
    0 Votes
    3 Posts
    940 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)
  • 0 Votes
    13 Posts
    3k Views
    ferdinandF
    No worries, everything is fine, that is what we are here for, to clear up things. When you have questions I encourage you to open a new thread so that we can see what we can do. And this is also an open forum, so you can ask questions to the community if you want to. But unless pointed out specifically otherwise, we assume things to be support requests. Cheers, Ferdinand
  • Can i get global input event ?

    Cinema 4D SDK python s26
    3
    0 Votes
    3 Posts
    482 Views
    gheyretG
    @ferdinand Wow~ Thank you so much bro
  • Get Node By Name?

    Cinema 4D SDK r25 python
    3
    0 Votes
    3 Posts
    421 Views
    B
    @Manuel Ah gotcha. It's only available R26 onwards. That's why I can't see something related in my R25 documentation.