Motion transfer setup #1

Manually merged
Sybren A. Stüvel merged 18 commits from cgtinker/powership:motion_transfer into main 2023-06-05 12:06:15 +02:00
Showing only changes of commit 65dece1627 - Show all commits

View File

@ -601,9 +601,9 @@ class ToVector(AbstractPowerShipNode):
self.outputs.new("NodeSocketVector", "Vector")
cgtinker marked this conversation as resolved Outdated

This can be simplified by using shortcutting (a or b evaluates to b when a is falsey).

        x = self._get_optional_input_value("X", float) or 0.0
        y = self._get_optional_input_value("Y", float) or 0.0
        z = self._get_optional_input_value("Z", float) or 0.0

        v = Vector((x, y, z))
This can be simplified by using shortcutting (`a or b` evaluates to `b` when `a` is falsey). ```py x = self._get_optional_input_value("X", float) or 0.0 y = self._get_optional_input_value("Y", float) or 0.0 z = self._get_optional_input_value("Z", float) or 0.0 v = Vector((x, y, z)) ```
def execute(self, depsgraph: bpy.types.Depsgraph) -> None:
x = self.inputs["X"].default_value or 0.0
y = self.inputs["Y"].default_value or 0.0
z = self.inputs["Z"].default_value or 0.0
x = self.inputs["X"].default_value
y = self.inputs["Y"].default_value
z = self.inputs["Z"].default_value
self.outputs["Vector"].default_value = Vector((x, y, z))
@ -690,7 +690,7 @@ class RotateTowards(AbstractPowerShipNode):
bl_icon = "EMPTY_ARROWS"
track: bpy.props.EnumProperty( # type: ignore
name="Track", items=_enum_track_axis_items, default="X"
name="Track", items=_enum_track_axis_items, default="Z"
)
up: bpy.props.EnumProperty( # type: ignore