The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.
  • Generator sticks in a dirty loop

    4
    0 Votes
    4 Posts
    997 Views
    matniedobaM
    Thank you @zipit for your comprehensive response, especially with the link to the coding guide. I guess it might be better to create the spline manually from the points which are connected by the edges without the usage of SendModellingCommand. It was good for prototyping functionality but as you mentioned, it is hard to debug. I appreciate you took the time (and I know it's a lot of convoluted code) to read through it. @r_gigante -> the work is currently on my side so you don't need to bother. I think I have enough information to do a second iteration and rewriting this from scratch.
  • AttributeError: 'GUI' object has no attribute 'AddCheckBox'

    python
    3
    0 Votes
    3 Posts
    667 Views
    G
    Well Uh.....Yea.....Guess I should take a break......Thanks for the point out of the lower case b........ This is solved. Thanks Plugin Student! Cheers! MattG
  • Insert String Info Into AddStaticText dialog command

    Moved
    3
    0 Votes
    3 Posts
    553 Views
    G
    Thanks Maxime, understood on the rules and regulations, sorry about that. I understand the group concept now, read up more on it and I have a better idea on how to approach the goal I'm trying to get to. I have another error I'm getting but I'll try to do another post and see if I tag it right! Thanks for your time! Cheers! MattG
  • BaseLink from cloned document

    r19 r20 r21 c++
    11
    0 Votes
    11 Posts
    2k Views
    P
    There is no relationship between BaseContainer IDs and plugin IDs. All you need is a unique ID, that you can use as a BaseContainer ID. This forum (the plugin ID page) provides such IDs.
  • Check if GetVirtualObjects is called for Motion Blur

    c++
    12
    0 Votes
    12 Posts
    2k Views
    M
    Hi @victor unfortunately, the development team told us there is no way to achieve that without hooking directly into the render which is not possible for Cinema 4D built-in rendered. Cheers, Maxime.
  • Create a download progress bar in python

    python
    5
    0 Votes
    5 Posts
    1k Views
    M
    @indexofrefraction and just in case you have this example from CUSTOMGUI_PROGRESSBAR if you want a more minimal script. Cheers, Maxime.
  • HandleShaderMessage

    3
    0 Votes
    3 Posts
    442 Views
    r_giganteR
    Hi @RenatoT thanks for reaching out us. Can you please: add a tag to specify the C4D version you're using? can you make use of the Q&A functionality? With regard to HandleShaderMessage, I confim that it is indeed used by shaders in NodeData::Message() when they have subchannels. The code snippet found the call documentation represents exactly what is used in the Fusion shader with regard to the Base, Mask and Blend channels. Instead with regard to SHADERINFO_DYNAMICSUBSHADERS, assuming I've checked the version of Cinema you're working with, it is used no more. Looking forward your further notes, give best.
  • How to Solo a Layer

    3
    0 Votes
    3 Posts
    783 Views
    r_giganteR
    Hi @dskeith thanks for reaching out us. As pointed out by @PluginStudent, the NBIT_SOLO_LAYER behavior is explained in the Layer Manuel although it make sense to add a note to the Python API as well. With regard to a complete example, I've partially reworked your code to make sure that by executing the script multiple times you can run across all the solo configurations that the scene can handle. import c4d # Main function def main(): layer_root = doc.GetLayerObjectRoot() if not layer_root: return # Get the first layer in the scene layer = layer_root.GetDown() if not layer: return soloSet = False while layer is not None: # Set `rawdata` to True flag so to get the original layer values without any additional global changes layer_data = layer.GetLayerData(doc, rawdata=True) # check the current layer solo state: if layer_data["solo"] == False: # if not "solo" then set to True layer_data["solo"] = True # update the layer layer.SetLayerData(doc, layer_data) # update the flag soloSet = True break # deactivate if layer solo was True layer_data["solo"] = False layer.SetLayerData(doc, layer_data) # go to next layer layer = layer.GetNext() # if one (or more) solo was set the set NBIT_SOLO_LAYER otherwise clear if soloSet == True: doc.ChangeNBit(c4d.NBIT_SOLO_LAYER, c4d.NBITCONTROL_SET) else: doc.ChangeNBit(c4d.NBIT_SOLO_LAYER, c4d.NBITCONTROL_CLEAR) # Add an event c4d.EventAdd() # Execute main() if __name__=='__main__': main() Cheers
  • Dynamic automated handle interface

    python
    7
    0 Votes
    7 Posts
    1k Views
    ManuelM
    hi, I will mark this thread as solved tomorrow. Cheers, Manuel
  • Design Choices for shared variables across Plugins & Classes

    4
    0 Votes
    4 Posts
    691 Views
    ManuelM
    hello, I will consider this thread as solved without new information from you Cheers, Manuel
  • How can i render/add render queue in Python ?

    Moved
    4
    0 Votes
    4 Posts
    920 Views
    ManuelM
    hi, I've moved the answer about the output path to this thread Cheers, Manuel
  • How to adjust output path in Python Batchrender class?

    Moved python r21
    3
    0 Votes
    3 Posts
    849 Views
    M
    Hi sorry I overlook your answers, There is no way to directly change the path in the RenderQueue to do so, you have to edit the document. So before adding a document, you need to load them, then define the path in the render setting and then resave the file. Here a quick example. import c4d # Load the document docPath = r"PATHtoc4dFile.c4d" doc = c4d.documents.LoadDocument(docPath, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS, None) # Retrieves the active render setting renderData = doc.GetActiveRenderData() # Set the new path for the picture renderData[c4d.RDATA_PATH] = r"MyPicturePath.exr" # Save the document c4d.documents.SaveDocument(doc, docPath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT) Cheers, Maxime.
  • Gui Dialog in Python not respecting the dimensions

    Moved python
    11
    1
    0 Votes
    11 Posts
    2k Views
    H
    I know this is an old topic, but just for the record... The same thing seems to happen on macOS as well (Cinema 4D R21.207, macOS Catalina 10.15.3). If xpos and ypos are -2 (i.e. show the dialog in the middle of the screen), and pluginID is not given as parameter, the dialog dimensions are about half of what they're supposed to be. If a pluginID is given, dialog dimensions are correct.
  • Cinema4D Get Texture Atlas/Get Image At Coordinate

    python
    4
    1
    1 Votes
    4 Posts
    1k Views
    C
    Did GetClonePart and it works Cinema4D Preview Icon [image: 1584841017304-unknown.png] [image: 1584841026677-demoicons.png] [CODE HERE] # // Imports // import os import sys # // Imports for Cinema 4D // import c4d from c4d import plugins, gui, bitmaps, documents, storage, utils # Icons Image Paths OneImageIcons = os.path.join(os.path.dirname(__file__), 'icons', "demoIcons.png") # --------------------------------------------------------------------- # Creating GUI Instance Functions UI Elements Operations # Hepler Methods. # --------------------------------------------------------------------- # Get Icon from Icons one image. def GetCustomIcon(size, locCordX, locCordY): """ Get Texture Atlas Image """ bmp = c4d.bitmaps.BaseBitmap() bmp.InitWith(OneImageIcons) w = size h = size x = locCordX y = locCordY selectIcon = bmp.GetClonePart(x, y, w, h) return selectIcon # Create a Bitmap Button Custom GUI. def CustomImageButton_GUI(ui_ins, btn_id, toolname, tooltip, image): ui_ins.GroupBegin(0, c4d.BFH_MASK, 1, 0, "") bc = c4d.BaseContainer() # Create a new container to store the button image bc.SetLong(c4d.BITMAPBUTTON_BORDER, c4d.BORDER_NONE) # Sets the border flag to look like a button look. eg.( c4d.BORDER_NONE or c4d.BORDER_THIN_OUT or c4d.BORDER_OUT ) bc.SetBool(c4d.BITMAPBUTTON_BUTTON, True) # Clickable button / Does not seem to to work in R13? bc.SetBool(c4d.BITMAPBUTTON_TOGGLE, True) # Toggle button, like a checkbox. bc.SetString(c4d.BITMAPBUTTON_TOOLTIP, "<b>"+ toolname + "</b><br>" + tooltip) ui_ins.myBitButton = ui_ins.AddCustomGui(btn_id, c4d.CUSTOMGUI_BITMAPBUTTON, "Bitmap Button", c4d.BFH_MASK, 10, 10, bc) ui_ins.myBitButton.SetImage(image) ui_ins.GroupEnd() return True # ---------------------------------------- # // UI Main Window // # ---------------------------------------- class Tool_WindowDialog(c4d.gui.GeDialog): # GUI Ids IDS_VER = 999 IDS_OverallGrp = 1000 IDS_StaticText = 1001 IDS_BTN_01 = 1002 IDS_BTN_02 = 1003 IDS_BTN_03 = 1004 IDS_BTN_04 = 1005 # // Main GeDialog Overrides // """ The __init__ is an Constuctor and help get and passes data on from the another class. """ def __init__(self): super(Tool_WindowDialog, self).__init__() # UI Layout def CreateLayout(self): # Dialog Title self.SetTitle("Tool Ui") # Adding the GUI Buttons and inside a empty group with 4 rows. self.GroupBegin(0, c4d.BFH_SCALEFIT, 4, 0, "") self.GroupBorderSpace(5, 5, 5, 5) CustomImageButton_GUI(ui_ins=self, btn_id=self.IDS_BTN_01, toolname="Go UP", tooltip="HelloWorld", image=GetCustomIcon(size=32, locCordX=0, locCordY=37)) CustomImageButton_GUI(ui_ins=self, btn_id=self.IDS_BTN_02, toolname="Go Right", tooltip="HelloWorld", image=GetCustomIcon(size=32, locCordX=0, locCordY=0)) self.GroupEnd() self.GroupEnd() # End of the overall group. return True # Called when the dialog is initialized by the GUI / GUI's with startup values basically. def InitValues(self): print("Yang Ultimate Tools Dialog is open.") return True # Adding Excuting Commands Functions for UI Elements. def Command(self, id, msg): if id == id: print(str(id)) return True # Override this function if you want to react to Cinema 4D core messages. # The original message is stored in msg def CoreMessage(self, id, msg): if id == c4d.EVMSG_CHANGE: #self.add_images() pass return True """ DestroyWindow Override this method - this function is called when the dialog is about to be closed temporarily, for example for layout switching. """ def DestroyWindow(self): print("Tools Dialog Close.") if __name__=='__main__': class_dialog = Tool_WindowDialog() class_dialog.Open(c4d.DLG_TYPE_ASYNC, defaultw=200, defaulth=10)
  • Apply a step value in SetHandle function

    python
    4
    0 Votes
    4 Posts
    582 Views
    mfersaouiM
    @zipit Hi, Thank you.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • MouseWheel different between R20 and R21

    3
    0 Votes
    3 Posts
    453 Views
    C4DSC
    @r_gigante Well ... this is embarrassing. I came up with the R21 code using notes I had collected over the years, and was rather confused seeing this didn't port over to R20. Actually the correct code should look like following: Bool MyUserArea::InputEvent(const BaseContainer& msg) { const Int32 dev = msg.GetInt32(BFM_INPUT_DEVICE); const Int32 chn = msg.GetInt32(BFM_INPUT_CHANNEL); if (dev == BFM_INPUT_MOUSE) { if (chn == BFM_INPUT_MOUSEWHEEL) { const Float wheel = msg.GetFloat(BFM_INPUT_VSCROLL) / 120.0; Int32 mx = msg.GetInt32(BFM_INPUT_X); Int32 my = msg.GetInt32(BFM_INPUT_Y); Global2Local(&mx, &my); ApplicationOutput("Mousewheel value @ at x=@, y=@", wheel, mx, my); return true; } } return false; } No need at all to perform a GetInputState to obtain the the x and y coordinates from, as the BaseContainer to get it from is already provided as "msg". And this works both for R21 and R20. Man ... sometimes you think you know what you're doing, and then it seems you just know squad. Embarrassing! Riccardo, terribly sorry for wasting your time!
  • Matrix.__mul__(self, other) documentation ambiguity

    python
    2
    0 Votes
    2 Posts
    258 Views
    r_giganteR
    Thanks a lot @zipit . I indeed agree and will update the documentation accordingly. Best and stay safe! R
  • How to open a GeDialog Modal to default width & height?

    python sdk
    5
    1
    0 Votes
    5 Posts
    688 Views
    ?
    @m_magalhaes Thank you for this workaround. I hope to see that bug fixed soon! It seems like one that would affect many scripts & plugins.
  • 0 Votes
    4 Posts
    796 Views
    ManuelM
    hi, I think you have access to the beta and BL so you can create a suggestion Cheers, Manuel