• 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
    922 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.
  • Need to change rotation order of camera object

    6
    0 Votes
    6 Posts
    2k Views
    r_giganteR
    Hi Gogeta, glad that in the end it worked out properly. Please, in order to close the topic, mark the post that actually solved your initial question or simply mark the thread as solved from the Topic Tools menu Cheers, Riccardo
  • Undo wanted - TransferGoal() and nested instances

    c++ r20 windows
    3
    1
    0 Votes
    3 Posts
    1k Views
    M
    Hey Maxime, thank you very much for the detailed explanation. Makes absolute sense now! It works perfectly now. I tried a similar approach, but I was adding the Undo in g_MakeInstanceEditable() per object - that was the main culprit. Cheers, Robert
  • Free all BaseObject

    c++
    3
    0 Votes
    3 Posts
    993 Views
    a_blockA
    Hi, what @mp5gosu is showing in his code snippet is actually a quite common concept in Cinema 4D. More on this topic can also be found in the GeListNode manual in our C++ documentation. One request from my side: Please do not use all capital letters in the subject of a topic. Our forum tries to emphasize threads which are unread by a user by temporarily formatting a subject in all capital letters. So if you do as you did here ("FREE ALL BASEOBJECT") the thread always looks like it is still unread. I changed it here in this thread. And as a small reminder, please make use of our tagging system in this forum to provide a bit of additional information for a thread and to help us keep this forum nice and tidy and easily searchable. See Read Before Posting.. Lastly I turned your thread into a question (see How to Post Questions). Another feature we'd like to see people making use of in order to increase the usefulness of this forum. Cheers, Andreas
  • Allocation of PrefsDialogObject

    4
    0 Votes
    4 Posts
    2k Views
    M
    In your specific example, it could look like this: static maxon::Result<NodeData*> Alloc() { iferr_scope; return NewObj(SoloPrefs) iferr_return; } And when you construct your NodeDataclass, you have to access the actual value of maxon::Result: SoloPrefs::Alloc().GetValue(); Note, if that allocation fails that you can access the error with GetError(). There have changed lots of things, Sebastian already posted the links to the relevant documentation.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    4 Views
    No one has replied