Can't get a correct rendering in picture viewer of the current scene running my TAG plugin while it works in viewport
-
Hi there,
There is something that it is hard to understand at my level of knowledge. I have two plugin that are perfectly working in C4D, both of them are TAG plugins attached to the root of a hierarchy and somehow, what I see in the viewport can't be rendered in the Picture Viewer correctly. Some of the object retains other orientation or do not take into account the animation while they are by pressing play in the 3D environment.
Here few pictures to illustrate the problem,
- Viewport capture of the object with the object in yellow that does not render correctly.
- The same frame in Render View mode and Interactive Render mode which are also correctly rendered
- The render of the same frame sent to the Picture Viewer, were the object is taking a bad orientation on XYZ axis.
I'm guessing what could cause this kind of issue? Could that be a priority problem or a missing Matrix calculation that occurs in
def Execute()
of the plugin when rendered normally? Or could that be related to something else I completely missing or skipped?
On the second plugin the Camera which is linked to the hierarchy seems locked to the current frame I'm in the timeline when I'm starting the render. Like if the animation applied to its parent object is not took into account and so the camera remains still.All your light and ideas are more than welcome, I'm completely stuck on this.
Cheers,Christophe
- Viewport capture of the object with the object in yellow that does not render correctly.
-
Hello there,
Here few more visuals to explain what's going on. I honestly do not know how what I'm getting in the viewport does not render as it is... there is something I really do not understand.
-
@mocoloco My immediate reaction to seeing something like that is that your tag is storing data which is not being copied when the scene renders. If you render to the picture viewer, the document is first cloned before being rendered. If you have class-level data in your tag it will need to be copied when the document is copied. You do that by implementing the CopyTo() function of the TagData object.
When rendering to the editor the document is not copied so it works fine without CopyTo(), which may be why you are seeing a difference between editor and PV.
(Disclaimer: I use C++ and not Python, but I expect the same principle applies in both cases.)
-
Hello @spedler, thanks for the lead, I'm going to check this and see if it change something or not.
-
Hi,
@spedler, I had a look on my plugin and I do not find any CopyTo() function related to the TagData object, it's a RegisteredTagPlugin, and I use it to manipulate sibling objects of the root level which have the TAG plugin. From what I understood, all is saved in the BaseDocument() and reloaded when the scene is loaded - which is the case.
So, I do not understand where the CopyTo() should take place and with which object? I do understand the principle - if that the one should applied here, but really do not know how to set that up here in a TAG Plugin.Thanks
-
Hi @mocoloco,
Sorry for the delayed answer, the thread somehow slipped from my list.
There's nothing specific to point out without knowing the details of what's happening in these tags. As @spedler correctly mentioned the document is cloned before rendering and this is likely causing your issue.
One assumption could be that one of your tag plugins (or maybe both) adjust data on GetActiveDocument() while rendering is already using the cloned document. As I already said it's difficult to tell anything specific with not knowing what's going on inside your tag plugins.
Cheers,
Ilia -
Hi, thanks for your reply.
I can't disclose the whole plugin as it is our know how, but anyway I can clarify the goal of it and how it is done.
So both plugin have the same architecture and are TagData. Both TAG are only use to manipulate Tx, Ty, Tz and Rx, Ry, Rz of some of the objects hierarchy underneath the root node which hold the TagData plugin.
Those new values update the position or rotation of an objects through Message() when a slider is moved, and Execute() methods to update the whole hierarchy relaying on those sliders assigned to Tx, Ty, Tz, Rx, Ry, Rz.
The question here is: if I have to consolidate something somewhere to get the rendering as it is in the viewport, what do I have to implement and were? Does that need to be in the Message() method or in Execute()?
Could you please give me some insight on this, that would be really helpful.
Thanks!
Christophe -
I do not understand your setup entirely but still ->
Just a hunch of an old bug/limitation- close the picture viewer
- adjust the scene
- re-render in picture viewer
before R20 this was a thing ...
that no xpresso and similar things did not update with picture viewer open/active ...as said this is just a hunch ...
-
Hi Christophe,
Please note our Support Procedures, namely:
We cannot provide support for third party libraries
"It doesn't work" is not a support request and we cannot debug your code for you, but instead provide answers to specific problems.
From my personal point of view, you need to reduce your setup as far as possible while still being able to reproduce the bug:
- Determine which one of your 2 tag plugins causes the issue
- Cut off unrelated functionality of your plugin that has nothing to do with the issue
- Figure out the specific function or line that causes the issue
- Search the forum if this issue was already discussed
- If not, create an example code snippet that highlights your issue
- Post your specific question and the example code snippet in a separate thread with a meaningful title
Cheers,
Ilia