• 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
    849 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
    922 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
    1k 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
  • When can I display a dialog at startup?

    c++ r20
    6
    0 Votes
    6 Posts
    2k Views
    kbarK
    Thanks Andreas. I will try Rick's trick again today. When I looked into it yesterday it didn't seem to work, but now I am wondering if perhaps it was visual studio locking the folders, and not actually C4D, since I was debugging at the time. I just tested renaming files manually (without running it through VS) and it was possible. I think Ricks dialog was done in Python, so he wouldn't have hit this VS issue. Fingers crossed it all works today.
  • Null characters in txt file (ascii - utf?)

    c++ windows r20
    8
    1
    0 Votes
    8 Posts
    4k Views
    P
    Thanks very much. (There is so much information to be read!). -Pim
  • Setting Quicktime Options

    python r19
    6
    0 Votes
    6 Posts
    3k Views
    M
    Hi @dmp, sadly as you already figurate out datarate want a BytesValue, which is not yet implemented in the maxon API (as it's been said, currently the python maxon API is still on progress and they are some flaws or missings class like this one, which will be fixed in futures release). And I'm afraid there is no workaround for it except switching to C++. With that said. For all other parameters, maxon API also introduces some new types like maxon.Int (which point to maxon.Int64 if available or maxon.Int32). According your issue with custom samplerate and audio kilobitrate, only few values are accepted. MAXON_ATTRIBUTE(Int, AUDIO_SAMPLERATE, "net.maxon.mediasession.mf.export.audio.samplerate", RESOURCE_DEFINE(ENUM_32000, 32000) RESOURCE_DEFINE(ENUM_44100, 44100) RESOURCE_DEFINE(ENUM_48000, 48000)); MAXON_ATTRIBUTE(Int, AUDIO_KILOBITRATE, "net.maxon.mediasession.mf.export.audio.kilobitrate", RESOURCE_DEFINE(ENUM_96, 96) RESOURCE_DEFINE(ENUM_112, 112) RESOURCE_DEFINE(ENUM_128, 128) RESOURCE_DEFINE(ENUM_160, 160) RESOURCE_DEFINE(ENUM_192, 192) RESOURCE_DEFINE(ENUM_224, 224) RESOURCE_DEFINE(ENUM_256, 256) RESOURCE_DEFINE(ENUM_320, 320)); If you have any question left, please let me know. Cheers, Maxime.
  • Volume Builder does not return object

    Moved python r20
    10
    0 Votes
    10 Posts
    3k Views
    M
    Hi @Swinn are you sure in your script you define in line 19/20 settings[c4d.VOLUMETOMESHSETTINGS_ISO] = -5.51 settings[c4d.VOLUMETOMESHSETTINGS_ADAPTIVE] = 0.0 With the same value, you got in your volume mesher object? The voxel range threshold can't be directly passed as an argument, but you can expand this parameter in the volume mesher and then you get the Use Absolute Value (ISO) check box, which let you choose an ISO value. Cheers, Maxime.
  • TreeViews with GeListHead and a checkbox column can lock up C4D

    c++
    3
    1 Votes
    3 Posts
    972 Views
    kbarK
    There is no question here. Just a bug report and a warning/info to other users if they get C4D locking up when using a treeview.
  • Failed to Connection on TeamRender

    c++ r19 sdk
    2
    0 Votes
    2 Posts
    822 Views
    r_giganteR
    Hi zhhm156, this post will be answered here. For the future, please avoid double posting. Best, Riccardo