Skip to content

Commit cc75a04

Browse files
author
Roberto De Ioris
authored
Update WritingAColladaFactoryWithPython.md
1 parent 715101a commit cc75a04

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎tutorials/WritingAColladaFactoryWithPython.md‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ This tutorial has been tested with Unreal Engine 4.16 and Python 3.6 and assumes
77
If this is your first experience with the Unreal Engine Python plugin, this link is a good place to start: https://github.com/20tab/UnrealEnginePython/blob/master/tutorials/PlottingGraphsWithMatplotlibAndUnrealEnginePython.md#installing-the-python-plugin
88

99

10-
The objective is to instruct the editor to import .dae (collada) files as static meshes., by building a new Factory. A Factory is a special class
11-
in Unreal Engine 4 allowing to create and import assets. There are factories for fbx's, wav's, images and all of the media files supported by UE4.
10+
The objective is to instruct the editor to import .dae (collada) files as static meshes, by building a new Factory.
11+
A Factory is a special class in Unreal Engine 4 allowing to create and import assets. There are factories for fbx's, wav's, images and all of the media files supported by UE4.
1212

1313
You generally create new factories by subclassing the UFactory class in C++, but in this tutorial we will see how to subclass UE4 C++ classes in pure python.
1414

@@ -17,7 +17,7 @@ You generally create new factories by subclassing the UFactory class in C++, but
1717
## Subclassing UFactory: PyFactory
1818

1919
The subclassing api allows the developer to subclass any UClass (classes exposed to the UE4 reflection system). Unfortunately the UFactory class does not expose
20-
its methods to the reflection system, so an handy class named 'UPyFactory' is exposed by the python plugin:
20+
its methods to the reflection system, so an handy class named 'UPyFactory' (it ia simple subclass of UFactory) is exposed by the python plugin:
2121

2222
```python
2323
from unreal_engine.classes import PyFactory
@@ -30,9 +30,15 @@ class ColladaFactory(PyFactory):
3030
ue.log_error('Hello World, i am a useless factory')
3131
```
3232

33-
save the file as collada_factory.py into the /Content/Scripts directory and run it rom the Unreal Engine Python Console.
33+
save the file as collada_factory.py into the /Content/Scripts directory and run it rom the Unreal Engine Python Console:
3434

35-
Note that whenever you re-run the scripts, the internal Unreal Engine reflection system is updated, so you do not need to restart the editor (or launch slow compilations) when you make changes to the script code
35+
![Class prototype](https://github.com/20tab/UnrealEnginePython/blob/master/tutorials/WritingAColladaFactoryWithPython_Assets/class_prototype.png)
36+
37+
Note that whenever you re-run the scripts, the internal Unreal Engine reflection system is updated, so you do not need to restart the editor (or launch slow compilations) when you make changes to the script code:
38+
39+
![Multiple runs](https://github.com/20tab/UnrealEnginePython/blob/master/tutorials/WritingAColladaFactoryWithPython_Assets/multiple_runs.png)
40+
41+
as you can see from the screenshot, the address of the UClass as well as its python UObject counterpart remains the same, while the __init__ call is updated. Remember that whenever you create a new UClass from python, the __init__ method is automatically called by the ClassDefaultObject (this information is useful only if you are into unreal engine internals, otherwise you can simply ignore it ;).
3642

3743
## Parse .dae files with pycollada
3844

0 commit comments

Comments
 (0)