mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-14 15:27:21 +02:00
[ui] Attribute: Attribute actually displayed in the 3dViewer are flagged with a visibility icon (eye)
This commit is contained in:
parent
4a67736d9e
commit
cfd2b1e00a
7 changed files with 85 additions and 23 deletions
|
@ -1617,18 +1617,8 @@ class BaseNode(BaseObject):
|
|||
Return True if at least one attribute is a File that can be loaded in the 3D Viewer,
|
||||
False otherwise.
|
||||
"""
|
||||
# List of supported extensions, taken from Viewer3DSettings
|
||||
supportedExts = ['.obj', '.stl', '.fbx', '.gltf', '.abc', '.ply']
|
||||
for attr in self._attributes:
|
||||
if not attr.enabled or not attr.isOutput:
|
||||
continue
|
||||
if attr.desc.semantic == "3d":
|
||||
return True
|
||||
# If the attribute is a File attribute, it is an instance of str and can be iterated over
|
||||
hasSupportedExt = isinstance(attr.value, str) and any(ext in attr.value for ext in supportedExts)
|
||||
if hasSupportedExt:
|
||||
return True
|
||||
return False
|
||||
|
||||
return next((attr for attr in self._attributes if attr.enabled and attr.isOutput and attr.is3D), None) is not None
|
||||
|
||||
name = Property(str, getName, constant=True)
|
||||
defaultLabel = Property(str, getDefaultLabel, constant=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue