• How to add a multi _line string UserData

    Cinema 4D SDK python s26
    3
    0 Votes
    3 Posts
    385 Views
    chuanzhenC
    @m_adam Thanks for help!
  • Custom Drag and Drop to Viewport Functionality?

    Cinema 4D SDK r21 r23 python
    3
    0 Votes
    3 Posts
    412 Views
    ferdinandF
    Hello @bentraje, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • fbx export plugin critical error

    Cinema 4D SDK r21 python
    8
    0 Votes
    8 Posts
    1k Views
    K
    Hi there, I have a similar problem. But I use R25 version. If I write exporterID[c4d.FBXEXPORT_SDS] = True or exporterID[c4d.FBXEXPORT_SDS] = False I get error AttributeError: parameter set failed If I comment or remove this line, export works fine. Maybe I should create a new topic with this issue.
  • List all attributes in C4D related to Redshift?

    Cinema 4D SDK r21 r23 python
    2
    0 Votes
    2 Posts
    302 Views
    B
    Kindly ignore. Adrian from Redshift forum answered it. You can look into the rslight.h from Plugins\C4D\R26\Redshift\res\description, all the parms are there
  • 0 Votes
    4 Posts
    811 Views
    ferdinandF
    Hello @dskeith, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • Node Editor API - Active Node Editor Graph?

    Cinema 4D SDK python s26
    7
    0 Votes
    7 Posts
    1k Views
    ferdinandF
    Hello @dskeith, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • 0 Votes
    4 Posts
    628 Views
    M
    Hi this bug was fixed with release 2023.0 of Cinema 4D. Cheers, Maxime.
  • UV Peeler - accessible?

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    485 Views
    .
    HI - Thanks for the response! I'm going to go with the sendModelingCommand method. I never would have thought to put the CallCommand value in there. This is really going to help me finish this script. I appreciate your help. thank you, .del
  • Drag and Drop between two UserArea

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    478 Views
    ferdinandF
    Hello @JohnSmith, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • ShowInFinder function in Cinema 4D S26

    Cinema 4D SDK python
    7
    0 Votes
    7 Posts
    970 Views
    ManuelM
    @a_block said in ShowInFinder function in Cinema 4D S26: I tend to use GeExecuteFile() to open directories in Explorer/Finder. This seems to work for me regardless of OS. Are there any advantages of using ShowInFinder() instead? Or any disadvantages of using GeExecuteFile(). Absolutely None, except that the name of the function makes more sense if you just want to show the directory. Thanks for pointing that out, i overlooked that line. Bool ShowInFinder(const Filename& path, Bool open) { if (open) return GeExecuteFile(path); Cheers, Manuel
  • Python SDK Examples: Tiny request

    Cinema 4D SDK python s26
    1
    0 Votes
    1 Posts
    300 Views
    No one has replied
  • 0 Votes
    3 Posts
    1k Views
    eZioPanE
    It works like a charm! Thanks a lot!
  • Tangent of Point in Spline

    Cinema 4D SDK python
    3
    1
    0 Votes
    3 Posts
    521 Views
    ferdinandF
    Hello @Djoneeeee, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • 0 Votes
    7 Posts
    775 Views
    ferdinandF
    Hello @thecomishy, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • 0 Votes
    7 Posts
    1k Views
    CairynC
    Aaaand of course I forgot a crucial point: After modifying the clone positions in marr, you need to write them back to the MoData, but the last parameter apply_strength must be False: moData.SetArray(c4d.MODATA_MATRIX, marr, False) This is at first glance unintuitive since we want the strength to be present but when looking closely, you can fathom that the function will internally multiply with the falloff strength that it calculated itself, and that probably comes from GetFalloffs() again, so it's 0 and nothing is won. We do not want SetArray to do that at all, because we have already applied the falloffs that we calculated ourselves, and SetArray should keep its buggy hands off it!
  • PYTHONPATH not appended to sys.path in Cinema 4D 24

    Cinema 4D SDK s24 python
    6
    0 Votes
    6 Posts
    1k Views
    F
    Excellent! Thanks you a lot Regards,
  • How to get Redshift material assignments

    Cinema 4D SDK python
    4
    1
    0 Votes
    4 Posts
    808 Views
    ManuelM
    hi, I got some feedback from the devs. The function ObjectFromIndex have a parameter to define the document. That mean the list can contain material tags from a different document. The "problem" is that ObjectFromIndex return the number of tags in the list, and not only the number of tags in the list that are present in the current document. Old Redshift materials have a mechanism to optimized and avoid rendering the preview thumbnail on the attribut manager when it is not necessary. That mechanism renders the material on a different document. That is why the entry on the list is "None" because the tag is not present in the document passed to the function ObjectFromIndex. Cheers, Manuel
  • 0 Votes
    3 Posts
    629 Views
    W
    Hi! One more question, why does it process the command gui.MessageDialog('Hide Object[s]') first, is it pretty much last in the order of commands?? How do I have to install the command so that the program runs according to the order in which it was entered? Thank you very much!
  • How can I make a simple input form for my Python script?

    Moved Cinema 4D SDK
    3
    0 Votes
    3 Posts
    1k Views
    ferdinandF
    Hello @delizade, thank you for reaching out to us. I am a bit confused when you say: I'm new about Python and Cinema 4D scripting. You have more than 20 postings in your account, asking Python questions which I would hardly classify as being new? Nonetheless, windows or 'input forms' are called dialogs in Cinema 4D and represented by the type c4d.gui.GeDialog. There is also another form of GUI definitions called descriptions, but they are tied to classic API nodes, e.g., a Cube object or a Noise shader. Dialogs can be modal and non-modal. In a 'Script [Manager script]' you are bound to modal dialogs, i.e., the user can only interact with the dialog until the dialog has been closed. We also have a series of GeDialog related example scripts on GitHub. I also provided a small example which probably does some things you want to do. Cheers, Ferdinand The result: [image: 1649416639788-simple_dialog.gif] The code: """Simple example for a custom dialog in Cinema 4D. The example will contain a file selection element and a button, as well as a multiline text box. Pressing the button will load the content of a selected file into the text box. Windows are represented by the class c4d.gui.GeDialog in Cinema 4D. There are two ways to define dialogs, programmatically, as shown here, or with the help of something which is called a resource file. Resource files work similarly to other GUI markups, as for example XAML for C# or QT-XML for QT. The dialog raised here is modal, i.e., the user must focus on the dialog. For async, i.e., non-modal dialogs you must write a plugin and cannot use a script (there are ways to wiggle around that restriction, but it is not recommended to do that.) For more information, see the Python and C++ documentation of Cinema 4D on dialogs and dialog ressources. """ import c4d import os class MyDialog(c4d.gui.GeDialog): """Defines a dialog. """ ID_TEXT = 1000 ID_CHECKBOX = 1001 ID_FILENAME = 1002 ID_MULTILINE = 1003 ID_BUTTON = 1004 ID_GROUP = 10000 def CreateLayout(self) -> bool: """Called by Cinema 4D to populate the dialog with gadgets. """ # Set the title of the dialog. self.SetTitle("My Dialog") # Open a container to put other elements into. self.GroupBegin(id=MyDialog.ID_GROUP, flags=c4d.BFH_SCALEFIT, cols=1) self.GroupSpace(spacex=5, spacey=5) # Add a text box and a check box. self.AddEditText(id=MyDialog.ID_TEXT, flags=c4d.BFH_SCALEFIT) self.AddCheckbox(id=MyDialog.ID_CHECKBOX, flags=c4d.BFH_SCALEFIT, initw=0, inith=0, name="Check") # A Filename, i.e., an interface to select a file is a bit more fringe and must be added # over its custom GUI. self.AddCustomGui(id=MyDialog.ID_FILENAME, pluginid=c4d.CUSTOMGUI_FILENAME, name="Path", flags=c4d.BFH_SCALEFIT, minw=0, minh=0, customdata=c4d.BaseContainer()) # Add text box spanning multiple lines (that is set to read only mode). self.AddMultiLineEditText(id=MyDialog.ID_MULTILINE, flags=c4d.BFH_SCALEFIT, inith=50, style=c4d.DR_MULTILINE_READONLY) # Add a button. self.AddButton(id=MyDialog.ID_BUTTON, flags=c4d.BFH_SCALEFIT, name="Run") # Close the lyaout group. self.GroupEnd() return super().CreateLayout() def InitValues(self) -> bool: """Called by Cinema 4D to initialize a layout. """ self.SetString(MyDialog.ID_TEXT, "Hello World!") self.SetBool(MyDialog.ID_CHECKBOX, True) self.SetFilename(MyDialog.ID_FILENAME, "") self.SetString(MyDialog.ID_MULTILINE, "") return super().InitValues() @staticmethod def ReadFile(filename: str) -> str: """Custom static function to read the content of a file into a string. """ if not os.path.exists(filename): raise OSError("Could not access file.") try: with open(filename, mode="rt") as f: return f.read() except Exception as e: raise OSError(f"Could not read access file {filename}.") def Command(self, mid: int, msg: c4d.BaseContainer) -> bool: """Called by Cinema 4D when the user interacts with one of the gadgets in the dialog. """ # The "Run" button has been pressed. if mid == MyDialog.ID_BUTTON: # Read the content of the file if it has been selected and put it into the multiline # text box, otherwise open an error dialog. filename = self.GetFilename(MyDialog.ID_FILENAME) if filename: self.SetString(MyDialog.ID_MULTILINE, MyDialog.ReadFile(filename)) else: c4d.gui.MessageDialog("Please select a file first.") return super().Command(mid, msg) def main(): """Opens the dialog. """ # Instantiate the dialog. dialog = MyDialog() # Open the dialog in modal mode, i.e., it will be the only thing the user can focus on. dialog.Open(dlgtype=c4d.DLG_TYPE_MODAL_RESIZEABLE, defaultw=400, xpos=-2, ypos=-2) if __name__=='__main__': main()
  • 0 Votes
    4 Posts
    791 Views
    a_blockA
    Well, helping out is generally my business. Although I have to admit, I have some problems understanding the actual goal. If you like, contact me via job AT andreasblock DOT de