mirror of
https://forge.apps.education.fr/blender-edutech/jumeaux-numeriques.git
synced 2024-01-27 06:56:18 +01:00
Suite de la migration
This commit is contained in:
parent
d28e1cb8d6
commit
91c19ab6a5
Binary file not shown.
44
twin.py
44
twin.py
@ -4,11 +4,11 @@ import webbrowser
|
||||
import math
|
||||
import xml.etree.ElementTree as ET # Creating/parsing XML file
|
||||
|
||||
import jumeau_doc # Documentation
|
||||
import jumeau_about # About
|
||||
import twin_doc # Documentation
|
||||
import twin_about # About
|
||||
|
||||
###############################################################################
|
||||
# jumeau.py
|
||||
# twin.py
|
||||
# @title: Bibliothèque générale du l'environnement 3D pour le développement de jumeau numérique
|
||||
# @project: Blender-EduTech
|
||||
# @lang: fr
|
||||
@ -26,8 +26,8 @@ scene = bge.logic.getCurrentScene()
|
||||
# print("Objets de la scene : ", scene.objects)
|
||||
|
||||
# Config file
|
||||
jumeau_config = ET.parse('jumeau_config.xml')
|
||||
jumeau_config_tree = jumeau_config.getroot()
|
||||
twin_config = ET.parse('twin_config.xml')
|
||||
twin_config_tree = twin_config.getroot()
|
||||
|
||||
# Couleurs
|
||||
color_cmd = [0.8, 0.8, 0.8, 1] # Blanc
|
||||
@ -56,10 +56,10 @@ def keyboard(cont):
|
||||
# Maj du fichier de config (screen size : data/config/screen/width-> [0][0].text)
|
||||
screen_width = bge.render.getWindowWidth()
|
||||
screen_height = bge.render.getWindowHeight()
|
||||
jumeau_config_tree[0][0].text=str(screen_width)
|
||||
jumeau_config_tree[0][1].text=str(screen_height)
|
||||
buffer_xml = ET.tostring(jumeau_config_tree)
|
||||
with open("jumeau_config.xml", "wb") as f:
|
||||
twin_config_tree[0][0].text=str(screen_width)
|
||||
twin_config_tree[0][1].text=str(screen_height)
|
||||
buffer_xml = ET.tostring(twin_config_tree)
|
||||
with open("twin_config.xml", "wb") as f:
|
||||
f.write(buffer_xml)
|
||||
|
||||
# Sortir
|
||||
@ -112,7 +112,7 @@ def keyboard(cont):
|
||||
|
||||
def cmd_init():
|
||||
# Fichier de config (screen size : data/config/screen/width-> [0][0].text, height-> [0][1].text)
|
||||
bge.render.setWindowSize(int(jumeau_config_tree[0][0].text),int(jumeau_config_tree[0][1].text))
|
||||
bge.render.setWindowSize(int(twin_config_tree[0][0].text),int(twin_config_tree[0][1].text))
|
||||
scene.objects['Play-Hl'].setVisible(False,False)
|
||||
scene.objects['Pause-Hl'].setVisible(False,False)
|
||||
scene.objects['Reset-view-Hl'].setVisible(False,False)
|
||||
@ -190,21 +190,21 @@ def cmd_click(cont):
|
||||
|
||||
# About
|
||||
if obj.name=="About-cmd" :
|
||||
if scene.objects['System']['anim'] == True: # Rendu meilleur en pause
|
||||
scene.objects['About']['anim']= True
|
||||
anim_pause()
|
||||
else:
|
||||
scene.objects['About']['anim'] = False
|
||||
cine_about.open()
|
||||
# if scene.objects['System']['anim'] == True: # Rendu meilleur en pause
|
||||
# scene.objects['About']['anim']= True
|
||||
# anim_pause()
|
||||
# else:
|
||||
# scene.objects['About']['anim'] = False
|
||||
twin_about.open()
|
||||
|
||||
# Aide
|
||||
if obj.name=="Help-cmd" :
|
||||
if scene.objects['System']['anim'] == True: # Rendu meilleur en pause
|
||||
scene.objects['Doc']['anim']= True
|
||||
anim_pause()
|
||||
else:
|
||||
scene.objects['Doc']['anim'] = False
|
||||
cine_doc.open()
|
||||
# if scene.objects['System']['anim'] == True: # Rendu meilleur en pause
|
||||
# scene.objects['Doc']['anim']= True
|
||||
# anim_pause()
|
||||
# else:
|
||||
# scene.objects['Doc']['anim'] = False
|
||||
twin_doc.open()
|
||||
|
||||
###############################################################################
|
||||
# Manipulation du mécanisme
|
||||
|
@ -3,7 +3,7 @@ import webbrowser
|
||||
import numpy as np
|
||||
|
||||
###############################################################################
|
||||
# jumeau_about.py
|
||||
# twin_about.py
|
||||
# @title: A propos de l'environnement 3D des jumeaux numériques
|
||||
# @project: Blender-EduTech
|
||||
# @lang: fr
|
||||
|
@ -1,7 +1,7 @@
|
||||
import bge # Bibliothèque Blender Game Engine (UPBGE)
|
||||
|
||||
###############################################################################
|
||||
# jumeau_doc.py
|
||||
# twin_doc.py
|
||||
# @title: Documentation de l'environnement 3D des jumeaux numériques
|
||||
# @project: Blender-EduTech
|
||||
# @lang: fr
|
||||
|
Loading…
Reference in New Issue
Block a user