ObjectData plugin not rendering to picture viewer
glasses last edited by
Ok, I have a simple object data plugin that takes a list of objects and rotates them along the timeline. It works perfectly in the editor view but won't update (looks stuck) in the picture viewer.
In the editor my objects link fine but the console when rendering says my objects are returning NoneType.
What am I missing here? Is the renderer not using my document or creating some kind of clone and not finding the objects?
Cheers mates for any thought on this.
fwilleke80 last edited by fwilleke80
Sounds like your objects have not built their cache yet, so they return nothing. How do you access those objects in your object plugin?
And, if the whole point is simply rotating them around, maybe an expression tag is what you actually need?
s_bach last edited by s_bach
If something works in the viewport but not in the Picture Viewer, this is typically caused by using GetActiveDocument(). This function always returns the active document - the document currently displayed in the viewport. It will not return the document currently rendered etc.
If you want to access the document your object is part of, use GetDocument().
See BaseDocument Manual.
glasses last edited by
I'm accessing the objects from an inExclude using.
doc = c4d.documents.GetActiveDocument() inEx = op[res.MyInExcludeData] activeObj = inEx.ObjectFromIndex(doc, i)
@fwilleke80 yes this was a python generator object that I've converted to a plugin. I'm still figuring out the basics here so sorry for the noob Q's.
I tried to replace GetActiveDocument() with GetDocument() but I don't think I'm structuring my plugin properly. I can't seem to find any resources online to figure this one out.
ferdinand last edited by ferdinand
you cannot use
NodeDataenvironment. The reason being, that nodes will also be executed when a document is not the active document (while rendering for example, as a document is getting cloned for rendering).
You have to either use the document arguments provided by the methods of
BaseList2D.GetDocument()on the node attached to your plugin to get the relevant document.
I would however agree with @fwilleke80, and also think, that you might be better off with a
s_bach last edited by
as now said multiple times,
GetActiveDocument()must not be used, but
What is the point of your In/Exclude list? Are these the objects you "rotate along the timeline"?
This is typically not how a
ObjectDataobject works; it generates objects based on its child objects or deforms objects in its hierarchy. It is not supposed to move arbitrary other objects.