Suite de la migration

This commit is contained in:
Philippe Roy 2022-12-11 10:28:41 +01:00
parent d28e1cb8d6
commit 91c19ab6a5
4 changed files with 24 additions and 24 deletions

44
twin.py
View File

@ -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

View File

@ -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

View File

@ -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