• Clear global cache

    Cinema 4D SDK c++ r23
    5
    0 Votes
    5 Posts
    5k Views
    ferdinandF
    Hello @giveforfree, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • 0 Votes
    4 Posts
    933 Views
    ferdinandF
    Hello @Futurium, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • Question: Takesystem...changing texture for each take

    Moved Bugs windows r23
    3
    4
    0 Votes
    3 Posts
    1k Views
    ThomasBT
    First thank you Ferdinand, as always, you put so much effort in your answers, this is so great.. Related to my code, yes there are of course weird things going on sometimes :-), I am not professional and the API is sometimes like a jungle and so Python, so I am messing up a few things...This process is called "learning" But anyways thank you for your detailed and quick answer.... Sincerely Thomas
  • Symbol not found: ___chkstk_darwin

    Cinema 4D SDK r23 python c++
    2
    1
    0 Votes
    2 Posts
    552 Views
    M
    Cinema 4D R23 require at least mac os 10.14 and the most optimal is 10.15. In your case you need to update to 10.15. See Cinema 4D R23 Requierements. Cheers, Maxime.
  • 0 Votes
    3 Posts
    598 Views
    mikeudinM
    @cairyn Thank you!
  • Exporting data from Takes to a file

    Cinema 4D SDK sdk r23 python
    8
    0 Votes
    8 Posts
    1k Views
    F
    Hi Manual, This is exactly what I needed. Thank you very much. Best regards, Tomasz
  • Multi-line Tabs

    Cinema 4D SDK r20 r21 r23 r25 s22 s24 c++
    3
    1
    0 Votes
    3 Posts
    845 Views
    ManuelM
    Hi, Without more question we will consider this thread as solved and close it. Cheers, Manuel
  • 0 Votes
    4 Posts
    1k Views
    ferdinandF
    Hello @wuzelwazel, without any further questions or postings, we will consider this thread as solved by Friday the 4th, February 2022. Thank you for your understanding, Ferdinand
  • The oldest SDK for Cinema 4D 19-25

    Cinema 4D SDK sdk r19 r20 r21 r25 r23 s22 s24
    7
    0 Votes
    7 Posts
    2k Views
    ferdinandF
    Hello @jeremyliu1989, without any further questions or postings, we will consider this thread as solved by Friday the 4th, February 2022. Thank you for your understanding, Ferdinand
  • Remove settings from Render Settings

    Cinema 4D SDK r23 s24 r25 c++
    2
    1
    0 Votes
    2 Posts
    412 Views
    ManuelM
    Hi, you must overload the RenderEngineCheck function and return false if the passed ID are those settings. The documentation has some example. Cheers, Manuel
  • How to traverse a GeListNode tree

    Cinema 4D SDK python r25 r23 s24 windows macos
    5
    0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hello @WDP, without any further questions we will consider this topic as solved by Friday, December the 17th. Thank you for your understanding, Ferdinand
  • 0 Votes
    5 Posts
    865 Views
    ManuelM
    @thomasb said in Help needed * .res files, dialogs etc...Plugin beginner: but can I do my own init function? yes you can, specially if you want to initialize some variable. But you should not create any geometry there and return this geometry in GVO (get virtual object). About the group, there's a note about it here. Each NodeType have a "parent" group. Glad that it is working now. Cheers, Manuel
  • How to Rotate an Object

    Cinema 4D SDK r25 s24 r23 python macos windows
    7
    0 Votes
    7 Posts
    2k Views
    ferdinandF
    Hello @WDP, this question would technically also be a new topic, please follow these rules. There is no formal notion of an object axis in the sense of a moveable entity in the API. Objects have their matrices (the global and the local one), which are effectively their own coordinate system opposed to the world coordinate system (or transform or frame when you prefer these terms over coordinate system). So, when you want to reproduce what is possible in the app, and move, rotate, or scale the axes of an object, without moving the geomtery of the object itself, then you will have to transform the vertices of that object. So, when the object has the world offset (0, 0, 0) and you want to move the axes to (100, 0, 0), you must first set the global object matrix to an offset of (100, 0, 0) and then apply the inverse of a transform that translates by (100, 0, 0) to all its vertices. I would recommend reading the matrix manual I did post in my first answer here. This will however only be possible for editable point objects, e.g., a c4d.PolygonObject. You are showing a generator object, i.e., a c4d.BaseObject with some cached geometry in your screenshot. You cannot move the axes for these objects, neither in the SDK nor in the app itself. We had recently this topic which dealt with moving the axes of a polygon object. Cheers, Ferdinand
  • How do I put objects into the timeline?

    Cinema 4D SDK r23 python
    5
    0 Votes
    5 Posts
    902 Views
    ferdinandF
    Hello @Cairyn, thank you for reaching out to us. Clarification: I am not looking for the iteration of objects, for the selection, or for the folding. Just for the method that will show the object/the track in timeline xxx. I wouldn't mind if someone could confirm that there is no access at all to the Timeline elements, or present an alternative...) You can add BaseList2D to a Timeline Manger by simply adding a CTrack to them. But you are probably after the special case where an object is being placed by drag and drop into a Timeline. This is a special case since the object has then no track. When you delete the last track of an object in a Timeline, then the object will be removed. This makes the drag and drop case a special case. Internally, the objects of a Timeline Manager are tracked in a list-like structure which is populated by traversing a document and events like object creation or drag and drop. It will automatically ingest all BaseList2D that have a track (and remove such that do not have tracks anymore). Nodes without a track that have been dragged and dropped into a Timeline are added "manually" to that list without being deleted. This works as far as I understand with a GeMarker being added to them. So technically, one might be able to replicate this in C++ by also adding that marker, but its content is not public and might carry other side effects. What I found out while playing around with tracks, is that one can add "fake" tracks by either completely making up a track id, which are then called just "track", or incomplete ids, e.g., for the position of an object. This could serve as a clean slate if desired but could also have side effects. [image: 1636374366235-ac3dd38c-8e5d-4f48-a3cd-941ae2c987cc-image.png] descId = c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_REL_POSITION, c4d.DTYPE_VECTOR, 0)) track = c4d.CTrack(op, descId) op.InsertTrackSorted(track) c4d.EventAdd() Preventing the object being removed from the Timeline when deleting its last track is not possible in Python. At least I do not see a way to do it at the moment. Cheers, Ferdinand
  • 0 Votes
    12 Posts
    3k Views
    Y
    Oh! Forget guys my message above! The calling of Python code from C++ plugin in @kbar 's advice does the trick! If someone from the future who will read this thread will need the code example, I just use the code snippet from here: https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_python.html and feed to it this code: // call it from somewhere String code = "import c4d\nimport maxon\nimport os "; code+= "\n\nprint(f'This is simple message')"; code += "\nos.rename('C:/Code/sdk/plugins/myPlugin/myPlugin.xdl64', 'C:/Code/sdk/plugins/myPlugin/old_myPlugin.old')"; ExecutePythonScript(code, GetActiveDocument());
  • OpenInputStream() works incorrect.

    Cinema 4D SDK
    2
    0 Votes
    2 Posts
    540 Views
    ferdinandF
    Hello @yaya, thank you for reaching out to us. Your example does build for me in R23, at least regarding the mentioned line of code: const maxon::InputStreamRef inputStream = webFile.OpenInputStream() iferr_return; Your example is however incomplete, it is missing the include statement to include iostreams.h which is likely causing your error. But there should be more errors for you in this stretch of code, since for example the line const maxon::Url webFile = (maxon::Url("https://www.mysite.com/Somevideo.mp4"_s))iferr_return is also incorrect. Find a commented example at the end of my posting for details. On SDK help search there is no a link to a "InputStreamRef". The maxon API does provide in C++ a managed memory environment, i.e., garbage collection, akin to managed languages like C# or Python. Which means all objects are split into the actual object instance and references to that instance. The object instance is then reference counted and deallocated once there are no references to it anymore. So, when you have a ThingRef, it is actually just a reference to an instance of a ThingInterface (at least most of the time, copy-on-write object references do not have the Ref postfix, i.e., the reference for a COW ThingInterface would be called Thing). The Doxygen parser (the tool we are using for documentation) does struggle heavily with all the metaprogramming we do and cannot properly ingest Ref entities. This is a bit tricky subject we are aware of and working on to, but this will take some time. Long story short, you would have to search here for InputStreamInterface. There is also our Entity Creation Manual which does expand a bit on the topic of interfaces and their references. If you continue to have problems, please make sure to post your full code and not just a snippet, as it otherwise mostly guesswork for us to figure out where your problem lies. Cheers, Ferdinand // You must include this header in order to have access to the full interface definitions. #include "maxon\iostreams.h" maxon::Result<void> SomeFunction() { iferr_scope; // The iferr_return here was incorrect. In our example it is required because we concatenate there // two urls. UrlInterface.operator+ is a maxon::Result, i.e., requires error handling. Just // initializing a Url does not have any error handling and therefor requires no iferr_return. const maxon::Url url("https://www.mysite.com/Somevideo.mp4"_s); const maxon::UrlScheme scheme = url.GetScheme(); const maxon::Bool isHTTP = scheme == maxon::URLSCHEME_HTTP; const maxon::Bool isHTTPS = scheme == maxon::URLSCHEME_HTTPS; if (isHTTP || isHTTPS) { const maxon::InputStreamRef inputStream = url.OpenInputStream() iferr_return; const maxon::Int length = inputStream.GetStreamLength() iferr_return; maxon::BaseArray<maxon::Char> data; data.Resize(length) iferr_return; inputStream.Read(data) iferr_return; inputStream.Close() iferr_return; // trgetUrl was not defined in your/our example, so I did redefine it here as someUrl. const maxon::Url someUrl("https://www.yoursite.com/"_s); // This will be "https://www.yoursite.com/Somevideo.mp4", i.e., GetName returns the last // component of a Url, e.g., "Somevideo.mp4" in this case. Here we need the iferr_return, since // UrlInterface.operator+ can fail, i.e., return an error. const maxon::Url anotherUrl = (someUrl + url.GetName()) iferr_return; const maxon::OutputStreamRef outputStream = anotherUrl.OpenOutputStream() iferr_return; outputStream.Write(data) iferr_return; outputStream.Close() iferr_return; } return maxon::OK; }
  • How to set a Shader for Roughness ????

    Cinema 4D SDK windows python r23
    7
    0 Votes
    7 Posts
    1k Views
    B
    @Dunhou @ferdinand Gotcha. Thanks for the confirmation and illustration links.
  • 0 Votes
    4 Posts
    759 Views
    ferdinandF
    Hello @jeremyliu1989, we will set this topic to 'Solved' when there are no further questions or replies until Monday, November the 22th. Thank you for your understanding, Ferdinand
  • Constant tracking of object position with Python

    Cinema 4D SDK python r23
    5
    0 Votes
    5 Posts
    773 Views
    D
    Hello @ferdinand , this example was perfect for me, thank you very much!
  • How to Register "Hot key" plugin in python?

    Cinema 4D SDK python r23
    5
    2
    0 Votes
    5 Posts
    1k Views
    gheyretG
    Hi @ferdinand , Thank you very much for your detailed reply. I think it is very helpful to me. Cheers!