• 0 Votes
    4 Posts
    897 Views
    ManuelM
    hi, thanks a lot for sharing your code Don't forget to change the state of this thread to solved. (if it is) cheers, Manuel
  • Welding point for a polygon

    Cinema 4D SDK
    2
    0 Votes
    2 Posts
    494 Views
    r_giganteR
    Hi Kantronin, thanks for reaching out us and welcome to PluginCafé. To make Cinema 4D programatically executing modeling commands, you can make use of SendModelingCommand which properly satisfy your scope. Aside from the example shown in the documentation you can also have a look at this post from @maxime and this other post about Optimize command. Last but not least be aware that the modeling command settings are specified in the BaseContainer passed to the SendModelingCommand and whose parameters can be found in the MCOMMAND page. Finally please remind to use Tags and Ask as a question for any future support entries
  • 0 Votes
    4 Posts
    825 Views
    H
    Ok, got it. Thank you for your reply and clear explanation, r_gigante, much appreciated!
  • c4dpy + Atom

    General Talk python
    4
    0 Votes
    4 Posts
    767 Views
    D
    OK, thanks a lot for the quick answer! Cheers
  • FieldList.GetCount Bug

    Moved Cinema 4D SDK r21 r20 r19 python
    2
    0 Votes
    2 Posts
    577 Views
    M
    Hi @pyr, I've just reached the development team about it. So for them, this is not a bug since FieldList store only baseLink. In Python, we don't have BaseLink, but if you are not aware of what it is, please read BaseLink Manual. But since there is no BaseLink in Python, if a link points to a destructed object (like in your case, Python simply returns None) So I guess your workaround is ok. Cheers, Maxime
  • BaseBitmap.ScaleIt() IS NOT WORKING

    Cinema 4D SDK r21 python
    3
    1
    0 Votes
    3 Posts
    347 Views
    gheyretG
    @C4DS Thank you for your help! It works! Cheers~
  • Content Browser Like Navigation?

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    582 Views
    B
    @r_gigante Thanks for the reference. For anyone trying to achieve the same, here is a sample file. https://www.dropbox.com/sh/z1lzyphp8qnt9kw/AAB2P5gNo16IHafgc6xPEsy4a?dl=0 Thanks again for @zipit for the help.
  • Changing font size.

    Cinema 4D SDK python r20
    4
    0 Votes
    4 Posts
    572 Views
    P
    Great example, thank you. -Pim
  • Keyframing UserData with Value Tracks

    Cinema 4D SDK python sdk
    5
    3
    0 Votes
    5 Posts
    595 Views
    ?
    @m_adam You are a genius! Thank you, Maxime
  • SetData() with FindCustomGui / CUSTOMGUI_BITMAPBUTTON

    Cinema 4D SDK
    4
    0 Votes
    4 Posts
    752 Views
    ManuelM
    @lasselauch said in SetData() with FindCustomGui / CUSTOMGUI_BITMAPBUTTON: there's no way to flush a single Element and insert at that position, right? It has to be a group For what I know, correct. Cheers, Manuel
  • Best Practices for Reporting Errors to Users?

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    1k Views
    dskeithbuckD
    @s_bach & @zipit - Thank you both for the thoughtful replies! I think I'll opt for the status bar for most user-facing feedback, and console logging for anything bigger. Watching the "What could possibly go wrong?" talk now.
  • Selecting the text in a GeDialog MultiLineEditText

    Cinema 4D SDK python
    3
    1 Votes
    3 Posts
    417 Views
    ?
    @m_adam You know so much! Thank you for the example code. You have helped me so much, Maxime, particularly on my current project. I am very grateful!
  • 0 Votes
    11 Posts
    2k Views
    r_giganteR
    Well @pyxelrigger thanks for clarifying the final scope. Since, as already stated, folding or unfolding a scene entry doesn't generate any valuable message to be intercepted, the sole - brute force - hack you might try to implement in Python would be to implement a MessageData plugin which constantly checks for the folded/unfolded state of the entries in the scene and eventually delete the unfolded one. This approach carries strong performances penalties to the whole Cinema 4D UI because you need to constantly traverse the scene and depending on the scene size this could strongly affect Cinema performances. If there are no further question please mark the thread as solved. Best, R
  • AddEditNumberArrows Stops Working on Keyed objects

    Cinema 4D SDK r21 python
    12
    0 Votes
    12 Posts
    2k Views
    ManuelM
    hi, no trouble at all, you are here to ask questions, we are here to answer. Cheers, Manuel.
  • How to Check If you are in a Specific Tab?

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    333 Views
    B
    @m_adam Thanks. Works as expected.
  • 0 Votes
    9 Posts
    2k Views
    B
    @Dunhou Thanks for the reference but yea I'm unfortunately using the xpresso here instead of the new node editor. Which in all regards, an unfortunate scenario is xpresso is not integrated to the new node editor. @m_adam Gotcha. Thanks. Looking forward to the update.
  • Alembic camera properties

    Cinema 4D SDK python r21
    2
    0 Votes
    2 Posts
    534 Views
    ManuelM
    Hello, Some symbols are not exposed to public. There's no particular reason for that. There's no real place where all exposed symbols are. (and we agree it's could be nice) To know if a BaseObject is a camera (or something) you can use IsInstanceOf You can also send a message using the ID MSG_GETREALCAMERADATA : with an alembic generator you can use this code : camera = doc.GetActiveObject() if camera is None: return if camera.IsInstanceOf(c4d.Oalembicgenerator) == False: return # This example tries to get the internal camera from a generator. # Typically used with the Alembic Generator camera. data = {} data["res"] = None res = camera.Message(c4d.MSG_GETREALCAMERADATA, data) if res: camera = data["res"] print("Camera: " + camera.GetName()) For your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here. Q&A New Functionality. How to Post Questions especially the tagging part. I've marked this thread as a question so when you considered it as solved, please change the state Cheers, Manuel
  • Determine if a polygon is facing the camera

    General Talk python r20
    5
    0 Votes
    5 Posts
    976 Views
    R
    Once again, thank you, Manuel. I had to do a few changes and it is working now. I even made it select the faces that are within a certain angle from the camera. Here is my code: for i,poly in enumerate(faces): a,b,c,d = poly.a,poly.b,poly.c,poly.d pta = points[a]*mg ptb = points[b]*mg ptc = points[c]*mg ptd = points[d]*mg v1 = pta-ptb v2 = ptb-ptc normal = v1.Cross(v2) normal.Normalize() if c != d: center = c4d.Vector((pta.x+ptb.x+ptc.x+ptd.x)/4.0,(pta.y+ptb.y+ptc.y+ptd.y)/4.0,(pta.z+ptb.z+ptc.z+ptd.z)/4.0) else: center = c4d.Vector((pta.x+ptb.x+ptc.x)/3.0,(pta.y+ptb.y+ptc.y)/3.0,(pta.z+ptb.z+ptc.z)/3.0) direction = cam_off - center norm_dir = direction.GetNormalized() angle = NINETY - normal.Dot(norm_dir) if (angle > 0.0 and angle < max_ang): selection.Select(i)
  • Reacting on Treeview user action

    Cinema 4D SDK r21 r20 python
    2
    0 Votes
    2 Posts
    311 Views
    P
    I found a reply here. https://developers.maxon.net/forum/topic/11447/get-message-from-treeview-gui-dialog/2