Suite de l'animation du volet (keyframe)

This commit is contained in:
Philippe Roy 2022-12-26 18:10:17 +01:00
parent 61e2e046bd
commit 69dd644abc
7 changed files with 71 additions and 29 deletions

View File

@ -134,7 +134,7 @@ def cmd_init():
# UI : Commands # UI : Commands
scene.objects['Run-Hl'].setVisible(False,False) scene.objects['Run-Hl'].setVisible(False,False)
scene.objects['Pause-Hl'].setVisible(False,False) # scene.objects['Pause-Hl'].setVisible(False,False)
scene.objects['ResetView-Hl'].setVisible(False,False) scene.objects['ResetView-Hl'].setVisible(False,False)
scene.objects['Doc-cmd-Hl'].setVisible(False,False) scene.objects['Doc-cmd-Hl'].setVisible(False,False)
scene.objects['About-cmd-Hl'].setVisible(False,False) scene.objects['About-cmd-Hl'].setVisible(False,False)

View File

@ -1,7 +1,7 @@
<data> <data>
<screen> <screen>
<width>1458</width> <width>1480</width>
<height>820</height> <height>832</height>
<quality>1</quality> <quality>1</quality>
</screen> </screen>
</data> </data>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -83,30 +83,67 @@ def voy_auto (cont):
def mot (cont): def mot (cont):
if scene.objects['System']['run']: if scene.objects['System']['run']:
obj = cont.owner obj = cont.owner
vitesse = 0.015 print (obj['frame'])
# FIXME : animation par keyframe # Monter
if obj['up']:
start = 1
end = 100
layer = 0
priority = 1
blendin = 1.0
mode = bge.logic.KX_ACTION_MODE_PLAY
layerWeight = 0.0
ipoFlags = 0
speed = 0.5
scene.objects['Axe enrouleur'].playAction('Axe enrouleur-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Axe fdc'].playAction('Axe fdc-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 1'].playAction('Lame volet 1-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 2'].playAction('Lame volet 2-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 3'].playAction('Lame volet 3-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 4'].playAction('Lame volet 4-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 5'].playAction('Lame volet 5-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 6'].playAction('Lame volet 6-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 7'].playAction('Lame volet 7-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 8'].playAction('Lame volet 8-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 9'].playAction('Lame volet 9-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 10'].playAction('Lame volet 10-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 11'].playAction('Lame volet 11-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 12'].playAction('Lame volet 12-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.bjects['Lame volet 13'].playAction('Lame volet 13-Up', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
time.sleep(0.125)
obj['up']= False
# FIXME : Touner sans fin
# pas_cabine = 10 # Diam axe = 3 mm -> 1 tour = 3*math.pi # Descendre
# pas_pignon = pas_cabine/(3*math.pi) # Z pignon = 48 dents if obj['down']:
# pas_vissansfin = pas_pignon*48 start = 1
# obj_vissansfin = scene.objects['Moteur vis sans fin'] end = 100
# obj_pignon = scene.objects['Moteur pignon'] layer = 0
# obj_cabine = scene.objects['Cabine'] priority = 1
# obj_cabine['z']= scene.objects['Cabine'].localPosition.z # Affichage de l'altitude de la cabine blendin = 1.0
# obj_contrepoids = scene.objects['Contrepoids'] mode = bge.logic.KX_ACTION_MODE_PLAY
# obj_cable = scene.objects['Cable'] # FIXME : plus tard layerWeight = 0.0
# if obj['up']: ipoFlags = 0
# obj_vissansfin.applyRotation((0, 0, pas_vissansfin*vitesse), True) speed = 0.5
# obj_pignon.applyRotation((pas_pignon*vitesse, 0, 0), True) scene.objects['Axe enrouleur'].playAction('Axe enrouleur-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
# obj_cabine.applyMovement((0, 0, pas_cabine*vitesse), True) scene.objects['Axe fdc'].playAction('Axe fdc-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
# obj_contrepoids.applyMovement((0, 0, -pas_cabine*vitesse), True) scene.objects['Lame volet 1'].playAction('Lame volet 1-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
# # else: # Pas de priorité scene.objects['Lame volet 2'].playAction('Lame volet 2-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
# if obj['down']: scene.objects['Lame volet 3'].playAction('Lame volet 3-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
# obj_vissansfin.applyRotation((0, 0, -pas_vissansfin*vitesse), True) scene.objects['Lame volet 4'].playAction('Lame volet 4-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
# obj_pignon.applyRotation((-pas_pignon*vitesse, 0, 0), True) scene.objects['Lame volet 5'].playAction('Lame volet 5-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
# obj_cabine.applyMovement((0, 0, -pas_cabine*vitesse), True) scene.objects['Lame volet 6'].playAction('Lame volet 6-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
# obj_contrepoids.applyMovement((0, 0, pas_cabine*vitesse), True) scene.objects['Lame volet 7'].playAction('Lame volet 7-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 8'].playAction('Lame volet 8-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 9'].playAction('Lame volet 9-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 10'].playAction('Lame volet 10-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 11'].playAction('Lame volet 11-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.objects['Lame volet 12'].playAction('Lame volet 12-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
scene.bjects['Lame volet 13'].playAction('Lame volet 13-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
time.sleep(0.125)
obj['down']= False
# FIXME : Touner sans fin
############################################################################### ###############################################################################
# Capteurs fin de course # Capteurs fin de course

View File

@ -45,9 +45,14 @@ brochage={}
def commandes(): def commandes():
# Ecrire votre code ici ... # Ecrire votre code ici ...
voy_auto(True) # Activer le voyant du niveau 0
while True: while True:
pass if bp_auto():
voy_auto(True)
if bp_m():
mot_m(True)
if bp_d():
mot_d(True)
fin() # A garder fin() # A garder