Skip to content

Commit 788d92c

Browse files
author
Roberto De Ioris
authored
Update WritingAColladaFactoryWithPython.md
1 parent 34f23b6 commit 788d92c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tutorials/WritingAColladaFactoryWithPython.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,31 @@ Remember to change the FixMeshData function to honour the self.force_rotation va
392392

393393
## Persistent importer options: more subclassing
394394

395+
All should work fine, but it would be way cooler if the option we set in the importer wizard are remembered between imports.
396+
397+
We could obviously create a python class for storing values and mapping an instance of it to the ColladaFactory, but there is a better approach that will allow us to generate slate widgets automatically (without describing every single part of the interface).
398+
399+
Remember that you can inherit from every UClass, even UObject !
400+
401+
```python
402+
from unreal_engine.classes import Material, Object
403+
from unreal_engine.struct import Rotator
404+
405+
class ColladaImportOptions(Object):
406+
407+
DefaultRotation = Rotator
408+
DefaultMaterial = Material
409+
410+
...
411+
412+
class ColladaFactory(PyFactory):
413+
414+
ImportOptions = ColladaImportOptions()
415+
416+
...
417+
418+
```
419+
395420
## Automatically add the ColladaFactory on editor startup
396421

397422
## Improvements and final notes

0 commit comments

Comments
 (0)