• How do I sort the plug-in menu?

    python
    8
    2
    0 Votes
    8 Posts
    1k Views
    treezwT
    @ferdinand Thank you very much for your help, I have solved the problem!
  • 0 Votes
    3 Posts
    783 Views
    ferdinandF
    Hello, Thank you for reaching out to us. @Dunhou is right, the Picture Viewer is sealed, which means that you can put images into it (with c4d.bitmaps.ShowBitmap or c4d.documents.LoadFile) but you cannot get images or information out of it. This generally applies to all UIs, we do not expose UIs, but the data structures behind them. So, there is for example no Object or Material Manager API interface, their functionalities are exposed via the scene graph. For the Picture Viewer there is no data structure exposed. Cheers, Ferdinand
  • Changing the angle of spline-aligned objects

    python 2024 windows
    5
    2
    0 Votes
    5 Posts
    925 Views
    ferdinandF
    Good to hear that you found your solution!
  • Right aligned button

    c++
    3
    0 Votes
    3 Posts
    591 Views
    B
    This works! Thank you very much, @i_mazlov.
  • Accessing Dev Tools in Webview / CUSTOMGUI_HTMLVIEWER

    python 2024 windows macos
    7
    2
    0 Votes
    7 Posts
    1k Views
    justintaylor-devJ
    @ferdinand Great thanks!
  • How to prevent handle drawing

    c++
    3
    0 Votes
    3 Posts
    625 Views
    fwilleke80F
    Ha, right, I should've thought of that ^_^ Thank you, it works! Cheers, Frank
  • Get all BaseListLink parameters using specific BaseObject

    python 2024
    4
    0 Votes
    4 Posts
    758 Views
    C
    Thank you for this write up, I started writing something similar, but this is a huge help understanding how to get and set the data for BaseLink. I'll need to add FieldList and InExcludeData as you mentioned, knowing the getting and adding the new object is a little more involved than just setting the property id directly. I'll reach out here again if I have any followups.
  • How to modify python tags as generators first?

    Moved programming
    2
    1
    0 Votes
    2 Posts
    543 Views
    ferdinandF
    Hello @treezw, Welcome to the Maxon developers forum and its community, it is great to have you with us! Getting Started 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. Forum Overview: 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. Support Procedures: 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. Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads. It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions. About your First Question Please have a look at our forum guidelines. You must accompany your postings by a reasonable description of what you want. We cannot start deciphering screenshots. I understand that language can be a barrier but your title does not offer much meaning either. I can read here between the lines but we expect you to provide a meaningful problem description in future postings. I assumed that your question is 'how to set the priority value of a Python programming tag?' You must use the parameter access syntax myNode[ID_SOME_PARAM] = value. To discover parameter values, you can use parameter drag and drop in the console. A little hurdle is here the data type of the parameter you want to write, c4d.PriorityData, which is a bit of an oddball. PS: You also posted in the wrong forum, this must go into Cinema 4D SDK since this is a question about this SDK. I have moved your topic. Cheers, Ferdinand import c4d from mxutils import CheckType doc: c4d.documents.BaseDocument # The active document. op: c4d.BaseObject | None # The active object, can be `None`. def main(): """ """ # Allocate a cloner. Object allocation can fail in the C++ backend when you run out of memory. # The constructor will return `None` in that case. One way to handle this is to ensure with # a `CheckType` call that the object is not `None`. cloner: c4d.BaseObject = CheckType(c4d.BaseObject(c4d.Omgcloner)) # Create a Python tag, insert it into the cloner and check for success in one line. tag: c4d.BaseTag = CheckType(cloner.MakeTag(c4d.Tpython)) # Get the priority data of the Python tag, change its value and write it back. Priority data # bundle up three values, the mode, the priority and the camera dependency which are all written # with the method `SetPriorityValue`. priority: c4d.PriorityData = tag[c4d.EXPRESSION_PRIORITY] priority.SetPriorityValue(c4d.PRIORITYVALUE_MODE, c4d.CYCLE_GENERATORS) priority.SetPriorityValue(c4d.PRIORITYVALUE_PRIORITY, -100) tag[c4d.EXPRESSION_PRIORITY] = priority # Insert the cloner into the document and invoke an update. doc.InsertObject(cloner) c4d.EventAdd() if __name__ == '__main__': main()
  • Access Unfreeze All in the Object's Coordinate Tab?

    2023 windows python
    3
    1
    0 Votes
    3 Posts
    625 Views
    B
    @ferdinand Gotcha. Thanks for the response. c4d.CallButton(op, c4d.ID_BASEOBJECT_FROZEN_RESET) works as expected.
  • Redshift constants

    2023 python
    7
    1
    0 Votes
    7 Posts
    2k Views
    ferdinandF
    Hey @fastrube, The bump map type is an integer value as explained above by @Manuel and as explained here in a bit more verbose form in the graph description manual. Cheers, Ferdinand
  • Workplane Manipulation Within a ToolData-Derived Plugin

    c++
    4
    0 Votes
    4 Posts
    731 Views
    ferdinandF
    Good to hear! And your question was not 'messy', but to ensure efficient support, we must enforce certain rules. Cheers, Ferdinand
  • 0 Votes
    3 Posts
    507 Views
    lakpoL
    Hi Ferdinand, I just wanted to thank you for your invaluable help! Thanks to your guidance, I was able to solve my issue with toggling the default gravity in Cinema 4D. Honestly, I didn't think it would be this complicated! For anyone who might encounter a similar problem, here's the script I used, based on your code. It allows access to the global default simulation scene in the simulation hook and toggles the gravity value between 0 and -981: import c4d doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in the document. Can be None. c4d.SHsimulation: int = 1057220 # The ID of the simulation hook. def main() -> None: """Called by Cinema 4D when the script is executed.""" # Get the simulation hook of the active document simulationHook: c4d.BaseList2D | None = doc.FindSceneHook(c4d.SHsimulation) if not simulationHook: raise RuntimeError("Cannot find the simulation hook.") # Retrieve the object branch from the simulation hook branches: list[dict] = simulationHook.GetBranchInfo() data: dict | None = next(n for n in branches if n["id"] == c4d.Obase) # We're looking for the object branch. if not data: raise RuntimeError("Malformed simulation hook with missing object branch.") # Get the simulation scene simulationScene: c4d.BaseObject | None = data["head"].GetFirst() if not simulationScene: raise RuntimeError("Malformed simulation hook with missing object branch children.") # Toggle gravity between 0 and -981 if simulationScene[c4d.PBDSCENE_DEFAULTGRAVITY] == 0: simulationScene[c4d.PBDSCENE_DEFAULTGRAVITY] = -981 else: simulationScene[c4d.PBDSCENE_DEFAULTGRAVITY] = 0 c4d.EventAdd() if __name__ == '__main__': main() This script toggles the default gravity of the simulation scene between 0 and -981 depending on its current value. Thanks again for your help! I hope this can be useful to others who might face the same issue.
  • Embed Video into GUI - Python API

    python windows
    6
    0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hey, okay, good to know. I just wanted to make clear that BaseBitmap does not support audio playback or sampling audio information. Except for the SoundEffectorCustomGui, there is in fact no sound support at all in the Python API. The C++ API offers more support with the MEDIASESSION namespace, but also this is mostly geared towards writing such information. Cheers, Ferdinand
  • Correct Tangent Values

    python
    5
    0 Votes
    5 Posts
    736 Views
    T
    Hallo Mazlov, lot of thanks for your explanation. I think I don't will get deeper in the math of generic Bezier and Cubic Hermite spline. But this is good to know how Ae and C4D interpret these tangent values. Meanwhile I finished my script that push every selected Ae-Shape direct to C4D. Works fine so far. Thanks for your help! Tudor
  • Retrieving a shader from a LayerShaderLayer

    windows c++ 2024
    12
    0 Votes
    12 Posts
    2k Views
    S
    Hi Ferdinand, That’s great, really very helpful, thank you. I’m glad my code was right in principle even if it didn’t work! I would never have guessed the layer returned a void pointer. That should now work perfectly and do exactly what I need. Thanks again for taking the time to look into this, very much appreciated. Cheers, Steve
  • GetChildren into an InExcludeData

    2024 python
    3
    0 Votes
    3 Posts
    539 Views
    H
    Thank you so much @i_mazlov . I'm still new to this and your reply is extremely helpful. Thanks again! Apologies for the double post. I wanted to completely remove the old post since I kinda spammed too many replies on it while I was figuring out what was wrong. Appreciate the help. Have a good day!
  • C4D octane materials to redshift.

    python project tool
    4
    0 Votes
    4 Posts
    3k Views
    S
    Unfortunately this script doesn't include Specular and Displacement channels conversion.
  • Visual Selector and Script

    python 2024
    2
    0 Votes
    2 Posts
    463 Views
    i_mazlovI
    Hi @Pitchi, Welcome to the Maxon developers forum and its community, it is great to have you with us! Getting Started 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. Forum Overview: 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. Support Procedures: 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. Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads. It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions. About your First Question I'm struggling to understand what exactly you're trying to achieve, namely what do you mean by saying "a way to switch to anyone blocks"? Do you want it to be selected in the attribute manager, or framed in the viewport, or something else? Please also note, that according to our Support Procedures: We cannot provide support on learning C++, Python, or one of their popular third-party libraries We provide code examples but we do not provide full solutions or design applications. This technically means that here we provide support on public APIs of Maxon products and development support for third party developers, but we cannot write solutions instead of you. For the end-user support requests, please use our Support Center. In case you're looking for someone to create a working solution for you, please use our General Talk forum category instead. Cheers, Ilia
  • 0 Votes
    3 Posts
    484 Views
    O
    @i_mazlov This is very useful as it helps avoid manually inputting hard-coded index values! Thank you, and have a great day!
  • 0 Votes
    7 Posts
    1k Views
    P
    Hey @ferdinand I still do not 100% understand why this entails you having to poke around in the boot sequence of Cinema 4D. You should just register your plugin normally (there is no alternative to that) I think it's mainly because I didn't know what the proper way of doing it was. Reading the docs I thought I needed to use c4d.C4DPL_INIT or c4d.C4DPL_STARTACTIVITY to register my plugin stuff / execute my own startup code. I know there are the c4d plugin examples, but maybe it would be nice to add the "proper" way of registering a plugin to the docs. Python plugins cannot be disabled in Cinema 4D. You can reload them, but not disable them. You also cannot unregister a plugin. Aha also some good information that I was not aware of! And to the server: I am not running a server inside of cinema. It is running on some other machine in the internet. I am only connecting to it via a httpx.AsyncClient client. For this reason and some other technical reasons the client needs to run in a separate thread, but all of that works fine and we are even using the c4d.C4DThread for this. But you answered my question of this thread already, thanks