Hi I did a small ObjectPlugin Test,
I created a temp_doc and loaded a file into with textures.
The textures do not work in this examples because file size is too big to upload here.
I created a container(null) put the clone of a specific polygon object in the temp_doc into this null and returned the null.
Just to test if it returnes at least the polygon-object without materials.
When I render in viewport Standard, Redshift and Corona are rendering, just Physical Renderer aborts the rendering.
This is just in versions R23 and below I guess.
Here is the code:
import c4d
from c4d import plugins, bitmaps
import os
PLUGIN_ID = 1234567 # Just for testing
class Testcity(plugins.ObjectData):
def __init__(self):
self.SetOptimizeCache(True)
def Init(self, op):
return True
def GetVirtualObjects(self, op, hh):
model = os.path.join(model_path, "build_0.c4d")
new_doc = c4d.documents.BaseDocument()
c4d.documents.MergeDocument(new_doc, model, loadflags=c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
model = new_doc.GetFirstObject().GetDown().GetDown().GetClone()
null = c4d.BaseObject(c4d.Onull)
model.InsertUnder(null)
return null
if __name__ == "__main__":
path, file = os.path.split(__file__)
file = "icon.tif"
new_path = os.path.join(path, "res", file)
model_path = os.path.join(path, "res", "models", "models", "0_Standard", "build_0")
bitmap = bitmaps.BaseBitmap()
bitmap.InitWith(new_path)
plugins.RegisterObjectPlugin(id=PLUGIN_ID, str="testcity", g=Testcity, description="testcity", icon=bitmap,
info=c4d.OBJECT_GENERATOR)
PluginFile
testcity.zip