Skip to content

Commit

Permalink
Fix Armature Info node.
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarEmaraDev committed Dec 14, 2018
1 parent e6842e9 commit b00597a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion animation_nodes/nodes/vector/c_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def vectorsFromValues(DoubleList values):
output.data[i].z = <float>values.data[i]
return output

def calculateVectorDistances(int amount,
def calculateVectorDistancesVirtual(int amount,
VirtualVector3DList vectors1,
VirtualVector3DList vectors2):
cdef DoubleList distances = DoubleList(length = amount)
Expand All @@ -48,6 +48,15 @@ def calculateVectorDistances(int amount,

return distances

def calculateVectorDistances(Vector3DList vectors1, Vector3DList vectors2):
cdef DoubleList distances = DoubleList(length = len(vectors1))
cdef Py_ssize_t i

for i in range(len(vectors1)):
distances.data[i] = distanceVec3(vectors1.data + i, vectors2.data + i)

return distances

def calculateVectorLengths(Vector3DList vectors):
cdef Py_ssize_t i
cdef DoubleList lengths = DoubleList(length = len(vectors))
Expand Down
4 changes: 2 additions & 2 deletions animation_nodes/nodes/vector/vector_distance.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bpy
from . c_utils import calculateVectorDistances
from . c_utils import calculateVectorDistancesVirtual
from ... base_types import AnimationNode, VectorizedSocket
from ... data_structures import VirtualVector3DList

Expand Down Expand Up @@ -29,4 +29,4 @@ def calcDistances(self, a, b):
vectors1 = VirtualVector3DList.create(a, (0, 0, 0))
vectors2 = VirtualVector3DList.create(b, (0, 0, 0))
amount = VirtualVector3DList.getMaxRealLength(vectors1, vectors2)
return calculateVectorDistances(amount, vectors1, vectors2)
return calculateVectorDistancesVirtual(amount, vectors1, vectors2)

0 comments on commit b00597a

Please sign in to comment.