Fix excessive selection pruning in dae exporter for PartDesign Objects (#17529) (#17654)

* Fixes excessive export selection pruning for PartDesign objects (#17529)

* Raises selection prune message log-level from Log to Warning (#17529)
This commit is contained in:
Jarno de Wit
2024-11-05 14:44:18 +01:00
committed by GitHub
parent 93173ba797
commit 2c8b09bec4
4 changed files with 8 additions and 5 deletions

View File

@@ -770,6 +770,9 @@ def pruneIncluded(objectslist,strict=False):
elif parent.isDerivedFrom("PartDesign::Body") and obj == parent.BaseFeature:
# don't consider a PartDesign_Body with a PartDesign_Clone that references obj
pass
elif parent.isDerivedFrom("PartDesign::SubShapeBinder") or (hasattr(parent, "TypeId") and parent.TypeId == "PartDesign::ShapeBinder"):
# don't consider a PartDesign_SubShapeBinder or PartDesign_ShapeBinder referncing this object from another object
pass
elif hasattr(parent,"Host") and parent.Host == obj:
pass
elif hasattr(parent,"Hosts") and obj in parent.Hosts:
@@ -791,7 +794,7 @@ def pruneIncluded(objectslist,strict=False):
if toplevel:
newlist.append(obj)
else:
FreeCAD.Console.PrintLog("pruning "+obj.Label+"\n")
FreeCAD.Console.PrintWarning("pruning "+obj.Label+"\n")
return newlist
def getAllChildren(objectlist):

View File

@@ -205,7 +205,7 @@ def export(exportList,filename,tessellation=1,colors=None):
scenenodes = []
objectslist = Draft.get_group_contents(exportList, walls=True,
addgroups=True)
objectslist = Arch.pruneIncluded(objectslist)
objectslist = Arch.pruneIncluded(objectslist, strict=True)
for obj in objectslist:
findex = numpy.array([])
m = None
@@ -308,4 +308,4 @@ def export(exportList,filename,tessellation=1,colors=None):
colmesh.scenes.append(myscene)
colmesh.scene = myscene
colmesh.write(filename)
FreeCAD.Console.PrintMessage(translate("Arch","file %s successfully created.") % filename)
FreeCAD.Console.PrintMessage(translate("Arch","file %s successfully created.") % filename + "\n")

View File

@@ -956,7 +956,7 @@ def export(exportList,filename):
# get all children and reorder list to get buildings and floors processed first
objectslist = Draft.get_group_contents(exportList, walls=True,
addgroups=True)
objectslist = Arch.pruneIncluded(objectslist)
objectslist = Arch.pruneIncluded(objectslist, strict=True)
sites = []
buildings = []

View File

@@ -148,7 +148,7 @@ def export(exportList,filename,colors=None):
offsetvn = 1
objectslist = Draft.get_group_contents(exportList, walls=True,
addgroups=True)
objectslist = Arch.pruneIncluded(objectslist)
objectslist = Arch.pruneIncluded(objectslist, strict=True)
filenamemtl = filename[:-4] + ".mtl"
materials = []
outfile.write("mtllib " + os.path.basename(filenamemtl) + "\n")