On 20/03/2013 at 01:58, xxxxxxxx wrote:
i have multiple obj files in one folder and want to load them into the scene. i have a plugin script which reads the files and print them to the console but the didn't open. can anybody have a look.
import c4d
from c4d import gui
from c4d import documents
from c4d import utils, bitmaps, storage,plugins
import collections, os,math
#get an ID from the plugincafe
PLUGIN_ID = 1000901
plugName = "NEckimporter"
def doSomething() :
pass
class ReadFolder(c4d.plugins.CommandData) :
dialog = None
def Execute(self, doc) :
path=c4d.storage.LoadDialog(c4d.FILESELECTTYPE_ANYTHING, "Please choose the folder", c4d.FILESELECT_DIRECTORY)
dirList=os.listdir(path)
for fname in dirList:
print fname
c4d.documents.LoadFile(fname) # the prints works, but not the load
return True
def RestoreLayout(self, sec_ref) :
return True