Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
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.
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.
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.
@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 https://vimeo.com/397454524
@zipit sorry I didn't find anything related to ALWAYS_YIELD_MOTIONBLUR_SAFE_GEOMETRY
@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.
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
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
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.
@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.
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?
@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().
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().
if (str.IsEmpty()!=false)
IsPopulated()
IsEmpty()
You are right, thank you!!!
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)");
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!
In our case it was a bit more complex but we managed to bypass the issue using load delay dlls.
Thank you all!
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?
How could I add a string parameter to that function? I mean to ExtendPyAPI_HelloPython,
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?
It looks that project tool didn't generate the .hxx neither the .cxx file.
Thank you I re-generated my project but besides I've added all the .libs to the linker I'm still having some issues on linking all them are related to ModuleInfoWrapper:
error LNK2001: unresolved external symbol "public: static class maxon::ModuleInfo maxon::details::ModuleInfoWrapper<-5597898574948983000>::info"