From bda62d0bae7bad9efeae6dd40152c44ff5697a10 Mon Sep 17 00:00:00 2001 From: Hector <2055590199@qq.com> Date: Sat, 11 Oct 2025 09:16:04 +0800 Subject: [PATCH] =?UTF-8?q?2d=5Fimage=E5=8A=A0=E8=BD=BD=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/gui_manager.py | 2 +- scene/scene_manager.py | 6 ++---- ui/property_panel.py | 11 ----------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/gui/gui_manager.py b/gui/gui_manager.py index 0d5123a4..fc26e86c 100644 --- a/gui/gui_manager.py +++ b/gui/gui_manager.py @@ -502,7 +502,7 @@ class GUIManager: traceback.print_exc() return None - def createGUI2DImage(self, pos=(0, 0, 0), image_path=None, size=1): + def createGUI2DImage(self, pos=(0, 0, 0), image_path=None, size=(1,1,1)): """创建2D GUI图片""" try: from direct.gui.DirectGui import DirectButton diff --git a/scene/scene_manager.py b/scene/scene_manager.py index eb9d0240..f8c3e2b5 100644 --- a/scene/scene_manager.py +++ b/scene/scene_manager.py @@ -1993,19 +1993,17 @@ class SceneManager: size=absolute_scale[0] if absolute_scale and len(absolute_scale) > 0 else 1.0 ) elif gui_type == "2d_image" and hasattr(gui_manager, 'createGUI2DImage'): - scale_value = absolute_scale[0] - print(f"2d_image{scale_value}") new_element = gui_manager.createGUI2DImage( pos=tuple(absolute_position), image_path=image_path, - size=absolute_scale + size=(0.8,0.8,0.8) ) elif gui_type == "3d_text" and hasattr(gui_manager, 'createGUI3DText'): size = absolute_scale[0] if absolute_scale and len(absolute_scale) > 0 else 0.5 new_element = gui_manager.createGUI3DText( pos=tuple(absolute_position), text=text, - size=size + size=absolute_scale ) elif gui_type == "3d_image" and hasattr(gui_manager, 'createGUI3DImage'): # 处理3D图像 diff --git a/ui/property_panel.py b/ui/property_panel.py index 927e5e88..1be6a178 100644 --- a/ui/property_panel.py +++ b/ui/property_panel.py @@ -3169,7 +3169,6 @@ class PropertyPanelManager: print("❌ 未找到视频纹理") return - # 检查当前播放状态 if not hasattr(self, '_video_playing'): self._video_playing = {} @@ -3177,7 +3176,6 @@ class PropertyPanelManager: is_playing = self._video_playing.get(video_id, False) if is_playing: - # 暂停视频 if hasattr(movie_texture, 'stop'): movie_texture.stop() if hasattr(self, '_spherical_video_controls') and 'play_button' in self._spherical_video_controls: @@ -3185,15 +3183,12 @@ class PropertyPanelManager: play_button.setText("▶️ 播放") print("⏸️ 球形视频已暂停") else: - # 播放视频 if hasattr(movie_texture, 'play'): movie_texture.play() if hasattr(self, '_spherical_video_controls') and 'play_button' in self._spherical_video_controls: play_button = self._spherical_video_controls['play_button'] play_button.setText("⏸️ 暂停") print("▶️ 球形视频开始播放") - - # 更新播放状态 self._video_playing[video_id] = not is_playing except Exception as e: @@ -3217,12 +3212,10 @@ class PropertyPanelManager: if hasattr(movie_texture, 'setTime'): movie_texture.setTime(0.0) - # 更新播放按钮 if hasattr(self, '_spherical_video_controls') and 'play_button' in self._spherical_video_controls: play_button = self._spherical_video_controls['play_button'] play_button.setText("▶️ 播放") - # 更新播放状态 if hasattr(self, '_video_playing'): video_id = id(spherical_video) self._video_playing[video_id] = False @@ -3420,7 +3413,6 @@ class PropertyPanelManager: video_control_group = QGroupBox("视频控制") video_control_layout = QHBoxLayout() - # 播放按钮 play_btn = QPushButton("▶️ 播放") play_btn.clicked.connect(lambda: self.world.gui_manager.playVideo(video_screen)) video_control_layout.addWidget(play_btn) @@ -8632,7 +8624,6 @@ except Exception as e: original_world_pos = origin_model.getPos(self.world.render) original_world_hpr = origin_model.getHpr(self.world.render) original_world_scale = origin_model.getScale(self.world.render) - actor.setPos(origin_model.getPos()) actor.setHpr(origin_model.getHpr()) actor.setScale(origin_model.getScale()) @@ -8655,8 +8646,6 @@ except Exception as e: taskMgr.add(maintainWorldPosition,f"maintain_anim_pos_{id(actor)}") - - if hasattr(self, 'animation_combo'): # 获取原始动画名称(存储在 userData 中) current_index = self.animation_combo.currentIndex()