Assembly : Add support for perspective camera.

Remove exportASMT from toolbar.
Fix Fixedjoint name and tooltip
Fix various bugs
Introduce solver drag functions.
This commit is contained in:
Paddle
2024-01-11 16:51:54 +01:00
committed by PaddleStroke
parent 46b1a1ebfc
commit cdb1af6543
9 changed files with 760 additions and 623 deletions

View File

@@ -220,7 +220,7 @@ def getContainingPart(full_name, selected_object, activeAssemblyOrPart=None):
if linked_obj.hasObject(selected_object, True):
if not activeAssemblyOrPart:
return obj
elif (
elif (linked_obj.Document == activeAssemblyOrPart.Document) and (
linked_obj.hasObject(activeAssemblyOrPart, True)
or linked_obj == activeAssemblyOrPart
):
@@ -282,9 +282,14 @@ def getJcsGlobalPlc(jcsPlc, objName, part):
# The container is used to support cases where the same object appears at several places
# which happens when you have a link to a part.
def getGlobalPlacement(targetObj, container=None):
if targetObj is None:
return App.Placement()
inContainerBranch = container is None
for part in App.activeDocument().RootObjects:
foundPlacement = getTargetPlacementRelativeTo(targetObj, part, container, inContainerBranch)
for rootObj in App.activeDocument().RootObjects:
foundPlacement = getTargetPlacementRelativeTo(
targetObj, rootObj, container, inContainerBranch
)
if foundPlacement is not None:
return foundPlacement
@@ -330,6 +335,8 @@ def getTargetPlacementRelativeTo(
elif part.TypeId == "App::Link":
linked_obj = part.getLinkedObject()
if part == linked_obj or linked_obj is None:
return None # upon loading this can happen for external links.
if linked_obj.TypeId in {"App::Part", "Assembly::AssemblyObject", "PartDesign::Body"}:
for obj in linked_obj.OutList: