- This is done for the iteration during `generate_bones_mapping`.
- Adds a test export blend file and reference export escn file.
- Another reference export needed to be updated due to a new (correct)
bone order upon export, but does not affect the rest of that test.
This allows local users to test and generate reference exports without
installing a specific version of Blender locally.
Linting currently doesn't work due to a python version mismatch.
* Export from mesh.loop_triangles instead of mesh.polygons
This shouldn't change anything atm since the mesh is triangulated
beforehand, but this will allow us a non-triangulated mesh in the
future, which avoids problems where the mesh triangulation is wrong;
loop_triangles is always the "true" triangulation.
* Use mesh.loop_triangles for concave_shape
No longer need to ask the mesh converter to triangulate.
* Triangulate meshes if necessary for tangents
This means it is no longer required to ask for triangulation if
asking for tangents.
* Remove triangulate argument; now only triangulate for tangents
It is now as if it were always False. Triangulation will only
occur if needed for calc_tangents.
This was only True in mesh.py. Now that it is False there,
triangulate_mesh will be skipped for any meshes without (>4)-gons,
which solves issues of bad triangulation/damaged normals for these
meshes.
* Only triangulate n-gons when we can't calc_tangents
This should confine damage caused by triangulation to n-gons only.
* Warn when triangulating that exported n-gons may look wrong
* Test: make update-examples
* Don't set friction/bounce on KinematicBody.
These are properties only of Rigid and Static bodies.
* Set physics properties on a PhysicsMaterial.
```
The method set_friction has been deprecated and will be removed in the future, use physics material instead.
The method set_bounce has been deprecated and will be removed in the future, use physics material instead.
```
Fixes#364.
* Attempt basic spatial material conversion.
This improves our attempt at converting several material types
(Principled, Diffuse, and Emission) to SpatialMaterials. It still leaves
a lot to be desired, but implements more than our current approach.
What works:
- Principled albedo, metallic, roughness, anisotropy, emission, and
clearcoat. Principled does not have emission strength, so we just
assume 1.
- Emission strength and color
- Diffuse color and roughness.
Fixes#332.
* Add alpha support for spatial materials.
Everywhere we currently export a color we use mathutils.Color, which
doesn't support alpha. This adds an RGBA type we can use to export
colors with alpha.
Maybe we could use this in other places, but I'm not sure the
implications right now.
* Null-check NodeTree in SpatialMaterial export
* Add config.json for spatial export test.
* Update tests for spatial material export.
This is a breaking change.
For consistency with other exporters, we should use the suffix "-loop",
not "_loop", to indicate that an animation is looping. If we detect the
suffix "_loop" or any variation on the capitilization, we will print a
warning.
While we could be more flexible with the suffix and not break existing
exports, this would set the precedent for needing to support multiple
suffixes in other areas too. It seems safer to get strict as soon as we
can.
Fixes#310.
Relates to https://github.com/godotengine/godot/issues/32678.
Blender API is keep changing in Blender master branch, which makes it
hard to do regression tests. Here, switch back to Blender2.80 stable
for all the testing. Will consider testing with up-to-date API when
Blender2.81 releases.
1. Implement exporting Generated Texture Coordinates by evaluting
bounding box of blender object and passing AABB as uniforms.
2. Make ImageTexture node default to use Generated Texture Coordinates.
----------------
Fixed pylint errors.
Removed commented code.
Formatted code.
Update test scene
Include Godot Resource Name in to MeshResourceKey
Same mesh may be used both as CollisionShape and ArrayMesh
Simplify MeshResourceKey construction
The previously implementation is kind of risk because of the recursive
calling, here introduce a simpler one with some fault allowance.
Minor changes and fixes to last commit.
- Added functionality to export all object types.
- Replaced 'MESH' in object_types with more general 'GEOMETRY' option, allowing for all the following types to be converted: MESH, CURVE, SURFACE, META, FONT. These are all treated similarly using mesh.py. Beziers and Surfaces shapekeys tested and working.
- Moved + rejigged Mesh/Skeleton path resolving to end of export_scene() in export_godot.py for better functionality.
- Fixed bugs when attempting to export empty geometry.
- Added MeshResourceKey to mesh.py, this produces an identifier key for meshes with modifiers. Now, if more than one object use the exact same object data and modifiers then the exporter refers to a single resource.
- Reverted ArrayMeshResource resource_name values to object.data.name.
- Fixed some newline spacing inconsistencies that happened during serialization, so it now matches the same spacing that Godot uses.
Fully updated to work with latest Blender 2.8 build (March 31st 2019)
- Fixed use_mesh_modifiers when converting meshes.
- Added MeshConverter class to assist in all object to mesh conversions.
- Implemented new mesh naming convention to prevent clashing resource names.
- Commented out modifier disabling during ArrayMeshResourceExporter's export_morphs(), based on several tests that suggested it was not necessary.
- Fixed default_settings in __init__.py.
- Renamed MeshResourceExporter to ArrayMeshResourceExporter for consistency.
Implemented property "use_mesh_modifiers" prior to which was no longer working and had no effect on the resulting mesh.
Updated all props to use Python's type annotations, fixes start-up warning.
Updated all references of Object.to_mesh() to work with latest changes to Blender 2.8 API.
1. change transparent object's default refraction offset to (0.0, 0.0)
2. successfuly generating shader script even if no texture image
provided
3. if image texture node has no coordinate input, default to UV
4. remove glass effection in transparent principled BSDF
5. set a assertion guard in defining output sockets
6. correct emission and transparent bsdf output
7. more safe property check in mix shader
8. fix possible SameFileError in texture exporting
Instead of exporting BoneAttachments with names like `BoneAttachment`,
`BoneAttachment001`, `BoneAttachment002`, and so on, export them with
names like "${BoneName}BoneAttachment".
This makes your Godot code more robust and readable. If I have
attachments to bones named "Hand.L" and "Hand.R", now in Godot I can
refer to them as "HandLBoneAttachment" and "HandRBoneAttachment"
instead of "BoneAttachment" and "BoneAttachment001".
Cycles lights are implemented using the node tree, and this patch
doesn't attempt to handle all the possibilities that enables.
However, it does succeed in exporting the basic options you can tweak
in the light settings panel, including:
- RGB Color (no alpha)
- Energy
- Negative Light (for strength < 0)
- Shadows enabled/disabled
This also removes the use_sphere check as cycles lights do not support
limited distance or use_sphere.
Fixes#150.
(cherry picked from commit b57cee82f3)