• Toggle bitmap button on .res file

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    936 Views
    ManuelM
    hi, Group is the key in UI. Simply add a SCALE_H; property for your slider. so for that two columns group, the slider will take all the place minus the button. GROUP { COLUMNS 2; REAL ONEFLOAT { CUSTOMGUI REALSLIDER; SCALE_H;} BITMAPBUTTON BUTTON_ID { SIZE 16; TOGGLE; BUTTON; ICONID1 5160; ICONID2 5159; } } Cheers, Manuel
  • 0 Votes
    5 Posts
    682 Views
    B
    @m_magalhaes Thanks! It works as expected. So that's what you mean by UniformToNatural. Basically, even if the segment guides are not the same as spline points, it will conform to its overall shape.
  • Changing Face Normal's Direction?

    Cinema 4D SDK r21 python
    5
    0 Votes
    5 Posts
    1k Views
    ManuelM
    hi, everything have been said, nothing to add here Cheers, Manuel
  • 0 Votes
    3 Posts
    620 Views
    ManuelM
    hi, Since R20, arguments have been added, and the problem is coming from the last one def HeaderClick(self, root, userdata, lColID, lChannel, bDblClk, mouseX, mouseY, ua): I've opened a bug report Cheers, Manuel
  • Write to C4D console in real time

    Cinema 4D SDK python
    14
    0 Votes
    14 Posts
    3k Views
    indexofrefractionI
    @ivodow how is your ConsolePrint() different to a simple print() statement? in my test i didn''t get a real time output with ConsolePrint() best, index
  • Mirror without duplicate using `MCOMMAND_MIRROR`

    Cinema 4D SDK s22 python
    12
    0 Votes
    12 Posts
    3k Views
    ManuelM
    Hi, This have been fixe and will be available in a futur update. Cheers, Manuel
  • 0 Votes
    11 Posts
    2k Views
    ManuelM
    hi can we considered this thread as solved ? (even if there's no real right answer) Cheers, Manuel
  • Creating a Python Script box

    Cinema 4D SDK python
    3
    1
    0 Votes
    3 Posts
    425 Views
    ManuelM
    hi, except what @zipit said, there's nothing outof the box that you can use in our API to do it. You have to come with your own solution. Remotion have create such a tool few years ago: https://bitbucket.org/remotion/code-editor-gui-for-c4d/downloads/ I would say that it's not really hard to do, it's just long and during the path you are walking to build such a tool, you could find some walls that you didn't expect ^^' I would start using the function GetDParameter, check the content and change the color of some words accordingly. Cheers, Manuel
  • Change the default name of ID_OBJECTPROPERTIES

    Cinema 4D SDK python
    3
    1
    0 Votes
    3 Posts
    762 Views
    mfersaouiM
    @m_magalhaes said in Change the default name of ID_OBJECTPROPERTIES: DEFAULT 1; Thank you much.
  • Merge IsolateObjects into a second document

    Cinema 4D SDK r20 python windows
    2
    0 Votes
    2 Posts
    608 Views
    ManuelM
    hi, you have to save the document to memory and use the result to merge the document. When you merge, you have to set the flags to what you want to merge, otherwise it will not merge what you want. On this example i'm merging a document with another selected document. import c4d from c4d import gui # Welcome to the world of Python # Main function def main(): obj = doc.GetActiveObject() if obj is None: return # Isolate the active object isolateDoc = c4d.documents.IsolateObjects(doc, [obj]) # Creates the Memory File Strcuture mfs = c4d.storage.MemoryFileStruct() # Sets the mfs to write mode mfs.SetMemoryWriteMode() # save the document to mfs c4d.documents.SaveDocument(isolateDoc, mfs, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT) # retrieve the data data = mfs.GetData() # Set the MFS to read mode mfs.SetMemoryReadMode(data[0], data[1] ) flags = c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS # Load Document selectedFile = c4d.storage.LoadDialog() if selectedFile is None: return newDoc = c4d.documents.LoadDocument(selectedFile, flags) #Merge the isolated document with the current one. c4d.documents.MergeDocument(newDoc, mfs, flags) c4d.documents.InsertBaseDocument(newDoc) c4d.documents.SetActiveDocument(newDoc) # Execute main() if __name__=='__main__': main() Cheers, Manuel
  • 0 Votes
    7 Posts
    1k Views
    ManuelM
    @ivodow said in Thinking Particles allocation failure in new document: So, would ExecutePasses() with the BUILDFLAGS_EXPORT flag set be typically called just before exporting to alembic (to be on the safe side)? the exporter is calling ExecutePasses several times, you don't really need it. And because the scene can be sometimes quiet complexe, you have to call it several times in a row. for example, in the alembic exporter : [image: 1597218183449-68d39647-ef56-430b-ae1a-2189e1b83617-image.png] Cheers, Manuel
  • Centering an icon in a BITMAPBUTTON

    Cinema 4D SDK python
    3
    2
    0 Votes
    3 Posts
    750 Views
    ?
    @m_magalhaes Thank you for clarifying the Bitmap Button, Manuel.
  • Python, tool attributes and hotkeys

    Cinema 4D SDK s22 python sdk
    8
    0 Votes
    8 Posts
    2k Views
    John_DoJ
    @m_magalhaes Yes please, and sorry for the delay :3
  • Adding Undos for CommandData Changes

    Cinema 4D SDK python
    7
    0 Votes
    7 Posts
    752 Views
    ?
    @m_magalhaes That's helpful, thank you, Manuel!
  • 0 Votes
    4 Posts
    839 Views
    ManuelM
    hi, you could also use LoadDocument lowPoly = c4d.documents.LoadDocument("preset://Optimized_Assets.lib4d/Asset_Library.c4d", c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS) As the documentation says: Similar to LoadFile() but this time the document is not put into the editors list of documents and it gives control over the loaded document. Cheers, Manuel
  • 0 Votes
    5 Posts
    568 Views
    bacaB
    Thamks @zipit, it works. Just noticed it has to be adjusted with GetClone(), otherwise I'm getting "link is not alive" error def get_field_layers(op): """ Returns all field layers that are referenced in a field list. """ def flatten_tree(node): """ Listifies a GeListNode tree. """ res = [] while node: res.append(node.GetClone()) for child in node.GetChildren(): res += flatten_tree(child) node = node.GetNext() return res # get the GeListHead for the FieldList root = op.GetLayersRoot() if root is None: return [] # Get the first node under the GeListHead first = root.GetFirst() if first is None: return []
  • Changing parameters broken in S22

    Cinema 4D SDK
    5
    0 Votes
    5 Posts
    1k Views
    M
    @m_adam Thanks for clarifying!
  • Prevent Projects from opening if dragged.

    Cinema 4D SDK python sdk
    5
    0 Votes
    5 Posts
    1k Views
    lasselauchL
    @mp5gosu Whooop! Thanks, Robert! You have to return a tuple so return (c4d.NOTOK, False) does the trick for me. Thank you!!! Cheers, Lasse
  • Add and Remove Edge Loops Poly Object

    Cinema 4D SDK python r19
    12
    1
    0 Votes
    12 Posts
    3k Views
    A
    Hi @r_gigante, Not to worry! I understand! Thanks for your help! Andre
  • GLB extract textures

    General Talk
    7
    0 Votes
    7 Posts
    5k Views
    J
    @Macsmiller I apologize for the late reply. Here is the plugin. glTF Importer plugin I managed to finish it and integrate it into Cinema 4D. You can follow the updates here: glTF Importer topic Maybe I am asking a question in the wrong topic - where can I find some sample code that can be used to create various import settings and write them to default presets.lib4d?