1 # SPDX-License-Identifier: Apache-2.0
2 # Copyright 2018-2021 The glTF-Blender-IO authors.
5 def get_target_property_name(data_path
: str) -> str:
6 """Retrieve target property."""
7 return data_path
.rsplit('.', 1)[-1]
10 def get_target_object_path(data_path
: str) -> str:
11 """Retrieve target object data path without property"""
12 path_split
= data_path
.rsplit('.', 1)
13 self_targeting
= len(path_split
) < 2
18 def get_rotation_modes(target_property
: str) -> str:
19 """Retrieve rotation modes based on target_property"""
20 if target_property
== "rotation_euler":
21 return True, False, ["XYZ", "XZY", "YXZ", "YZX", "ZXY", "ZYX"]
22 elif target_property
== "delta_rotation_euler":
23 return True, True, ["XYZ", "XZY", "YXZ", "YZX", "ZXY", "ZYX"]
24 elif target_property
== "rotation_quaternion":
25 return True, False, ["QUATERNION"]
26 elif target_property
== "delta_rotation_quaternion":
27 return True, True, ["QUATERNION"]
28 elif target_property
in ["rotation_axis_angle"]:
29 return True, False, ["AXIS_ANGLE"]
31 return False, False, []