mirror of
https://github.com/godotengine/godot-blender-exporter.git
synced 2026-01-05 18:10:04 +03:00
fix bug in NodePath and use better parameter name
This commit is contained in:
@@ -55,7 +55,7 @@ def export_mesh_node(escn_file, export_settings, node, parent_gd_node):
|
||||
mesh_node['visible'] = not node.hide
|
||||
if skeleton_node is not None:
|
||||
mesh_node['skeleton'] = NodePath(
|
||||
skeleton_node.get_path(), mesh_node.get_path())
|
||||
mesh_node.get_path(), skeleton_node.get_path())
|
||||
if not physics.has_physics(node) or not physics.is_physics_root(node):
|
||||
mesh_node['transform'] = node.matrix_local
|
||||
else:
|
||||
|
||||
@@ -269,17 +269,17 @@ class Array(list):
|
||||
|
||||
|
||||
class NodePath:
|
||||
"""Nodes in scene refers to other nodes or nodes' attribute,
|
||||
for example MeshInstane refers Skeleton. """
|
||||
def __init__(self, referee_path, referrer_path, referrer_attr=''):
|
||||
self.ref_path = os.path.relpath(referee_path, referrer_path)
|
||||
self.attr_name = referrer_attr
|
||||
"""Node in scene points to other node or node's attribute,
|
||||
for example, a MeshInstane points to a Skeleton. """
|
||||
def __init__(self, from_here, to_there, attribute_pointed=''):
|
||||
self.relative_path = os.path.relpath(to_there, from_here)
|
||||
self.attribute_name = attribute_pointed
|
||||
|
||||
def to_string(self):
|
||||
"""Serialize a node path"""
|
||||
return 'NodePath("{}:{}")'.format(
|
||||
self.ref_path,
|
||||
self.attr_name
|
||||
self.relative_path,
|
||||
self.attribute_name
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user