• 0 Votes
    8 Posts
    1k Views
    r_giganteR
    Hi @bentraje, thanks for reaching out us. With regard to your question, there's no "straightforward" method delivered, either in Cinema 4D Python API or C++ API, tailored to this specific scope but rather using the approach proposed by @Cairyn is the way to go (and personally I don't find anything clunky). With regard to the GeListNode::Remove() as reported in the documentation it's just responsible for removing a node from a list and in C++ it's also return the object's ownership to the caller freeing Cinema 4D from being responsible to dispose that resource. Best, Riccardo
  • Python module Inspect don't showing updated code

    General Talk
    2
    0 Votes
    2 Posts
    709 Views
    r_giganteR
    Hi @mikeudin, thanks for reaching out us. With regard to your request, although it's not expected it to work inside the Cinema 4D Script Manager you can get it properly working using the c4dpy executable (here's the 20.059 compatible version[URL-REMOVED]) as much as you do on the Python Shell or on SublimeText console as you can see from the log below. $ more test.py import inspect # Save this code as script py-file and start def main(): code = inspect.getsource(main_new) # place function code to str variable print code # print code text. Works on Python Shell, but not in C4D Scripts Manager def main_new(): # This is a comment # New comment string # Change this code, to check the console output pass if __name__ == '__main__': main() $ ./c4dpy.app/Contents/MacOS/c4dpy test.py def main_new(): # This is a comment # New comment string # Change this code, to check the console output pass $ Best, Riccardo [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.
  • 0 Votes
    3 Posts
    509 Views
    B
    RE: there is no way to retrieves the created object from the built-in Tool Thanks for the confirmation RE: SendModelingCommand/MCOMMAND_MIRROR. Correct me if I'm wrong but this works only on polygon objects. I'm mirroring a joint chain rather than a polygon object. Is there a way around this? Thank you.
  • Access Object Manager Fold and Unfold?

    Cinema 4D SDK r20 python
    6
    0 Votes
    6 Posts
    3k Views
    B
    Thanks for confirmation @Cairyn and @r_gigante Sorry for being picky. Just had some muscle memory from other softwares that wanted to port to C4D. Anyhow, will settle for the Ctrl+LMB as specified by @Cairyn Thanks again have a great day ahead!
  • Invalid Interpreter for Python IDE PyCharm

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    1k Views
    C
    Hi , very embarrassing Now I can start to try to debug. Thank you for pointing me to the rules. Tried to set your answer as the correct one... did not get the menu point
  • Modify the Default Untitled Python Script

    Cinema 4D SDK r20 python
    3
    0 Votes
    3 Posts
    859 Views
    B
    Thanks Adam for the confirmation. I'll just send it for Maxon Suggestion for now. Thanks!
  • DrawMultipleHUDText issue

    Cinema 4D SDK python
    9
    0 Votes
    9 Posts
    2k Views
    merkvilsonM
    OK. Now I get it. Thank you very much! I really appreciate what you've done. Have a good day! -Merk
  • Get Deformed Points from Skin Deformer

    Cinema 4D SDK r20 python
    3
    0 Votes
    3 Posts
    1k Views
    B
    @m_magalhaes Thank you for the explanation: "The points are stored in a local space (local coordinates)." Printing the three version of points space was really helpful The code works as expected!
  • Adding polygon UVs & Normals.

    Cinema 4D SDK python r20
    13
    0 Votes
    13 Posts
    3k Views
    M
    Just to add additional information, In R21 GetAllHighlevelData() and SetAllHighlevelData() are working as expected for NormalTag, so data are not any more "shifted" and correctly interpreted internally. See What's New: Fixes: Fixed an issue where VariableTag.GetAllHighlevelData() and VariableTag.SetAllHighlevelData() used Uint16 instead of int16 for Tnormal. Fixed an issue where VariableTag.GetAllHighlevelData() returned data were shifted and not complete for Tnormal. Cheers, Maxime.
  • Use the Variable Name as an Argument

    General Talk
    4
    0 Votes
    4 Posts
    941 Views
    B
    @Cairyn and @m_magalhaes Thanks for the responses. The dictionary route seems like a good workaround. I think I'm going with it. Have a great day ahead!
  • Spline Generator based on Generator

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    608 Views
    bacaB
    @m_adam Oh, yes! Thanks, it works just fine.
  • Force cache rebuild in python

    Cinema 4D SDK r19 r20 python
    5
    0 Votes
    5 Posts
    1k Views
    rsodreR
    @m_adam Thanks Maxime. Your example really shows that the cache must be built independent of how much processing it takes. Leaves me knowing that there must be something wrong on my modifiers, and indeed there was. I was checking if bt != nullptr inside ModifyObject(). I remember I copied this from some example, and it was interrupting the modifier to process. When the script is over, it would fire again with bt filled and finish deforming.
  • Force custom file format in LoadDialog()

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    570 Views
    r_giganteR
    Hi Shellan, thanks for reaching out us. Assuming that you refer to the Python general function c4d.storage.LoadDialog() at the current time you can't specify a file format since the value passed as force_suffix even is present is ignored - as written in the documentation - . Best, Riccardo
  • Melting Edges

    General Talk
    3
    0 Votes
    3 Posts
    807 Views
    R
    Thank you so much. I was thinging that I had to provide an edge index. Never thought that it would just require to select the points that define the edges. Great!!!
  • 0 Votes
    2 Posts
    613 Views
    Leo_SaramagoL
    I figured it out. The missing piece is a listener that's supposed to be added in main(), something like: def main(): obj = op.GetObject() bc = c4d.BaseContainer() obj.AddEventNotification(op, c4d.NOTIFY_EVENT_MESSAGE, 0, bc) The reason why this was not so obvious earlier today is that I read somewhere that there was no need for adding listeners in main(), that I would be adding unnecessary tasks. This is probably my fault, I may have misinterpreted or assumed things from a different context. But, to my defense, I must say that the code that works has no listeners in it. Have a look! Well, this is where it gets tricky: the listener code had been there indeed, but I had erased it after a few iterations(because I thought it was overkill). This means that the listener is still working despite the fact that I had it erased from the Python Tag code, in other words, it's garbage. I hope this helps other users as well as the Maxon team(you guys rule!) Thanks for your time, Leo
  • GeUserarea crash when Redraw() in Message()

    Cinema 4D SDK r20 python
    3
    1 Votes
    3 Posts
    901 Views
    M
    @m_adam oh,i miss this reason,thank you : )
  • 0 Votes
    4 Posts
    1k Views
    Leo_SaramagoL
    @m_magalhaes said in User Data button Python Tag r19 - avoid "index out of depth" console feedback: if desc_id.GetDepth() > 1 Thanks a lot, Manuel! It's perfect now.
  • Access the Limit Min/Max in the User Data Manager

    Cinema 4D SDK r20 python
    5
    0 Votes
    5 Posts
    1k Views
    B
    @m_adam said in Access the Limit Min/Max in the User Data Manager: In conclusion, you can't drive the enable/disable status of the limit checkbox since this is fully handled by the User Data Manager GeDialog, but you can simulate what this dialog does. Still a bit over my head but thanks for the clarification. So the code pointed above is to simulate what the dialog function.
  • problems with CAWeightMgr

    Cinema 4D SDK r19 python
    5
    0 Votes
    5 Posts
    1k Views
    R
    Hi Manuel, perfect - in the Script Manager everything works as expected. Running the code via python tag isn't important to me - I just wasn't aware of this difference ScriptMgr <> PythonTag concerning the execution of the code. Thanks a lot for your solution ! Cheers, Jens
  • 0 Votes
    2 Posts
    731 Views
    r_giganteR
    Hi kurzemnieks, thanks for reaching out us. With regard to your question, I confirm that it's actually not possible because Attribute Manager Window functionality are not exposed in the API and, additionally, being possible to open multiple Attribute windows at the same time with multiple items highlighted belonging to different object makes the parameter selection not connected to the object. [image: 1558687886248-f8a5865c-2fa2-40d4-9022-7199a8a6e3b3-image.png] Best regards, Riccardo