Skip to content

Commit 27e72ce

Browse files
committed
update Interpolation, but weight still inaccurate
1 parent b4416f3 commit 27e72ce

17 files changed

Lines changed: 125 additions & 34 deletions

contrast.jpg

-10.8 KB
Loading

example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
EXAMPLE.append(example_name)
1414

1515
print("Choose an example:")
16-
16+
1717
for i, example in enumerate(EXAMPLE):
1818
print(f"{i+1}.{example}")
1919

examples/qml_window_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from PySide6.QtWidgets import QApplication
33

4-
from .example_windows.example_window import ExampleWindow
4+
from .qml_window_example_windows.ball_window import ExampleWindow
55

66
def main():
77
app = QApplication(sys.argv)

examples/example_windows/example_window.py renamed to examples/qml_window_example_windows/ball_window.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
22
from dataclasses import dataclass
33

4-
from PySide6.QtWidgets import QVBoxLayout, QLabel, QHBoxLayout, QPushButton
4+
from PySide6.QtWidgets import QVBoxLayout, QLabel, QHBoxLayout, QPushButton, QWidget
55
from PySide6.QtCore import Qt, QUrl, Slot, Signal, QObject
66
from PySide6.QtQuickWidgets import QQuickWidget
77

@@ -11,6 +11,7 @@
1111

1212
from unity_animation_player import PysideAnimationPlayer
1313
from .popup_window import PopupWindow
14+
from .graph_window import AnimGraphWidget
1415

1516

1617
# 定义消息处理器
@@ -70,6 +71,10 @@ def __init__(self) -> None:
7071

7172
main_layout = QVBoxLayout()
7273

74+
#self.graph_widget = AnimGraphWidget()
75+
#self.graph_widget.setFixedSize(800, 200)
76+
#main_layout.addWidget(self.graph_widget)
77+
7378
self.quick_widget = QQuickWidget()
7479
self.quick_widget.setResizeMode(QQuickWidget.ResizeMode.SizeRootObjectToView)
7580
self.quick_widget.setSource(QUrl.fromLocalFile(Path(__file__).parent / "example.qml"))
@@ -88,6 +93,8 @@ def __init__(self) -> None:
8893
self.ball_animation_signal.connect(self.on_ball_signal_received)
8994
self.ball_animation_player = PysideAnimationPlayer(self.ball_animation_signal, "examples/AnimationClip/T.anim", stop_time=None, Pratio=(9, 4))
9095

96+
pos_points = [point['position'] for point in self.ball_animation_player.sample_range(0.001)]
97+
#self.graph_widget.update_plot(pos_points)
9198
self.play_anim()
9299

93100
def setup_multiple_animations(self, button_names):
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pyqtgraph as pg
2+
from PySide6.QtWidgets import QWidget, QVBoxLayout
3+
4+
from typing import List, Tuple
5+
class AnimGraphWidget(QWidget):
6+
def __init__(self):
7+
super().__init__()
8+
9+
self.layout = QVBoxLayout()
10+
self.plot_widget = pg.PlotWidget()
11+
self.layout.addWidget(self.plot_widget)
12+
self.setLayout(self.layout)
13+
14+
def update_plot(self, points: List[Tuple[float, float]]):
15+
self.plot_widget.clear()
16+
x_vals = [point[0] for point in points]
17+
y_vals = [point[1] for point in points]
18+
curve = self.plot_widget.plot(x_vals, y_vals, pen=(255, 255, 255))
File renamed without changes.

matplotlib.PNG

-7.58 KB
Loading

0 commit comments

Comments
 (0)