assimp: Rename AssimpModel to GLTF model.
Assimp was contributing a lot of to the size of Ren'Py, so put it on a diet and removed all the formats except for GLTF). This would also let us switch toanother GLTF parser in the future.
This commit is contained in:
@@ -186,8 +186,7 @@ Matrix = renpy.display.matrix.Matrix # @UndefinedVariable
|
|||||||
Live2D = renpy.gl2.live2d.Live2D
|
Live2D = renpy.gl2.live2d.Live2D
|
||||||
|
|
||||||
Model = renpy.display.model.Model
|
Model = renpy.display.model.Model
|
||||||
|
GLTFModel = renpy.gl2.assimp.GLTFModel
|
||||||
AssimpModel = renpy.gl2.assimp.AssimpModel
|
|
||||||
|
|
||||||
# Currying things.
|
# Currying things.
|
||||||
Alpha = renpy.curry.curry(renpy.display.layout.Alpha)
|
Alpha = renpy.curry.curry(renpy.display.layout.Alpha)
|
||||||
|
|||||||
+5
-13
@@ -442,14 +442,14 @@ loader = Loader()
|
|||||||
loader_lock = threading.Lock()
|
loader_lock = threading.Lock()
|
||||||
"The lock used to protect the loader."
|
"The lock used to protect the loader."
|
||||||
|
|
||||||
class AssimpModel(renpy.display.displayable.Displayable):
|
class GLTFModel(renpy.display.displayable.Displayable):
|
||||||
"""
|
"""
|
||||||
:doc: assimp
|
:doc: assimp
|
||||||
|
|
||||||
A displayable that displays a 3D Model loaded using the
|
A displayable that loads a 3D Model in the GLTF format. This format is supported by many 3D tools. Ren'Py
|
||||||
`Open Asset Importer (assimp) library <https://github.com/assimp/assimp>`_.
|
uses the `Open Asset Importer (assimp) library <https://github.com/assimp/assimp>`_ to load GLTF models.
|
||||||
|
|
||||||
For the purposes of Ren'Py's 2D layout system, an AssimpModel has zero width and height. By default, the model
|
For the purposes of Ren'Py's 2D layout system, a GLTFModel has zero width and height. By default, the model
|
||||||
is loaded at the size found in the file that contains it. If required, the `zoom` may be used to scale it.
|
is loaded at the size found in the file that contains it. If required, the `zoom` may be used to scale it.
|
||||||
|
|
||||||
When multiple models are in use, the ``gl_depth True`` property should be supplied to the camera, so that
|
When multiple models are in use, the ``gl_depth True`` property should be supplied to the camera, so that
|
||||||
@@ -457,15 +457,7 @@ class AssimpModel(renpy.display.displayable.Displayable):
|
|||||||
important to use models simple enough to be completely rendered.
|
important to use models simple enough to be completely rendered.
|
||||||
|
|
||||||
`filename`
|
`filename`
|
||||||
The filename of the model to display. The following formats are supported:
|
The filename of the model to display.
|
||||||
|
|
||||||
3D, 3DS, 3MF, AC, AC3D, ACC, AMJ, ASE, ASK, B3D, BVH, CSM, COB, DAE/Collada, DXF, ENFF, FBX,
|
|
||||||
glTF 1.0 + GLB, glTF 2.0, HMB, IFC-STEP, IQM, IRR / IRRMESH, LWO, LWS, LXO, M3D, MD2, MD5,
|
|
||||||
MDC, MDL, MESH / MESH.XML, MOT, MS3D, NDO, NFF, OBJ, OFF, OGEX, PLY, PMX, PRJ, Q3O, Q3S, RAW, SCN,
|
|
||||||
SIB, SMD, STP, STL, TER, UC, VTA, X, X3D, XGL, ZGL
|
|
||||||
|
|
||||||
Many of these formats are obsolete or special-purpose. glTF 2.0 is the best-tested format for Ren'Py
|
|
||||||
use, though it requires a custom shader for best results.
|
|
||||||
|
|
||||||
`textures`
|
`textures`
|
||||||
A list of textures to load. These textures will be loaded into texture slots - the first will be tex0, the
|
A list of textures to load. These textures will be loaded into texture slots - the first will be tex0, the
|
||||||
|
|||||||
@@ -556,10 +556,10 @@ can be supplied the property method.
|
|||||||
and `gl_texture_wrap_tex3` the fourth. While only these four are avalable through Transforms,
|
and `gl_texture_wrap_tex3` the fourth. While only these four are avalable through Transforms,
|
||||||
it's possibe to supply "texture_wrap_tex4" or "texture_wrap_myuniform" to Render.add_property.
|
it's possibe to supply "texture_wrap_tex4" or "texture_wrap_myuniform" to Render.add_property.
|
||||||
|
|
||||||
AssimpModel Displayable
|
GLTFModel Displayable
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
The AssimpModel displayble allow you to load 3D models in over 40 file formats. This is what you should use
|
The GLTFModel displayble allow you to load 3D models in the GLTF file format. This is what you should use
|
||||||
if you have a 3D model you created in another program and want to display in Ren'Py.
|
if you have a 3D model you created in another program and want to display in Ren'Py.
|
||||||
|
|
||||||
.. include:: inc/assimp
|
.. include:: inc/assimp
|
||||||
|
|||||||
Reference in New Issue
Block a user