Entity
Enumerations
Enumerations Entity class उन वस्तुओं के लिए एक सारभूत बेस क्लास है जिन्हें संलग्न किया जा सकता है एक Node Aspose.3D सीन ग्राफ में। ठोस उपवर्गों में शामिल हैं Mesh, Camera, Light, और Geometry. Entity पैरेंट नोड पदानुक्रम तक पहुँच प्रदान करता है और उजागर करता है excluded दृश्यता नियंत्रण के लिए प्रॉपर्टी।.
नीचे सूचीबद्ध सभी एट्रिब्यूट्स हैं प्रॉपर्टीज़; उन्हें बिना कोष्ठकों के एक्सेस करें।.
from aspose.threed import Scene
from aspose.threed.entities import Mesh
scene = Scene.from_file("model.obj")
for node in scene.root_node.child_nodes:
entity = node.entity
if entity is not None:
# excluded is a property, not a method call
if not entity.excluded:
# parent_node is a property, not a method call
parent = entity.parent_node
print(f"Active entity '{entity.name}', parent: {parent.name if parent else 'None'}")Enumerations
A3DObject → SceneObject → Entity
उपवर्ग: Geometry → Mesh, Camera, Light, और अन्य।.
Enumerations
Entity एक सारभूत बेस क्लास है और सीधे इंस्टैंशिएट नहीं किया जाता। एक ठोस उपवर्ग का उपयोग करें जैसे Mesh.
Enumerations
| Enumerations | Enumerations | Enumerations |
|---|---|---|
parent_nodes | list[Node] (केवल-पढ़ने योग्य) | सभी पैरेंट नोड्स जिनसे यह एंटिटी जुड़ी है। इंस्टैंसिंग का समर्थन करता है (एक ही एंटिटी कई नोड्स से संदर्भित)।. |
parent_node | Optional[Node] (पढ़ें/लिखें) | मुख्य पैरेंट नोड, या None यदि इकाई संलग्न नहीं है।. |
excluded | bool (पढ़ें/लिखें) | Enumerations True, यह इकाई रेंडरिंग से बाहर है। इसे प्रॉपर्टी के रूप में एक्सेस और सेट करें: entity.excluded = True. |
name | str (पढ़ें/लिखें) | इस इकाई के लिए मानव-पठनीय नाम।. |
properties | PropertyCollection (पढ़ने-केवल) | कस्टम प्रॉपर्टियों का संग्रह।. |
Enumerations
| Enumerations | वापसी प्रकार | Enumerations |
|---|---|---|
get_property(name) | Any | नाम द्वारा प्रॉपर्टी मान प्राप्त करता है।. |
find_property(name) | Optional[Property] | नाम द्वारा प्रॉपर्टी खोजता है।. |
महत्वपूर्ण: parent_node, parent_nodes, और excluded हैं गुण, न कि मेथड्स। उन्हें कोष्ठकों के साथ न बुलाएँ। सही पैटर्न हैं:
# CORRECT
is_excluded = entity.excluded
parent = entity.parent_node
parents = entity.parent_nodes
# WRONG: do not do this
is_excluded = entity.excluded() # TypeError
parent = entity.parent_node() # TypeErrorसेट करने के लिए parent_node, प्रॉपर्टी को असाइन करें:
entity.parent_node = some_node # CORRECTEnumerations
सीन लोड करने के बाद एंटिटी की स्थिति की जाँच करें:
from aspose.threed import Scene
from aspose.threed.entities import Mesh
scene = Scene.from_file("model.stl")
for node in scene.root_node.child_nodes:
entity = node.entity
if entity is None:
continue
# Properties accessed without parentheses
print(f"Entity: {entity.name or '(unnamed)'}")
print(f" Type: {type(entity).__name__}")
print(f" Excluded: {entity.excluded}")
print(f" Parent node: {entity.parent_node.name if entity.parent_node else 'None'}")
if isinstance(entity, Mesh):
print(f" Vertices: {len(entity.control_points)}")
print(f" Polygons: {entity.polygon_count}")