On 27/01/2017 at 04:56, xxxxxxxx wrote:
hope y'all are great are doing great,
So is it possible to isolate each object?
because c4d.documents.IsolateObjects(doc, T_obj) dont work when using like this
doc = c4d.documents.GetActiveDocument()
if doc == None:
# Get Models form the Object Manager
objs = doc.GetActiveObjects(1)
if not objs:
for E in objs:
doctemp = c4d.documents.IsolateObjects(doc, E)
if doctemp == None:
but it ask for all objects which is objs.
so it look this :
doctemp = c4d.documents.IsolateObjects(doc, objs)
and that what it likes but it do all of them , what i want is each object when execute.
so its like each object go in it own folder.
plz help and i hope this was understandable to y'all.
On 27/01/2017 at 06:13, xxxxxxxx wrote:
The new doc created with isolateObject is not inserted in the list of user doc.
Here an exemple of something I wrote in 5 min and 3months ago(that mean he could have some errors and its not well documented...).
def main() :
current_dir = doc.GetDocumentPath()
buffer_path = None
list_obj = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_0)
if not list_obj:
new_doc = c4d.documents.IsolateObjects(doc, list_obj)
if not current_dir:
buffer_path = os.path.join(current_dir,"file_buffer.c4d")
c4d.documents.SaveDocument(new_doc, buffer_path, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT)
path = c4d.storage.LoadDialog(flags = c4d.FILESELECT_DIRECTORY)
if not path:
filename = c4d.gui.InputDialog("Nom du dossier", "Dossier")
if not filename:
assets = list()
missingAssets = list()
path = str(os.path.join(path,filename))
c4d.documents.SaveProject(new_doc, c4d.SAVEPROJECT_SCENEFILE | c4d.SAVEPROJECT_ASSETS | c4d.SAVEPROJECT_PROGRESSALLOWED | c4d.SAVEPROJECT_DIALOGSALLOWED | c4d.SAVEPROJECT_SHOWMISSINGASSETDIALOG, path, assets, missingAssets)
gui.MessageDialog("Missing Asset\n" + str(missingAssets))
On 27/01/2017 at 14:41, xxxxxxxx wrote:
I like what your code is doing but its really like this:
if I have 4 cubes in the scene , and select them I want them to export each object separately as a export file like .dae
so i would have:
in the folder I send it too.
problem is i need each object to Isolate it self and continue the process.
On 28/01/2017 at 13:44, xxxxxxxx wrote:
thanks I got it.
I was missing this :
get_E = E.GetName()
fobj = doc.SearchObject(get_E)
sobj = doc.SetActiveObject(fobj)
get = doc.GetSelection()
new_doc = c4d.documents.IsolateObjects(doc, get)