mirror of
https://github.com/Astatin3/autoPlanner.git
synced 2026-06-08 23:58:00 -06:00
Bugfixes
This commit is contained in:
+14
-10
@@ -12,13 +12,21 @@ keyFrames = []
|
|||||||
|
|
||||||
matchLength = 15
|
matchLength = 15
|
||||||
matchTicks = 15 * 50
|
matchTicks = 15 * 50
|
||||||
displayTickResolution = 7
|
displayTickResolution = 4
|
||||||
displayTicks = round(matchTicks / displayTickResolution)
|
displayTicks = round(matchTicks / displayTickResolution)
|
||||||
|
|
||||||
indicatorBarHeight = None
|
indicatorBarHeight = None
|
||||||
|
|
||||||
|
dragFrameIndex = -1
|
||||||
selFrame = -1
|
selFrame = -1
|
||||||
|
|
||||||
|
def getPosKeyframes():
|
||||||
|
frames = []
|
||||||
|
for keyFrame in keyFrames:
|
||||||
|
if keyFrame['type'] == 'position':
|
||||||
|
frames.append(keyFrame)
|
||||||
|
return frames
|
||||||
|
|
||||||
def getKeyframeAtPos(index):
|
def getKeyframeAtPos(index):
|
||||||
for frame in keyFrames:
|
for frame in keyFrames:
|
||||||
if frame["timeIndex"] == index:
|
if frame["timeIndex"] == index:
|
||||||
@@ -33,14 +41,9 @@ def getPosKeyframeAtPos(index):
|
|||||||
|
|
||||||
def getBezierPointCounts():
|
def getBezierPointCounts():
|
||||||
counts = []
|
counts = []
|
||||||
dist = 0
|
frames = getPosKeyframes()
|
||||||
for i in range(1,displayTicks):
|
for i in range(1,len(frames)):
|
||||||
frame = getPosKeyframeAtPos(i)
|
counts.append(frames[i]['timeIndex'] - frames[i-1]['timeIndex'])
|
||||||
if frame == None:
|
|
||||||
dist += 1
|
|
||||||
else:
|
|
||||||
counts.append(dist)
|
|
||||||
dist = 0
|
|
||||||
return counts
|
return counts
|
||||||
|
|
||||||
def getPosKeyframeByIndex(index):
|
def getPosKeyframeByIndex(index):
|
||||||
@@ -247,11 +250,12 @@ class buttonEditor:
|
|||||||
for i in range(len(ogNodes)):
|
for i in range(len(ogNodes)):
|
||||||
keyFrames.append({
|
keyFrames.append({
|
||||||
"type": "position",
|
"type": "position",
|
||||||
"timeIndex": round(((i)/len(ogNodes)) * (displayTicks-1)),
|
"timeIndex": round((i)/(len(ogNodes)-1) * (displayTicks-1)),
|
||||||
"index": i,
|
"index": i,
|
||||||
"position": ogNodes[i],
|
"position": ogNodes[i],
|
||||||
"rotation": ogRotNodes[i]
|
"rotation": ogRotNodes[i]
|
||||||
})
|
})
|
||||||
|
# print(keyFrames)
|
||||||
else:
|
else:
|
||||||
self.updateNodes(True)
|
self.updateNodes(True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user