• How to change the color of shaded wire in C++

    Cinema 4D SDK s26 c++
    3
    1
    0 Votes
    3 Posts
    652 Views
    P
    @i_mazlov Thank you for your reply
  • 0 Votes
    6 Posts
    2k Views
    i_mazlovI
    Hi @gsmetzer, please have a look at the related thread (How to get the bounding box for the whole scene) where your issue was explained in details by @ferdinand @ferdinand said in How to get the bounding box for the whole scene: a BaseObject will also not include its descendants in its bounding box computation So, one must carry out such computations oneself Cheers, Ilia
  • How to draw a primitive object in BaseDraw

    Cinema 4D SDK python 2023 2024 s26
    3
    0 Votes
    3 Posts
    635 Views
    gheyretG
    Hi @ferdinand Thank you for your reply and guidance. I'll get around to it. Cheers Gheyret
  • Why won't my python generator update? R2024

    Cinema 4D SDK python s26 windows
    5
    0 Votes
    5 Posts
    1k Views
    S
    @baca @ferdinand Thank you both. It was the fact that the user data was not collected in the main function. Silly I didn't catch that. It's working fine now.
  • 0 Votes
    3 Posts
    617 Views
    S
    @i_mazlov sorry I thought I deleted this post as I solved the issue. Anyway to anyone who stumbles upon this question here's how I solved it: for i,pt in enumerate(points_list[::-1]): off = c4d.Vector(distance * i,0,0 ) mg = pt.GetMg() mg.off = off print(rotation.x) rm = c4d.utils.HPBToMatrix(rotation) pt.SetMg(mg * rm) So basically if the objects are inserted in the hierarchy and you start from the last one with the transformations this will work just like in the OM.
  • 0 Votes
    3 Posts
    663 Views
    H
    Hi @ferdinand, ah okay I see. Some part of me already suspected it could be a bug. Thanks for taking the time to look into it. Regarding the scope of question. You are absolutely right. And while I understand that it can make answering branching questions hard, it is sometimes not that easy to split things up. But all good, no offense taken. One last thing, I know you guys are not here to develop solutions or come up with algorithms. Still, I was wondering if a possible solution could be to move the selected points to a custom vector position and afterwards simply send an "Optimize" modeling command? Cheers, Sebastian
  • 0 Votes
    5 Posts
    992 Views
    i_mazlovI
    Yes, you found the thread about point selection just right!
  • 0 Votes
    5 Posts
    900 Views
    G
    I want to mirror a polygon selection along specified modeling axis, but i'm kinda stuck since i can't apply the dedicated Mirror Tool, the basic Scale Tool also doesn't allow to set the tool settings...
  • How to Apply a modeling command?

    Cinema 4D SDK s26 windows python
    3
    0 Votes
    3 Posts
    539 Views
    G
    Thanks man, i'll take a look at it!
  • How to create a radial (pie) menu?

    Cinema 4D SDK windows s26 python
    6
    0 Votes
    6 Posts
    2k Views
    G
    Thanks for your detailed answers, i hoped there is a simpler way to do it)... Pie menus is a very common thing nowadays, why maxon developers haven't implemented it already? In modo for example you can create pie menus, popups...etc without any coding. Not every user is ready/have the time/etc to learn python to build a simple popup, but almost every user needs to customize their working software. I really hope you'll implement these features soon.
  • 0 Votes
    3 Posts
    657 Views
    B
    In the past I have refrained from CallCommands and CallButtons because they used to add to the undo queue or did. But I suppose in this instance I can just do it for thise purpose.
  • 0 Votes
    4 Posts
    771 Views
    P
    @spedler Thank you for your help
  • 0 Votes
    2 Posts
    501 Views
    ferdinandF
    Hello Herr May, Thank you for reaching out to us. I am not quite sure why you think it should do that. The angle between two vectors u and v is defined as: theta(u, v) = arccosine(~u * ~v) I.e., the arccosine of the dot product of the two normalized vectors. This is due to the so called circle functions, specifically this identity: [image: 1697012566409-26ea0c5e-9de3-4885-bc15-34b4ee3342da-image.png] Under the hood, GetAngle does exactly what I declared above (just in a bit more efficient manner, as calculating the normalized vector is much more expensive than this little trick): [image: 1697012429446-123bbf8a-568b-49a5-9ff3-2bac41f61339-image.png] As you can see, the correct solution to the arccosine of the dot product of the null vector with itself is 0.5 π, i.e., the value you got : [image: 1697012846516-ebfd4607-e872-42ef-898c-d3a2de4d8dd8-image.png] You could now argue if that is a sensible result for a method that is called 'GetAngle' and if it should throw an error on getting an input vector or being called on a vector with the length zero. But you have also to keep in mind that the C++ backend is used by people who will know the identity pi_half = arccosine(~(0, 0, 0) * ~(0, 0, 0)) and might want to make use of it. Cheers, Ferdinand
  • Command Make Editable confusion

    Cinema 4D SDK s26 windows python
    4
    0 Votes
    4 Posts
    737 Views
    G
    Got it! Thanks.
  • 0 Votes
    3 Posts
    585 Views
    P
    @ferdinand Thank you for your reply
  • 0 Votes
    13 Posts
    2k Views
    G
    It works as expected in C4D 2024, but not in the previous versions.
  • 0 Votes
    2 Posts
    719 Views
    i_mazlovI
    Hi @Gaal-Dornik , Thanks for reaching out to us. Please excuse the delay. This issue is now tracked via internal bug tracking system. Thread is tagged to_fix, so that the thread can be tracked more closely. Cheers, Ilia
  • 0 Votes
    5 Posts
    793 Views
    gheyretG
    @ferdinand Indeed, the allure of good looks can be captivating at times. In fact, my primary objective was to explore the development of a pie toolbar, which may seem unconventional but has always held a deep fascination for me. I sincerely appreciate your valuable advice and will certainly give it a try. Cheers, Gheyret
  • 0 Votes
    3 Posts
    543 Views
    G
    I see, thanks. But honestly i don't get it why the plugins folder isn't in the search path...
  • 1 Votes
    6 Posts
    1k Views
    ferdinandF
    Hello @HerrMay, Thank you for the updated information. I had a look at your problem, and I could reproduce it, but it is primarily a problem of your code as suspected. I document below how I analyzed this problem not as a passive aggressive expression of "look how easy that is!". But to give an insight on how to approach such debugging task. The core rule is here to question one's own assumptions and assure that things are indeed how we think they are. Debugging So, when one follows your steps, one indeed ends up with something like this: [image: 1694702115621-8fdef1aa-1a5e-43d8-8cdb-42b480fd4f0d-image.png] Your assumption here was that the icon handling is bugged on our side. For that to be true, the tag on Null.2 would have to be IDC_ACTIVE_ON but with the icon handling failing and Cinemas 4D rendering it as disabled. So, I checked the value with this code: # Set custom icon for node. if id == c4d.MSG_GETCUSTOMICON: host: c4d.BaseObject = tag.GetObject() isFirst: bool = host.GetUp() == None and host.GetPred() == None if isFirst: print(f"TOP: {host.GetName() = }, {tag[IDC_ACTIVE] = }") else: print(f"OTHER: {host.GetName() = }, {tag[IDC_ACTIVE] = }") icon = self.PLUGIN_ICON_INACTIVE if tag[IDC_ACTIVE] == IDC_ACTIVE_OFF else self.PLUGIN_ICON_ACTIVE data["bmp"] = icon data["w"] = icon.GetBw() data["h"] = icon.GetBh() data["filled"] = True Which will print this when you add the tags: [image: 1694702486106-baebed6a-fdc0-4d53-8214-1d6b2011cad8-image.png] So, the topmost tag is indeed inactive and the icon rendering is correct. The question is now: 'Why is that tag inactive because we initialize all tags as node[IDC_ACTIVE] = IDC_ACTIVE_ON ?' The likely culprit is just a few lines above, as we toggle there the active state of our tag. # Handle double click on tag. if id == c4d.MSG_EDIT: if tag[IDC_ACTIVE] == IDC_ACTIVE_OFF: tag[IDC_ACTIVE] = IDC_ACTIVE_ON else: tag[IDC_ACTIVE] = IDC_ACTIVE_OFF And indeed, when we comment out these lines, we end up with this when creating multiple new tags. [image: 1694702820259-ebddd8e2-ff78-47f3-a4ca-40cbd26ac047-image.png] Moreover, when we revert our change of commenting out that code and test our assumption 'only happens for multi-object selections', we can see that this does not hold true: [image: 1694703033146-e5f2a8dd-2ebd-4555-8188-d769b84895e3-image.png] We can now check our own comment: # Handle double click on tag. if id == c4d.MSG_EDIT: ... and check MSG_EDIT: [image: 1694703119443-de39ee11-81d9-4e68-a2a6-a4c4dd182b84-image.png] The documentation says, "for example". So, the event does not capture a double click, but double clicking a BaseObject to edit its name is one example of an edit event. Adding a tag to an object apparently also emits MSG_EDIT to the tag, and when you have a multi-selection, MSG_EDIT is only emitted to the first element in the selection. Conclusion That behavior of MSG_EDIT in regard to tags and multi-selections is of course quite odd, but I would not consider it to be a bug, as an edit event is not really defined for tags in the first place. And while I understand what you want to do here, I would also say that what you do in MSG_EDIT is a violation of the UX principles of Cinema 4D. Double clicking a tag should not edit a random parameter in it. We strive for Cinema 4D having a seamless UX-experience for users including plugins. So, we rather not support it when plugin authors are trying to break these UX rules. But I will nevertheless talk with my colleagues about the subject and if we want to consider this behavior of MSG_EDIT to be a bug. Cheers, Ferdinand