* Added HueSaturation and Invert (only for color input) nodes
Fix normal mapping node to Godot shader
Fix albedo textures not receiving hint_albedo in Godot
* convert tabs into spaces
- 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.
* Export Curve objects as Godot Path nodes.
Fixes#330.
Relates to godotengine/godot-proposals#527.
Previously, curves in blender were exported to meshes in Godot.
Now, a bezier curve created in blender will be exported as a Path node
with a Curve3D resource matching the blender data. The curve will have a
child MeshInstance that renders the bevel.
Only bezier curves are exported to Godot Path nodes. Other curves, such
as Nurbs, export only as meshes as they did previously.
* Export all splines but only assign the active one.
* Remove curve test scenes for now.
They are generated with too recent of a blender version. We'll add them
again after bumping the blender CI version.
* Fix pylint warnings.
* 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.
For the C code we disable the PEP8 check on the long lines.
An alternative would be to wrap before `out float result`, possibly
with a double indentation.
Fixes:
```
io_scene_godot/converters/material/script_shader/shader_functions.py:467:80: E501 line too long (80 > 79 characters)
io_scene_godot/converters/material/script_shader/shader_functions.py:485:80: E501 line too long (81 > 79 characters)
io_scene_godot/converters/material/script_shader/shader_functions.py:491:80: E501 line too long (84 > 79 characters)
io_scene_godot/converters/material/script_shader/shader_functions.py:554:80: E501 line too long (81 > 79 characters)
io_scene_godot/converters/material/script_shader/shader_functions.py:563:80: E501 line too long (82 > 79 characters)
io_scene_godot/converters/material/script_shader/shader_functions.py:647:80: E501 line too long (81 > 79 characters)
```
```
io_scene_godot/__init__.py:214:12: C0415: Import outside toplevel (%s) (import-outside-toplevel)
io_scene_godot/__init__.py:272:4: C0415: Import outside toplevel (%s) (import-outside-toplevel)
```
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.