Skip to content

Commit

Permalink
fixed datasending issues with animation nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
maybites committed Aug 10, 2021
1 parent 8571303 commit aed727b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
8 changes: 4 additions & 4 deletions nodes/AN/nodes/OSCListNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ def setValue(self, value):

def getValue(self):
value = dataByIdentifier.get(self.identifier)
if isinstance(value, DoubleList):
value = tuple(value)
if value is not None and self.createString:
if len(value) == 1:
value = str(value[0])
else:
value = str(value)
return value


@property
def value(self):
if isinstance(self.getValue(), DoubleList):
return tuple(self.getValue())
else:
return self.getValue()
return self.getValue()

@value.setter
def value(self, value):
Expand Down
7 changes: 6 additions & 1 deletion nodes/AN/nodes/OSCNumberNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from collections import defaultdict
from animation_nodes.sockets.info import toIdName
from animation_nodes.base_types import AnimationNode
from animation_nodes.data_structures import DoubleList

from ....utils.utils import *

Expand Down Expand Up @@ -109,7 +110,11 @@ def setValue(self, value):
dataByIdentifier[self.identifier] = value

def getValue(self):
return dataByIdentifier.get(self.identifier)
value = dataByIdentifier.get(self.identifier)
if isinstance(value, DoubleList):
return tuple(value)
else:
return value

@property
def value(self):
Expand Down
6 changes: 5 additions & 1 deletion server/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ def make_osc_messages(myOscKeys, myOscMsg):
if item.dp_format_enable == False:
# we cannot deal with a datapath string that has format syntax
#print( "sending :{}".format(item) )
prop = eval(item.data_path)
prop = None
if item.node_type == 1:
prop = eval(item.data_path + ".getValue()")
else:
prop = eval(item.data_path)

# now make the values to be sent a tuple (unless its a string or None)
if isinstance(prop, (bool, int, float)):
Expand Down

0 comments on commit aed727b

Please sign in to comment.