Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. victor
    3. Posts
    V
    • Profile
    • Following 0
    • Followers 0
    • Topics 12
    • Posts 24
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by victor

    • Cinema S26 and newer is not longer threadsafe for ObjectData?

      We've found that some callbacks for

      ObjectData::Message(GeListNode* node, Int32 type, void* data)
      {
      }
      

      is no longer executed on the main thread at least some messages like:

      MSG_MULTI_DOCUMENTIMPORTED
      

      Since our plugin requires third-party communications executing some functions on the main thread is necessary.

      Is there any way to force that call on the main thread for the newer versions?
      (Notice that these calls were executed on the main thread in R25 and older versions).

      posted in Cinema 4D SDK s26 windows c++
      V
      victor
    • How to check if the object/document in on Render Queue

      We have a plugin that warms the user under some circumstances , if the user is using GUI we use a Messagebox meanwhile for a network render we use the log (to avoid freezing the farm).

      The problem comes when the user opens it in Render Queue it seems that the document is open by C4D itself again and it triggers the MessageBox since

      if (IsNet() || GeGetVersionType() == VERSIONTYPE::COMMANDLINE || GeGetVersionType() == VERSIONTYPE::CINEWARE )
      

      Returns always false.

      So my question is as well as I can check if I'm under network render (TeamRender) is there any other function or flag to check if I'm on Render Queue?

      Thank you in advance.

      posted in Cinema 4D SDK sdk c++
      V
      victor
    • Knowing if C4D is actually rendering

      In our Anima plugin we receive several calls to GetVirtualObjects and that's ok but we've found a issue, if I want to check if I'm in render right now I could use

      HierarchyHelp *hh;
      if (hh->GetBuildFlags() & A_INTERNAL_RENDERER || hh->GetBuildFlags() & A_EXTERNAL_RENDERER)
         rendering = true;
      

      The problems is that I receive the same flag if I press 'C' (make editable) in my object and we'll need a different behaviour for rendering and make editable.

      Is there any other tag I could check in the document or whatever?

      Thank you in advance for any tip.

      posted in Cinema 4D SDK
      V
      victor
    • RE: Check if GetVirtualObjects is called for Motion Blur

      Yes, the situation you described is exactly what we need.

      We released v4.0 without mb support in C4D for the new 4D characters (in regular rigged and ambient characters it works ok) but we could introduce it in a 4.1 or something like that.

      posted in Cinema 4D SDK
      V
      victor
    • RE: Check if GetVirtualObjects is called for Motion Blur

      @zipit said in Check if GetVirtualObjects is called for Motion Blur:

      n that. What I meant was: Listen to the message and once you retrieved it (and determined that this is an animation rendering that contains a motion blur), you can set a flag in the instance of your plugin object that tells GVO that this instance should be constructed as motion blur safe. And since you are then in a rendering document, that will have no impact on the editor behavior of your object. The made up symbol was just an attempt on trying to convey that without writing a wall of text 😉

      I disabled it by using a motion blur tag, btw I was speaking about these characters, unfortunately since I cannot get that preframe signal c4d won't support motion blur

      posted in Cinema 4D SDK
      V
      victor
    • RE: Check if GetVirtualObjects is called for Motion Blur

      @zipit sorry I didn't find anything related to ALWAYS_YIELD_MOTIONBLUR_SAFE_GEOMETRY 😕

      posted in Cinema 4D SDK
      V
      victor
    • RE: Check if GetVirtualObjects is called for Motion Blur

      @zipit MSG_MULTI_RENDERNOTIFICATION was a nice tip but in our case, it only works for still since that MSG is triggered only once in an animation, the same MSG if it could be called once per frame in an animation could be just perfect.

      posted in Cinema 4D SDK
      V
      victor
    • RE: Check if GetVirtualObjects is called for Motion Blur

      Hi Adam I think that probably I've posted with my personal account right now but I've been on the forums for a while, I'm the developer of the Anima for c4d plugin (and I know Riccardo for a long time since I was on the development team of Thea)

      My question is tricky and related to Anima (the crowd system) plugin.

      We have a new kind of models that could change its topology with the time, also we have a fallback that allows me to retrieve the non-changing-topology mesh for motion blur. Your suggestion works nice if the mb call only less than one frame but fails for bigger ranges since it could give us an integer frame and I'll return a different topology.

      I'm still wondering if there is any other way...

      Regards, Víctor

      posted in Cinema 4D SDK
      V
      victor
    • Check if GetVirtualObjects is called for Motion Blur

      In other software packages they have 4 callbacks PRERENDER, PRERENDER_FRAME, POSTRENDER_FRAME and POSTRENDER.

      Obviously if between PRERENDER_FRAME and POSTRENDER_FRAME GetVirtualObjects is called more than once we know that the first one is the actual call and the others are just called for effects like Motion Blur.

      Is there something similar or any other way to get this information in C4D ?

      Thank you in advance

      posted in Cinema 4D SDK c++
      V
      victor
    • Signal for actual closing C4D (not C4DPL_ENDPROGRAM)

      I'm working on a plugin that needs to free some resources as well as closing a TCP connection, unfortunatly you cannot rely on C4DPL_ENDPROGRAM since if your scene is not saved and try to close c4d that signal is trigged but you still can click on Cancel so the app is not closed and you could have freed your resources.

      Any thought on this? Thank you in advance.

      posted in Cinema 4D SDK c++
      V
      victor
    • RE: Current document in Team Render

      @r_gigante It was about updating an object during the render process but I used a different aproach just by sending the object's doc to that function so I think it could be solved already.

      posted in Cinema 4D SDK
      V
      victor
    • Current document in Team Render

      I'm using BaseDocument
      *doc = GetActiveDocument();
      to get the document we are using and

      const UnitScaleData docScaleData = (const UnitScaleData)doc->GetDataInstance()->GetCustomDataType(DOCUMENT_DOCUNIT, CUSTOMDATATYPE_UNITSCALE);
      Float otherScale = 1.0f;
      docScaleData->GetUnitScale(otherScale, docunit);

      to get the units in the scene, unfortunatly GetActiveDocument() returns a doc named "Untitled 1" in Team Render rendering process so I cannot get the scene units.

      Is there any way to get the current scene or units during a Team Render rendering session?

      posted in Cinema 4D SDK c++
      V
      victor
    • RE: ParseTupleAndKeywords in R20

      @y_puech said in ParseTupleAndKeywords in R20:

      Hi Victor,

      There's a logic error in the code you posted from the first post. The condition for R20 if (str.IsEmpty()!=false) returns false if the string has content.
      It makes more sense to call IsPopulated() for the R20 code instead of IsEmpty().

      You are right, thank you!!!

      posted in Cinema 4D SDK
      V
      victor
    • RE: ParseTupleAndKeywords in R20

      I didn't change nothing from the version that works ok in R19

      moduleFunctions[0].Init("MakeThing", (PyFn)MyprojectPyAPI_MakeThing, PYFN_FLAGS::KEYWORDS, "MakeThing(str path)");
      
      posted in Cinema 4D SDK
      V
      victor
    • ParseTupleAndKeywords in R20

      We are adding new Python functions to Cinema and our solution works fine in R19 and previous versions but we are having problems parsing the parameters in R20

      static _PyObject *MyprojectPyAPI_MakeThing(_PyObject *self, _PyObject *args, _PyObject *keywords)
      {
      	PythonLibrary pylib;
      
      	String str;
      
      	const Char *kwlist[] = { "str", nullptr };
      	if (!pylib.ParseTupleAndKeywords(args, keywords, "$", kwlist, &str))
      		return nullptr;
      
        #if API_VERSION < 20000
      	  if (str.Content())
        #else
      	  if (str.IsEmpty()!=false)
        #endif
      	{            
      		Utils::addLog("Parameter is: " + str);
      	}
      	else
      	{
      		Utils::addLog("Cannot parse the parameter correctly.");
      	}
      
      	return pylib.ReturnPyNone();
      }
      

      As you can imagine the problem is that it always throws "Cannot parse the parameter correctly."

      Any idea on what is wrong for R20? something related to PythonLibrary changed?

      Thank you in advance!

      posted in Cinema 4D SDK c++ r20 python
      V
      victor
    • RE: Having issues with LoadDll and c4d_main

      In our case it was a bit more complex but we managed to bypass the issue using load delay dlls.

      Thank you all!

      posted in Cinema 4D SDK
      V
      victor
    • Having issues with LoadDll and c4d_main

      We have a plugin that has lots of third party dependencies like Qt and others.

      In the past (R19 and older versions) we had a loader plugin that loads all this third party dependencies and makes a hook by defining c4d_main(LONG action, void* p1, void* p2, void* p3) and calling c4d_main(LONG action, void* p1, void* p2, void* p3) in other dll we it did by using GetProcAddress(hModule, "c4d_main");

      It worked like a charm until r20. With the introduction of the new project scheme and the autogenerated code, it seems like any calls done to the core or cinema frameworks inside the DLL we manually load just crash due to missing initialization on some of the internal maxon components.

      We've made sereval tries like skipping that GetProcAddress call and putting the .dll as other plugin in C4D but it seems that or first plugin (the one that loads the dependencies) is not making its work (we tried to load the dependencies on PluginStart and in PluginMessage) so it is not loaded (and no error message is triggered neither)

      We believe this might be because C4D is calling more routines than c4d_main since R20 on the plugins, so our method is no longer compatible unless we replicate C4D's behavior.

      Any thought on this?

      posted in Cinema 4D SDK c++ r20
      V
      victor
    • RE: Add functions to python via C++ SDK [R20]

      How could I add a string parameter to that function? I mean to ExtendPyAPI_HelloPython,

      Regards, Víctor

      posted in Cinema 4D SDK
      V
      victor
    • Force update interface of the plugin

      I have an asychronous call that needs to update the panel interface of my plugin for this I make something like:
      ((BaseObject*)this->Get())->GetDataInstance()->SetString(OBJECT_INFO, MaxonString("New value of the text string"));

      Unfortunatly until I select again the same object I don't see this change in the interface.

      Any tip on this?

      Thank you in advance.

      posted in Cinema 4D SDK c++ sdk
      V
      victor
    • RE: MAXON_MODULE_ID undeclared identifier [R20 C++ plugin]

      It looks that project tool didn't generate the .hxx neither the .cxx file.

      posted in Cinema 4D SDK
      V
      victor