On 31/01/2018 at 00:27, xxxxxxxx wrote:
Hello guys. I'm trying to drag and drop a custom extension file into the editor window. So far so good, but i can't figure out how to merge the file in the active document. It always creates a new doc.
Where can i pass the flags for the Load() method ?
I think i need to pass the c4d. _SCENEFILTER_MERGESCENE.
_
import c4d
Plugin_ID = 123456
class dsLoader(c4d.plugins.SceneLoaderData) :
def Identify(self, node, name, probe, size) :
file_name = name.lower()
if not file_name.endswith('.ds') : return False
return True
def ReadLines(self, file) :
with open(file, 'rU') as data:
ds_file = data.read().splitlines()
for line in ds_file:
print line
def Load(self, node, name, doc, filterflags, error, bt) :
self.ReadLines(name)
c4d.EventAdd()
return c4d.FILEERROR_NONE
if __name__ == "__main__":
c4d.plugins.RegisterSceneLoaderPlugin(id=Plugin_ID,
str="dsLoader",
g=dsLoader,
info=c4d.PLUGINFLAG_SCENELOADER_MERGEORIGINAL,
description="")