Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. CJtheTiger
    3. Topics
    • Profile
    • Following 0
    • Followers 0
    • Topics 17
    • Posts 53
    • Best 6
    • Controversial 0
    • Groups 0

    Topics created by CJtheTiger

    • CJtheTigerC

      Reset Tool in Interaction Tag

      Cinema 4D SDK
      • 2024 python • • CJtheTiger
      4
      0
      Votes
      4
      Posts
      654
      Views

      ferdinandF

      Hey @CJtheTiger,

      just as a clarification, it is obvious that you have put quite a bit of effort in your posting. So, that was not meant in the sense of "what a terrible posting". But especially for postings which contain a lot of detail, it is important to put the question at the very beginning so that it is clear what is the question.

      Regarding the axis behavior thing, I now understand how you mean that. The Interaction Tag (and Tooling) is not owned by the SDK group, so we would not be responsible for this case either, we only own all the "pure" Python stuff. What I thought was your request before, changing the general default value, had probably almost zero changes of being implemented. This request of yours sounds logical (I am not a big expert on the interaction tag) but given how niche that case is, and that it would require customization in tools just for that case, I do not see a high chance that this will ever be implemented either.

      But if you truly desire that feature, you should still submit the wish, because a lot of user requests for the same thing are something we cannot and will not ignore.

      Cheers,
      Ferdinand

    • CJtheTigerC

      3D -> 2D and back with perspective

      General Talk
      • programming • • CJtheTiger
      4
      0
      Votes
      4
      Posts
      1.1k
      Views

      CJtheTigerC

      Good morning Ilia,

      Thanks for your detailed response even though this is out of support scope!

      Let me explain what I meant by this:

      involve more computations than I'd like it to

      Using ProjectPointOnLine() the calculations by the script are as follows:

      Transform 3D points to 2D screen space using WS(). Calculate my desired new point in screen space. Transform the new point to 3D world space by projecting the new point onto the 3D line using ProjectPointOnLine(). Transform the new point back from 3D world space to 2D screen space using WS(). Do more things using these correct 2D coordinates of the new point.

      The issue of this topic is addressed by step 3 but to further work properly with the point in 2D space I also need step 4. I in fact do not only need the 2D coordinates but the z component as well. I feel like there must be a mathematical formula to get the correct Z value without transforming all three vector components back and forth in steps 3 and 4. So the issue I have with the "hacky" solution is purely to reduce the amount of performed calculations to a bare minimum which to be completely honest is just a means to satisfy this itch of mine to optimize as much as possible. It's part of what makes programming fun to me. 🙂

      Also it would really be interesting to grasp the mathematical concept behind this. As someone who taught himself 3D programming by reading a bunch of game dev tutorials 15 years ago this is super interesting. But enough rambling.

      Regarding your question:

      Why can't you first do your computations in screen space and only then use the ProjectPointOnLine() function?

      In my example the script I'm currently working on takes the new point as a base and creates some more points around that which are not on the line so I can't use ProjectPointOnLine() for those. For that the new point must have the correct coordinates already so I can derive the other new points correctly, otherwise their position in the world will be skewed as well.

      The frustum concept is something I'll have to take some time to fully understand how I can utilize that. Thanks for the hint.

      Have a nice weekend,
      Daniel

    • CJtheTigerC

      Controlling drag&drop using MSG_DESCRIPTION_CHECKDRAGANDDROP

      Cinema 4D SDK
      • 2024 python • • CJtheTiger
      5
      0
      Votes
      5
      Posts
      914
      Views

      CJtheTigerC

      Hi @m_adam,

      thanks a lot, that did the trick.

      To close this topic off here's a snippet to allow other objects but not the current object to be dropped in there:

      def Message(self, node: GeListNode, type: int, data: object) -> bool: if type == c4d.MSG_DESCRIPTION_CHECKDRAGANDDROP: relevant_id = c4d.DescID(c4d.YOUR_PARAM) # Use the ID of the parameter of your object that you want to check. current_id: c4d.DescID = data['id'] if relevant_id.IsPartOf(current_id)[0]: dragged_element = data["element"] is_same_object = node == dragged_element data['result'] = not is_same_object return True return True

      Cheers,
      Daniel

    • CJtheTigerC

      Python Linting in VSCode?

      General Talk
      • programming • • CJtheTiger
      3
      0
      Votes
      3
      Posts
      914
      Views

      CJtheTigerC

      Hi @m_adam,

      I coincidentally followed the steps on there when I installed the VS Code extension way back. It's pretty straight forward.

      PyLint in VS Code immediately ramped up my CPU usage so I got rid of that extension. But maybe there's a trick that someone else knows about that could help me out. I'm always open for suggestions and alternatives.

      What IDE are you using if I may ask? Did you setup anything special to make life easier?

      Best regards,
      Daniel

    • CJtheTigerC

      Include same container multiple times in .res

      Cinema 4D SDK
      • 2024 python c++ • • CJtheTiger
      2
      0
      Votes
      2
      Posts
      420
      Views

      i_mazlovI

      Hi Daniel,

      You cannot include multiple containers and keep their IDs different. There's no special arguments for the INCLUDE statement that can optimize this workflow for you.

      In your case having your own implementation of CYCLE would be the solution you're looking for.

      Cheers,
      Ilia

    • CJtheTigerC

      Python: Localized Plugin Name

      Cinema 4D SDK
      • 2024 python • • CJtheTiger
      5
      0
      Votes
      5
      Posts
      805
      Views

      M

      Hi you are right, I double checked and my c4d_string.str was like that, sorry I copy-pasted your in my reply without notifying it.

      // C4D-StringResource // Identifier Text STRINGTABLE { PLuginName "AAAAAA-ROUNDED Tube"; }

      All the rest is correct in your sentences.
      Cheers,
      Maxime.

    • CJtheTigerC

      Free Python Plugin: Quad Disc

      General Talk
      • plugin-information download • • CJtheTiger
      8
      4
      Votes
      8
      Posts
      1.8k
      Views

      DunhouD

      I had PM you about that but I wonder if you see it @CJtheTiger, or you can get my e-mail address on my Github.

      Cheers~
      DunHou

    • CJtheTigerC

      use existing Catmull Clark algorithm

      Cinema 4D SDK
      • python c++ 2024 • • CJtheTiger
      14
      0
      Votes
      14
      Posts
      2.1k
      Views

      ferdinandF

      Hey @CJtheTiger,

      yes, we disabled Ask as question because it was a lot of extra work for us to maintain because 60%-80% of users set their topics never as solved.

      Cheers,
      Ferdinand

    • CJtheTigerC

      Creating object in CommandData does not update Object Manager

      Cinema 4D SDK
      • c++ • • CJtheTiger
      2
      0
      Votes
      2
      Posts
      447
      Views

      M

      Hi sadly this is a known issue, see EventAdd is not working.

      Cheers,
      Maxime.

    • CJtheTigerC

      Creating and initializing nested ObjectData

      Cinema 4D SDK
      • c++ • • CJtheTiger
      5
      0
      Votes
      5
      Posts
      840
      Views

      M

      Hi @CJtheTiger, the most modular way would be the second one with Message, since it does not require you some weird casting and its pretty generic, so if you change your design you can still rely on the same message to do the things. But there is no wrong way, the one that work the best for you is probably the better.

      With that's said there is also the MultiMessage method that let you send a message directly to multiple objects according to their hierarchical position via the MULTIMSG_ROUTE input flag.

      Finally to retrieve the implementation (the NodeData) of a GeListNode(the instance) you can call instance->GetNodeData<Child>()

      Cheers,
      Maxime.

    • CJtheTigerC

      NewObj error: no suitable conversion

      Cinema 4D SDK
      • c++ • • CJtheTiger
      3
      0
      Votes
      3
      Posts
      624
      Views

      CJtheTigerC

      Hi @i_mazlov,

      no wonder I felt like I was missing something! And now that the iferr_scope is declared I have to bubble it up all the way and that's how I'll get proper error handling. Sweet!

      To be honest I read about error handling before but was hoping I could skip it during the prototyping phase. But now that I gotta do it, once I'm out of prototyping it'll even be a lot more stable. Plus I also gotta learn about References now which is probably a good idea.

      2c37be53-a3ce-4695-afdb-ab8d3410d19b-image.png

      Thanks for the quick help! Have a nice rest of the day!

      Best wishes,

      CJ

    • CJtheTigerC

      Get pressed keys in ObjectData plugin

      Cinema 4D SDK
      • c++ 2023 • • CJtheTiger
      17
      0
      Votes
      17
      Posts
      2.7k
      Views

      J

      Hello @CJtheTiger ,

      without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly.

      Thank you for your understanding,
      Maxon SDK Group

    • CJtheTigerC

      Register to object change

      Cinema 4D SDK
      • sdk c++ • • CJtheTiger
      5
      0
      Votes
      5
      Posts
      840
      Views

      ferdinandF

      Hey @CJtheTiger,

      sorry for my radio silence here and thank you for updating the thread. In short: you drew all the right conclusions for the general case.

      A MessageData solution can be quite performant when you know exactly what you are doing and when you must monitor either every object (in the sense of geometry) in the scene graph or at least many of them. For something like monitoring materials, shaders, or tags, the solution is mandatory anyways.

      The tag solution on the other hand can become a bottle neck when the information flow becomes too expensive. Imagine such dependency propagation tag called DataTag, and you have 1000's of them in a scene. Each tag not only informs then one but multiple other nodes about changes of its host. Due to that there is also overlap, i.e., both DataTag DA and DataTag DB inform a target object T about changes of their host objects HA and HB. But for T this might be the "same" event and it then might be doing work twice. So, when stuff is getting complicated, you. are often better off with a MessageData solution, as you can consolidate things there.

      Cheers,
      Ferdinand

    • CJtheTigerC

      Get Points and Polygons from Primitives

      Cinema 4D SDK
      • 2023 python c++ • • CJtheTiger
      2
      0
      Votes
      2
      Posts
      384
      Views

      M

      Hi @CJtheTiger primitives are generators that generate and holds a PolyonObject in there cache. So most of the time for simple primitive like a cube, to access its generated PolygonObject, you should first retrieve it's cache with the GetCache method.

      If you want a more indepth introduction to this topic please read SDK Example - Geometry Readme. Then if you want to cover more complex cases I suggest you to read geometry_caches Example.
      And if you want to visualize the cache and the scene structure I would highly recommend to take a look at the C++ Example - activeobject dialog.

      Finally regarding the spline creation, you can find all the information needed to create a spline in Python Example - SplineObject, if you have more question on the spline creation please open a new topic.

      Cheers,
      Maxime.

    • CJtheTigerC

      Error when removing bound joints

      Cinema 4D SDK
      • c++ 2023 • • CJtheTiger
      4
      0
      Votes
      4
      Posts
      673
      Views

      CJtheTigerC

      Thank you very much Maxime, both for the solution and the explanation. The code works perfectly. Also thanks for fixing this bug. Out of curiosity: Was this causing issues anywhere else?

      For completion sake: I do need to add a directChild->Free() after directChild->Remove(), correct?

      Still gonna mark this as answered as the core issue has been solved with flying colors. Thanks again!

    • CJtheTigerC

      creating children in generator

      Cinema 4D SDK
      • • • CJtheTiger
      7
      0
      Votes
      7
      Posts
      1.4k
      Views

      CJtheTigerC

      Hello @ferdinand,

      sorry for keeping quiet, I'm rather busy these days.

      I am aware of the OHIDE flag. But what if the user converts the object using Current State to Object? I wouldn't want invisible objects to stay in the document, the user should be in charge of handling them all once he takes this step. Just like when converting a Character object. 🙂 So either I try to hook into the CStO command and remove the OHIDE bit from all objects or I keep using layers. Is there a reason to choose one over the other?

      Thanks again for all the help you and everyone involved provided! ❤

      Best regards,

      Daniel