Motion transfer setup #1
13
nodes.py
13
nodes.py
@ -4,7 +4,7 @@ import functools
|
||||
from collections import deque
|
||||
from copy import copy
|
||||
from math import degrees, radians
|
||||
from typing import TypeVar, Callable, Optional, Iterable, List
|
||||
from typing import TypeVar, Callable, Optional, Iterable, Union, Any, Tuple
|
||||
|
||||
import bpy
|
||||
import nodeitems_utils
|
||||
@ -67,7 +67,10 @@ class PowerShipNodeTree(bpy.types.NodeTree):
|
||||
|
||||
def _prepare_nodes(self) -> None:
|
||||
for node in self.nodes:
|
||||
node.reset_run()
|
||||
if isinstance(node, AbstractPowerShipNode):
|
||||
node.reset_run()
|
||||
else:
|
||||
raise TypeError(f"Node type unknown {type(node)}")
|
||||
|
||||
def _run_from_node(
|
||||
self, depsgraph: bpy.types.Depsgraph, start_node: "AbstractPowerShipNode"
|
||||
@ -117,13 +120,13 @@ class NodeSocketExecute(bpy.types.NodeSocket):
|
||||
def draw(
|
||||
self,
|
||||
context: bpy.types.Context,
|
||||
layout: bpy.types.Layout,
|
||||
layout: bpy.types.UILayout,
|
||||
node: bpy.types.Node,
|
||||
text: bpy.types.Text,
|
||||
text: Union[str, Any],
|
||||
) -> None:
|
||||
layout.label(text=text)
|
||||
|
||||
def draw_color(self, context: bpy.types.Context, node: bpy.types.Node) -> None:
|
||||
def draw_color(self, context: bpy.types.Context, node: bpy.types.Node) -> Tuple[float, float, float, float]:
|
||||
return (1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user