mirror of
https://forge.apps.education.fr/blender-edutech/jumeaux-numeriques.git
synced 2024-01-27 06:56:18 +01:00
Suite de l'animation du volet (keyframe)
This commit is contained in:
parent
61e2e046bd
commit
69dd644abc
2
twin.py
2
twin.py
@ -134,7 +134,7 @@ def cmd_init():
|
||||
|
||||
# UI : Commands
|
||||
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['Doc-cmd-Hl'].setVisible(False,False)
|
||||
scene.objects['About-cmd-Hl'].setVisible(False,False)
|
||||
|
@ -1,7 +1,7 @@
|
||||
<data>
|
||||
<screen>
|
||||
<width>1458</width>
|
||||
<height>820</height>
|
||||
<width>1480</width>
|
||||
<height>832</height>
|
||||
<quality>1</quality>
|
||||
</screen>
|
||||
</data>
|
Binary file not shown.
BIN
volet_roulant/volet_roulant-7.blend
Normal file
BIN
volet_roulant/volet_roulant-7.blend
Normal file
Binary file not shown.
BIN
volet_roulant/volet_roulant-8.blend
Normal file
BIN
volet_roulant/volet_roulant-8.blend
Normal file
Binary file not shown.
@ -83,30 +83,67 @@ def voy_auto (cont):
|
||||
def mot (cont):
|
||||
if scene.objects['System']['run']:
|
||||
obj = cont.owner
|
||||
vitesse = 0.015
|
||||
print (obj['frame'])
|
||||
|
||||
# FIXME : animation par keyframe
|
||||
|
||||
# pas_cabine = 10 # Diam axe = 3 mm -> 1 tour = 3*math.pi
|
||||
# pas_pignon = pas_cabine/(3*math.pi) # Z pignon = 48 dents
|
||||
# pas_vissansfin = pas_pignon*48
|
||||
# obj_vissansfin = scene.objects['Moteur vis sans fin']
|
||||
# obj_pignon = scene.objects['Moteur pignon']
|
||||
# obj_cabine = scene.objects['Cabine']
|
||||
# obj_cabine['z']= scene.objects['Cabine'].localPosition.z # Affichage de l'altitude de la cabine
|
||||
# obj_contrepoids = scene.objects['Contrepoids']
|
||||
# obj_cable = scene.objects['Cable'] # FIXME : plus tard
|
||||
# if obj['up']:
|
||||
# obj_vissansfin.applyRotation((0, 0, pas_vissansfin*vitesse), True)
|
||||
# obj_pignon.applyRotation((pas_pignon*vitesse, 0, 0), True)
|
||||
# obj_cabine.applyMovement((0, 0, pas_cabine*vitesse), True)
|
||||
# obj_contrepoids.applyMovement((0, 0, -pas_cabine*vitesse), True)
|
||||
# # else: # Pas de priorité
|
||||
# if obj['down']:
|
||||
# obj_vissansfin.applyRotation((0, 0, -pas_vissansfin*vitesse), True)
|
||||
# obj_pignon.applyRotation((-pas_pignon*vitesse, 0, 0), True)
|
||||
# obj_cabine.applyMovement((0, 0, -pas_cabine*vitesse), True)
|
||||
# obj_contrepoids.applyMovement((0, 0, pas_cabine*vitesse), True)
|
||||
# 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
|
||||
|
||||
# Descendre
|
||||
if obj['down']:
|
||||
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-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Axe fdc'].playAction('Axe fdc-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Lame volet 1'].playAction('Lame volet 1-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Lame volet 2'].playAction('Lame volet 2-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Lame volet 3'].playAction('Lame volet 3-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Lame volet 4'].playAction('Lame volet 4-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Lame volet 5'].playAction('Lame volet 5-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
scene.objects['Lame volet 6'].playAction('Lame volet 6-Down', start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
|
||||
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
|
||||
|
@ -45,10 +45,15 @@ brochage={}
|
||||
def commandes():
|
||||
|
||||
# Ecrire votre code ici ...
|
||||
voy_auto(True) # Activer le voyant du niveau 0
|
||||
while True:
|
||||
pass
|
||||
|
||||
if bp_auto():
|
||||
voy_auto(True)
|
||||
if bp_m():
|
||||
mot_m(True)
|
||||
if bp_d():
|
||||
mot_d(True)
|
||||
|
||||
|
||||
fin() # A garder
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user