167 Commits

Author SHA1 Message Date
Minjae Kim
2db443a23a fix use_inherit_scale deprecation 2024-01-06 04:10:41 +09:00
Tim Klein
1e0d104df5 [-] Fix version check for mesh update to work with blender 3.0
- Also, add alternative property introspection for io_scene_godot.export
  that will work with Blender 3.0
2021-12-23 14:34:30 -05:00
Henry Conklin
eaf80e476a Store the draw type when exporting empty nodes
Supports using empties as placeholders for collision shapes
2021-08-28 06:58:18 -04:00
Willian Galvani
0fc4d15915 add ShaderFunction for vector element-wise multiplication (#376) 2021-07-29 23:21:48 +08:00
Wagner
3b0870e7d4 Added 2 new blender nodes and fixed some Godot shader issues (#405)
* 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
2021-07-29 23:20:38 +08:00
Tim Klein
44a894f2ee [-] Add ordered_bones method to ensure bone order matches armature hierarchy
- 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.
2021-03-05 21:51:44 -05:00
Celpec
aba3cfaf3f fix 'struct rna of ExportGodot removed' error (#393)
* fix 'struct rna of ExportGodot removed' error if upexpected error occured while exporting

* Update __init__.py

* Update __init__.py

* Update __init__.py

Co-authored-by: U-TTE\celpec <celpecgame@gmail.com>
2021-02-11 10:47:35 +08:00
Ryan Roden-Corrent
c0d5ac9df9 Add mesh name to n-gon warning message.
This makes it easier for the user to figure out which mesh was
troublesome.
2021-01-04 17:58:33 -05:00
Ryan Roden-Corrent
3e66e12d7c Export Curve objects as Godot Path nodes. (#380)
* 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.
2020-12-16 22:01:53 +08:00
Lu Jiacheng
1c6a3b8ff9 Filter out colon in node path, which is also invalid in latest Godot. (#383)
Also rewrite node name filtering using filter() to be concise.
2020-11-26 23:42:45 +08:00
scurest
a35395770c Only triangulate n-gons when necessary for calc_tangents (#379)
* 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
2020-11-26 00:30:36 +08:00
Ryan Roden-Corrent
27ffa28078 Set physics properties on a PhysicsMaterial. (#365)
* 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.
2020-11-22 14:30:02 +08:00
Ryan Roden-Corrent
80816c386b Normalize line endings in multimesh.py (#381)
multimesh.py was the only python file with CRLF line endings.
2020-11-15 18:16:37 +01:00
epth
a01b0e9ae3 add feature - export particle objects as multimeshinstance to godot (#354)
* add feature particle to multimeshinstance

* fix exporting single object particle will cause error

* fix wrong scale that will scale postion before

* fix for reveiwing

* fix for reveiwing

* pep8

* pep8 line length

* pep8 indent

* mat4 changes and change export particle from active to all

* fix active

* fix wrong

* fix pep8 error

* fix pep8 error ..

* fix pep8 error ...

* Simplify MultiMeshResource key.

* Wrap too-long lines.

Co-authored-by: U-APPLE\celpec <celpecgame@gmail.com>
Co-authored-by: Lu Jiacheng <lujc.me@gmail.com>
2020-11-13 21:51:18 +08:00
Lu Jiacheng
61e55f2905 Merge pull request #366 from xphlawlessx/master
Added export option for excluding objects hidden during rendering.
2020-11-01 10:59:11 +08:00
Lu Jiacheng
e6d1f49393 Merge pull request #362 from rcorre/better-light-warning
Clarify warning message for unsupported light.
2020-10-31 22:09:01 +08:00
Willian Galvani
a14114c497 Check if object has parent instead of checking if parent is None 2020-10-12 22:59:16 -03:00
xphlawlessx
d7a2d5fe6f Added export option for excluding objects hidden during rendering. Should fix Issue #314 2020-10-07 19:54:09 +01:00
Ryan Roden-Corrent
9a11f369a0 Clarify warning message for unsupported light.
Previously the warning read
"Unknown light type. Use Point, Spot or Sun: Area", which is vague it
looks like Area is part of the supported types.
2020-09-07 07:13:15 -04:00
Ryan Roden-Corrent
274f668963 Improve our attempt at exporting SpatialMaterials. (#341)
* 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.
2020-06-05 15:53:55 +08:00
sdfgeoff
73a57b3f3d Merge pull request #290 from akien-mga/authors
Add Jiacheng and Geoffrey as authors
2020-06-02 15:05:06 +12:00
Jason0214
61dfeb1b35 Fix import order in animation to make pylint happy
Also reorder style-test to the front of exporting diff test.
2020-02-26 20:48:48 -08:00
Ryan Roden-Corrent
088a64ecdf Change _loop suffix to -loop.
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.
2020-02-25 06:50:48 -05:00
Lu Jiacheng
81088123cb Merge pull request #309 from Ben1138/fix_node_tree_crash
Fix crash for potential non existent texture images.
2020-02-09 10:00:05 -08:00
mourning20s
c8c747733c Bugfix for #305 2020-01-21 19:17:24 -06:00
Lu Jiacheng
97244579a5 Merge pull request #283 from rcorre/geometry_shader
Implement some Geometry node shader outputs.
2020-01-11 11:00:57 -08:00
Ben1138
43d2578223 Fix crash for potential non existent texture images. 2020-01-04 19:31:00 +01:00
Jason0214
82ff6aad72 Fix material MappingNode exporting issue in 2.80
1. Fix version checking, change '<= (2, 80, 0)' to '< (2, 81, 0)'
2. Fix mathutil.Matrix() API misusage
2019-12-15 17:30:54 -08:00
Jason0214
04ab6cbcc5 Conformance with Blender2.81
1. ShaderNodeMapping socket and property change,
see https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Python_API
2. Exclude two unused input socket (dhdx, dhdy) in BumpNode
2019-12-15 14:34:29 -08:00
Ryan Roden-Corrent
7bf96d5b5e Use is_direction=True for Tangent and Normal. 2019-12-10 08:07:20 -05:00
Ryan Roden-Corrent
3775e4edc0 Merge remote-tracking branch 'upstream/master' into geometry_shader 2019-12-10 07:51:40 -05:00
Jason0214
8ca6b07a86 Fix testing failing in CI
1. Last commit changes `spot_range` mapping from `distance` to
`cutoff_distance`, it breaks some light tests.
2. Fix a pylint line-too-long error
2019-12-08 21:50:05 -08:00
Lu Jiacheng
d2a726d2bf Merge pull request #294 from akien-mga/fix-MixRgbNodeConverter-clamp
Fix invalid substitution in MixRgbNodeConverter
2019-12-08 17:11:43 -08:00
Lu Jiacheng
11bc86ac44 Merge pull request #272 from Dentoid/lamp-distance-28-fix
Change attribute for light distance for 2.80
2019-12-08 17:10:20 -08:00
Lu Jiacheng
42e01e2e6a Merge pull request #284 from addixff/master
Fixes call to mesh.update in Blender 2.81+
2019-12-08 17:08:24 -08:00
Rémi Verschelde
acc2f38109 Fix invalid substitution in MixRgbNodeConverter 2019-11-22 14:27:16 +01:00
Rémi Verschelde
fb207c8bf8 Add Jiacheng and Geoffrey as authors
Roughly reordered based on an assessment of the amount of contribution
to the exporter code.
2019-11-22 12:24:16 +01:00
Rémi Verschelde
63d3a2c15d Fix style issues causing CI failure
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)
```
2019-11-22 12:11:24 +01:00
addixff
7b20b2fb4e Fix for Blender 2.81 2019-10-05 21:05:01 +02:00
Ryan Roden-Corrent
236ab0d482 Fix pylint errors on shader_functions. 2019-09-27 06:29:18 -04:00
Ryan Roden-Corrent
6b2decd37f Implement some Geometry node shader outputs.
Implements a subset of the geometry shader node outputs that trivially
map to godot shader inputs.

See #280.
2019-09-26 22:41:43 -04:00
Lu Jiacheng
8c7859792d Merge pull request #275 from fx21/feature/shader-math-nodes
Shader math nodes
2019-09-25 21:01:05 -07:00
Lu Jiacheng
2617236404 Merge pull request #276 from Jason0214/optional_mat
Add option to export Material as Spatial Material
2019-09-03 09:43:36 -07:00
Fredrik Holmar
3e6837fc0f Added shader math nodes 2019-09-03 16:29:14 +02:00
Jason0214
e7a4f3b963 Use Blender2.80 stable build for travis CI
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.
2019-09-02 23:02:41 -07:00
Jason0214
a55346d137 Add option to export Material as Spatial Material 2019-09-02 11:11:37 -07:00
Anders Stenberg
549c03a0a3 Change attribute for light distance for 2.80 2019-08-24 22:15:23 +02:00
Anders Stenberg
b12820e310 Fix dodgy parentheses 2019-08-24 16:56:05 +02:00
Lu Jiacheng
1eb6c32f01 Merge pull request #263 from Jason0214/fix_default_uv
Use UV for image texture with no tex coord input
2019-08-18 22:54:17 -06:00
Lu Jiacheng
9395007d3e Merge pull request #262 from Jason0214/fix_crashing_in_hash
Convert iterable property to tuple in MeshKey hash
2019-08-18 22:37:16 -06:00