• Modify Spline Gui

    python
    3
    0 Votes
    3 Posts
    1k Views
    S
    Hello @HolgerBiebrach , I'm wondering if your question has been answered. If so, please mark this thread as solved. best wishes, Sebastian
  • Move an object in hierarchy

    Moved python
    4
    0 Votes
    4 Posts
    2k Views
    a_blockA
    Hi, both answers already provide valid solutions. Nice. @Rage: Please also consider to use the tagging system (see Read Before Posting) and the Question and Answer feature (see Q&A New Functionality). Especially the tags can help, like for example in this case @mp5gosu would probably have provided you with Python code, if the respective tag was set. Besides setting tags and changing into a question, I have also moved this thread into the Cinema 4D Development category. And then I want to add a few links to Python docs: GeListNode CallCommand() Cheers, Andreas
  • Unresolved symbols with /GL /LTCG

    r20 c++ windows
    4
    0 Votes
    4 Posts
    1k Views
    S
    Hello, I'm not aware of any other components that won't work with that optimization. But again, we don't use this optimization so I haven't tested that. best wishes, Sebastian
  • c4dpy not working on OS x 10.12

    python
    5
    0 Votes
    5 Posts
    2k Views
    Y
    Note c4dpy does not work with a R20 free educational license. But c4dpy runs fine with a paid R20 student license.
  • Simple Box Gui Creation

    python windows r19
    9
    0 Votes
    9 Posts
    3k Views
    B
    @a_block Case solved! Thanks again for your patience.
  • 0 Votes
    3 Posts
    1k Views
    G
    @s_bach Wow! I didn't see that coming. Thanks for the clear-cut explanation. Now I know in which direction I have to move. Thanks again !
  • Flush a group in a non-main thread.

    r20 c++
    6
    0 Votes
    6 Posts
    2k Views
    P
    Hello. I have solved it by using SpecialEventAdd and sending a message to dialog's CoreMessage. Thank you.
  • Python Script Gui: Use EditSlider Get Float

    python
    4
    0 Votes
    4 Posts
    2k Views
    M
    Hi, @mike if the previous post solves your issue, please mark it as the correct answers. It will switch the topic as solved. To do so please read Q&A functionality. Of course, if you didn't test my previous post, or may have follow-up questions, do not mark as solved and take as much time as you need to ask us. But if there is nothing more to add please mark your topic as solved. Cheers, Maxime
  • "Compile errors for R_pose_rot / (null)" in console?

    r19
    4
    0 Votes
    4 Posts
    1k Views
    chuanzhenC
    @m_adam Yes, the data is available, it will not print when the object is hidden, hopefully it will be solved in future versions.
  • 0 Votes
    7 Posts
    2k Views
    T
    @mp5gosu Thank you, that is a good tip. I see that Onull=5140 is listed and it looks like all others are in there too! Thom
  • Add functions to python via C++ SDK [R20]

    c++ python
    4
    0 Votes
    4 Posts
    2k Views
    Y
    Hi Víctor, To retrieve parameters a function must be initialized with PYFN_FLAGS::KEYWORDS. Then use pylib.ParseTupleAndKeywords() to get the value for each parameter. The following code shows the implementation of a function which expects a string, an integer and a float: static _PyObject *extendpyapi_PassParameters(_PyObject *self, _PyObject *args, _PyObject *keywords) { PythonLibrary pylib; String str; Int32 integer = 0; Float real = 0.0f; const Char *kwlist[] = {"str", "integer", "real", nullptr}; if (!pylib.ParseTupleAndKeywords(args, keywords, "$if", kwlist, &str, &integer, &real)) return nullptr; if (str.Content()) GePrint("Parameter str: " + str); GePrint("Parameter integer: " + String::IntToString(integer)); GePrint("Parameter real: " + String::FloatToString(real)); return pylib.ReturnPyNone(); } ... moduleFunctions[1].Init("PassParameters", (PyFn)extendpyapi_PassParameters, PYFN_FLAGS::KEYWORDS, "PassParameters() - Extend Python API");
  • Get the real document in MATPREVIEW_GENERATE_IMAGE material message

    r20 c++
    4
    0 Votes
    4 Posts
    1k Views
    r_giganteR
    Hi Petros, in order to have the MATPREVIEW_PREPARE_SCENE being dispatched, you've to set MatPreviewObjectInfo::bNeedsOwnScene to true. At the same time also MatPreviewObjectInfo::bHandlePreview needs to be set to true when the host object is responsible for the rendering. Finally I think that looking at MATPREVIEW enums can be helpful as well. Best, Riccardo
  • Add Hyperlink in user area defined by GeUser Area class

    3
    0 Votes
    3 Posts
    2k Views
    G
    @s_bach Hello Sebastian, Thanks a lot for clearing my confusion. Now I know what to do. Thanks for the help! Best Regards Gogeta
  • Run python script at cinema4d opening

    Moved
    2
    0 Votes
    2 Posts
    3k Views
    a_blockA
    Hi, first I'd like to ask you to please add tags to your threads, see Read Before Posting. For example I'm not sure for which version of Cinema 4D you are asking. I have moved your thread to the "Cinema 4D Development" category. I also changed your thread into a question, see Q&A New Functionality. There are actually a few ways to achieve this. In all of the following cases, please note, in Script Manager scripts, there are a few predefined global variables (e.g. doc for the active document or op for the active object) you may be using. In the following solutions, these are not available. There even may be no active document (depending on the startup state of Cinema 4D), so you most likely will need load the document via LoadDocument(). You could write your script as a plugin without an actual plugin... I mean, you'll write your code in a "my_plugin.pyp" (except for the suffix, the name is arbitrary) file inside of Cinema 4D's plugins folder, but instead of registering an actual plugin class (like e.g. CommandData), you can just implement PluginMessage() and have your code run for example on C4DPL_PROGRAM_STARTED. A bit elaborate may be to implement a small plugin, that adds a command line option to run a Python script via command line. This could roughly look like so: import sys, ntpath import c4d # Executes a given Python script # Syntax: cinema4d.exe "-runpy script param" def CommandRunPy(arg): # Parse arguments argComponents = arg.split(' ') script = argComponents[1] param = argComponents[2] # If file exists, execute the script if ntpath.isfile(script) is False: return # NOTE: execfile runs the script in this context, # all variables available in this scope can be used inside of the script # In this case, we may use param inside the script execfile(script) def ParseCommandline(argv): for arg in argv: if arg.find("-runpy") == 0: CommandRunPy(arg) def PluginMessage(id, data): if id == c4d.C4DPL_COMMANDLINEARGS: # Extend command line parsing, here # This is the last plugin message on Cinema 4D's start process ParseCommandline(sys.argv) return True A third option may be to add to a Python init script. This has changed in version R20. See R20 Startup script location - python_init.py. Cheers, Andreas
  • Placing Motion Sources at Timeline Markers with Python - r19

    python
    14
    0 Votes
    14 Posts
    4k Views
    Leo_SaramagoL
    Ok, I'll let you off the hook. I feel like I can pick from where the code is now and move on. I'm gonna set it to SOLVED. Thanks a lot for your time!!!
  • Calling CommandData by name

    c++ python r19 r20
    5
    0 Votes
    5 Posts
    1k Views
    a_blockA
    Hi, just want to ask, if can consider this topic as solved. Bye, Andreas
  • Check if Object is Spline Type

    python
    3
    0 Votes
    3 Posts
    1k Views
    H
    Hi Maxime. Thanks a lot. That helped me.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • how to get InExcludeData cache/clone?

    3
    0 Votes
    3 Posts
    850 Views
    r_giganteR
    Hi Merkvilson, is this topic still opened? If not please mark the topic as "Solved" from the Topic Tools menu or feel free to get back for further comments. Cheers, Riccardo
  • 0 Votes
    5 Posts
    1k Views
    SwinnS
    @m_adam Cool. Thank-you for your time and patience.