The export as obj file has a bug in it for sub-layers. Say I have these layers and export settings:
In v5, the geometry on the temp layers would export in groups named Temp_Temp1, Temp_Temp2, Temp_Temp3, and Temp_Temp4. In v6, all of the geometry from temp 1 through 4 are exported as Temp. The sub-layers are being ignored.
Hi Eric - yeah… so now we export nested groups, corresponding to the layers. I think your objects are in two groups, Temp and Temp1 for example - I vaguely remember this is by design, but I could be making that up, and I do not remember the reason- I’ll ask the developer. https://mcneel.myjetbrains.com/youtrack/issue/RH-46452
@EricM - apparently the change was quite deliberate and it allows incoming obj files with groups, or round-tripped ones, to distribute the objects onto correctly nested layers. So, the question is, how bad is this for your workflow? It may be possible to write a post-process tool to tweak the obj files, and in a future (say 7) version, make an option to combine groups.
import rhinoscriptsyntax as rs
import fileinput
import os
import scriptcontext as sc
def TweakObj():
defFolder = rs.WorkingFolder()
if sc.sticky.has_key("OBJTWEAK_FOLDER"):
defFolder = sc.sticky["OBJTWEAK_FOLDER"]
sFile = rs.OpenFileName("File to tweak", "obj file|*.obj||", defFolder, extension = "*.obj")
if not sFile:return
sFolder = os.path.dirname(sFile)
sc.sticky["OBJTWEAK_FOLDER"] = sFolder
oFile = fileinput.FileInput(sFile,inplace=1)
for line in oFile:
if line.startswith("g "):
sline = line[2:len(line)-1]
line = "g " + sline.replace(chr(32), "__")
print line + "\n"
else: print line
oFile.close()
if __name__=="__main__":TweakObj()