Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- #debug readout
- own.parent['ReadA']= str(own.parent['Act'])
- if 'init' not in own:
- init()
- #update aiming rig
- arm = bpy.data.objects[cont.owner.name]
- pose = arm.pose
- matrix = pose.bones['Spine1'].matrix
- posAR = own.parent.worldTransform @ matrix @ Vector([0,.25,-.5])
- own['AR'].worldPosition = posAR
- if own.parent['Cam']==True:
- own.scene.active_camera.worldPosition = own.worldTransform @ own['CR']['orig']
- own.scene.active_camera.worldPosition =own.scene.active_camera.worldPosition.lerp(own['CR'].worldPosition,.25)
- own.scene.active_camera.worldOrientation = own.parent.worldOrientation @ own['CR']['oRot']
- own.scene.active_camera.worldOrientation = own.scene.active_camera.worldOrientation.lerp(own['CR'].worldOrientation,.5)
- #proccess states if you have them do basic movement if you dont'
- if 'actStrip' not in own:
- if str(own.parent['Act']) not in actions:
- own['d'] = "normal"
- own.parent.alignAxisToVect([0,0,1],2,.15)
- fall = fallCheck()
- if fall==None:
- proccessAim(arm)
- proccessMovementForces()
- proccessIdle()
- restTimer()
- if 'Weapon' in own:
- proccessEquipment()
- if 'Aimer' in own['Weapon'] and 'AimL' in own.parent['Act']:
- laserAim()
- elif 'Line1' in own and 'AimL' not in own.parent['Act']:
- own['Line1'].endObject()
- del own['Line1']
- elif 'Line1' in own:
- own['Line1'].endObject()
- del own['Line1']
- else:
- #call states using input
- own['actStrip'] = [ actions[str(own.parent['Act'])] ]
- #proccess states in actstrip
- else:
- if len(own['actStrip'])>0:
- own['d'] = str(own['actStrip'])
- #do 1 single thing and move on when it's done
- if type(own['actStrip'][0]) is tuple:
- function = StateDict[own['actStrip'][0][0]]
- function(own['actStrip'][0][1], -1)
- #print('called')
- #do multiple things and move on when all done
- elif type(own['actStrip'][0]) is list:
- popList = []
- index =0
- if len(own['actStrip'][0])>0:
- for entry in own['actStrip'][0]:
- function = StateDict[entry[0][0]]
- a = function(entry[0][1],index )
- if a!=None:
- #if there is return it's a index to pop
- popList.append(a)
- index+=1
- else:
- own['ActStrip'].pop(0)
- if len(popList)>0:
- ret = multi_delete(own['ActStrip'][0], popList)
- own['ActStrip'][0] = ret
- else:
- del own['actStrip']
- own.parent['Move']=[]
- own.parent['Act']=[]
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement