• SetData() with FindCustomGui / CUSTOMGUI_BITMAPBUTTON

    Cinema 4D SDK
    4
    0 Votes
    4 Posts
    826 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
    431 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
    355 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
    641 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
    1k 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
    344 Views
    P
    I found a reply here. https://developers.maxon.net/forum/topic/11447/get-message-from-treeview-gui-dialog/2
  • No multiple selection in Treeview not working?

    Cinema 4D SDK r21 r20 python
    12
    0 Votes
    12 Posts
    2k Views
    P
    Thanks, that solved the issue. -Pim
  • Setting UA vertical size

    Cinema 4D SDK r21 python r20
    3
    1
    0 Votes
    3 Posts
    385 Views
    P
    Ok, something to think about. Never considered using GeuserArea.LayoutChanged when changing the UA size. I will give it a try.
  • Adding my own field to the Preference dialog

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    434 Views
    P
    Thank you. I will look into it and try it.
  • UA is update too often

    Cinema 4D SDK r21 r20 python
    3
    0 Votes
    3 Posts
    894 Views
    P
    Thanks for the answer. And yes, you are fully correct. Things should not be done in DrawMsg()
  • Adding a icon to a treeview field.

    Cinema 4D SDK r20 r21 python
    9
    1
    0 Votes
    9 Posts
    2k Views
    P
    Yes, that solved it. Thanks.
  • Make Button Invisible And Still Occupies Space?

    Cinema 4D SDK r21 python
    7
    0 Votes
    7 Posts
    2k Views
    B
    @PluginStudent @s_bach Thank you for the response. Both works as expected. RE: don't know why you think you need two groups. Just for reference, I was thinking of this logic if self.mode == True: self.Group1_Layout() else: self.Group2_Layout() Anyhow, no further action required
  • 0 Votes
    3 Posts
    405 Views
    B
    Thanks for the explanation. Works as expected.
  • Exporting Motion Clips & what are .c4dsrc Files?

    Cinema 4D SDK sdk python
    3
    0 Votes
    3 Posts
    720 Views
    ?
    @m_adam Hi Maxime, thank you for the quick reply and insight into this. I look forward to trying this.
  • AddUserData() for In/Exclusion List?

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    446 Views
    B
    @r_gigante Thanks for the response. Works as expected.
  • Listening for Selection Events

    Cinema 4D SDK python
    5
    0 Votes
    5 Posts
    659 Views
    ManuelM
    hello, To retrieve the active object you have to iteration trough the hierarchy. (even GetActiveObject) In Python, GetActiveObjects is calling a c++ function so with lots of object it will be faster than iterating the hierarchy with python functions. We don't know what the limit is. To mesure that you have to make a bunch of tests with different scenarios and get the mean. Cheers, Manuel