Skip to content

Commit ce1b7f9

Browse files
author
Roberto De Ioris
authored
Update WritingAColladaFactoryWithPython.md
1 parent 47e1218 commit ce1b7f9

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

‎tutorials/WritingAColladaFactoryWithPython.md‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,58 @@ Now we want to create a modal window just after the dae file is parsed to ask th
283283

284284
```python
285285

286+
...
287+
288+
from unreal_engine import SWindow, SVerticalBox, SHorizontalBox, SButton, SRotatorInputBox
289+
from unreal_engine.enums import EHorizontalAlignment
290+
291+
...
292+
293+
def open_collada_wizard(self):
294+
295+
def cancel_import():
296+
self.wizard.request_destroy()
297+
298+
def confirm_import():
299+
self.do_import = True
300+
self.wizard.request_destroy()
301+
302+
def update_roll(roll):
303+
self.force_rotation.roll=roll
304+
305+
def update_pitch(pitch):
306+
self.force_rotation.pitch=pitch
307+
308+
def update_yaw(yaw):
309+
self.force_rotation.yaw=yaw
310+
311+
self.wizard = SWindow(title='Collada Import Options', modal=True, sizing_rule=1)(
312+
SVerticalBox()
313+
(
314+
SRotatorInputBox(roll=lambda:self.force_rotation.roll,
315+
pitch=lambda:self.force_rotation.pitch,
316+
yaw=lambda:self.force_rotation.yaw,
317+
on_roll_changed=update_roll,
318+
on_pitch_changed=update_pitch,
319+
on_yaw_changed=update_yaw,
320+
),
321+
auto_height=True,
322+
padding = 10
323+
)
324+
(
325+
SHorizontalBox()
326+
(
327+
SButton(text='Cancel', on_clicked=cancel_import, h_align = EHorizontalAlignment.HAlign_Center)
328+
)
329+
(
330+
SButton(text='Import', on_clicked=confirm_import, h_align = EHorizontalAlignment.HAlign_Center)
331+
),
332+
auto_height=True,
333+
padding = 4,
334+
),
335+
336+
)
337+
self.wizard.add_modal()
286338

287339
```
288340

0 commit comments

Comments
 (0)