• Problem with TreeViewFunctions.HeaderClick in c4d r20, 21 22

    python r20 r21 s22
    3
    0 Votes
    3 Posts
    595 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
  • Change the default name of ID_OBJECTPROPERTIES

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

    r20 python windows
    2
    0 Votes
    2 Posts
    574 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
  • Creating a Python Script box

    python
    3
    1
    0 Votes
    3 Posts
    412 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
  • Centering an icon in a BITMAPBUTTON

    python
    3
    2
    0 Votes
    3 Posts
    696 Views
    ?
    @m_magalhaes Thank you for clarifying the Bitmap Button, Manuel.
  • Adding Undos for CommandData Changes

    python
    7
    0 Votes
    7 Posts
    749 Views
    ?
    @m_magalhaes That's helpful, thank you, Manuel!
  • Camera Position/Rotation to POS/DIR/UP Vectors

    r21 c++
    5
    0 Votes
    5 Posts
    1k Views
    N
    Hello Manuel, thanks for your input! I got it working correctly with the values you mentioned. Reading through the docs again I feel kinda dumb for not getting it right myself. Thanks to both you and zipit for your great help! Best Regards, Florian
  • Getting an Object to Follow Another Regardless of Hierarchy

    sdk python
    12
    0 Votes
    12 Posts
    2k Views
    ?
    @m_magalhaes That's okay. Thank you for letting me know!
  • How to work with LoadFile from content browser

    python windows r20
    4
    0 Votes
    4 Posts
    799 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
  • Mirroring with Matching or Different Axes

    s22 python
    26
    0 Votes
    26 Posts
    17k Views
    kbarK
    @zipit I also want to say that the amount of time you contribute here to help out developers is very generous of you. You are doing an amazing job. I would hope that Maxon would actually pay you some retainer fee for your time or at least provide you with a free subscription for all the help you have given everyone here.
  • ZipFile extracting spanned files

    r20 c++ sdk classic api maxon api
    10
    0 Votes
    10 Posts
    2k Views
    kbarK
    @zipit Really great insights.Totally appreciate all your comments. I have worked with zlib for many years and integrated it into many different platforms, apps and plugins. This is just the first time I have ever looked into splitting or spanning features. Off topic: Would be great to work on compression algorithms again. I keep eyeing up all the image compression formats being used and developed these days. Fun stuff.
  • Update generator plugin with FieldList sub-objects being updated

    python
    5
    0 Votes
    5 Posts
    566 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 []
  • Add and Remove Edge Loops Poly Object

    python r19
    12
    1
    0 Votes
    12 Posts
    3k Views
    A
    Hi @r_gigante, Not to worry! I understand! Thanks for your help! Andre
  • Prevent Projects from opening if dragged.

    python sdk
    5
    0 Votes
    5 Posts
    978 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
  • Set Xray in GetVirtualObjects()

    6
    0 Votes
    6 Posts
    866 Views
    RenatoTR
    Thanks R, the insert was an error, i already corrected. OBJECT_USECACHECOLOR work as expected Cheers Renato
  • Changing parameters broken in S22

    5
    0 Votes
    5 Posts
    1k Views
    M
    @m_adam Thanks for clarifying!
  • Using "config" plugins to modify the loading queue in R19

    Moved r19 c++
    4
    0 Votes
    4 Posts
    1k Views
    r_giganteR
    Hi @hazzzel, thanks for reaching out us. The QueryStartupOrder() has been introduced in R20 and there's no way to call it on previous releases. As suggested by @kbar , you're instead supposed to make use of the SetPluginPriority() as shown in the Plugin Functions Manual / Priority section to properly specify the plugin priority and control the loading time. Cheers, R
  • Custom mouse icon, define touch point.

    4
    0 Votes
    4 Posts
    772 Views
    RenatoTR
    Anyway, i'll add my custom offset to the mouse coordinate to match the point from the center, as seem by default.
  • SnapCore and Intersect

    4
    0 Votes
    4 Posts
    705 Views
    RenatoTR
    Hi Maxime. Thanks for reply. At last I used the BVHTree for that.
  • Creating a Script to Automatically Change Asset File Paths

    2
    0 Votes
    2 Posts
    711 Views
    r_giganteR
    Hi @ktheorin1, thanks for reaching out us and welcome to the Forum. To find all the assets in a given scene you can use the BaseDocument::GetAllAssetsNew() which returns you a list of dictionaries with all the assets contained in a document. The example below retrieves all the textures in the active document and append the string "_replaced" at the end of it def main(): textures = list() # execute the GetAllAssetsNew for the current document c4d.documents.GetAllAssetsNew(doc, False, "", c4d.ASSETDATA_FLAG_TEXTURESONLY, textures) for t in textures: textureOwner = t["owner"] textureURL = maxon.Url(t["filename"]) # get the texture suffix textureSuffix = textureURL.GetSuffix() # remove the suffix from the URL textureURL.ClearSuffix() # replace the name by adding the word "_replaced" textureURL.SetName(textureURL.GetName() + "_replaced") # set again the suffix to the URL textureURL.SetSuffix(textureSuffix) #update the textureOwner parameter textureOwner[c4d.BITMAPSHADER_FILENAME] = textureURL.GetSystemPath() # notify Cinema about the changes c4d.EventAdd() It's also worthy having a look at the maxon::Url to handy manage the path of the retrieved textures. Cheers, R