Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Curve objects as Godot Path nodes. #380

Merged
merged 4 commits into from
Dec 16, 2020

Conversation

rcorre
Copy link
Contributor

@rcorre rcorre commented Nov 15, 2020

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.

@rcorre
Copy link
Contributor Author

rcorre commented Nov 15, 2020

Test scene: Test Scene

@rcorre
Copy link
Contributor Author

rcorre commented Nov 15, 2020

So I don't forget, we should update https://docs.godotengine.org/en/3.2/getting_started/workflow/assets/escn_exporter/ if/when this merges.

Fixes godotengine#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.
@rcorre
Copy link
Contributor Author

rcorre commented Nov 18, 2020

RuntimeError: Error: File written by newer Blender binary (290.0), expect loss of data!

Looks like I need an older blender to set up the reference files. I'll try to get that set up when I can

@Jason0214
Copy link
Collaborator

Thanks!
If it is troublesome to have several versions of Blender, I think we might be able to use the travis CI (or github action) to generate and commit the diff after we verified the change locally. It should be possible and very helpful for future devs.

@rcorre
Copy link
Contributor Author

rcorre commented Nov 18, 2020

That, or maybe a local Dockerfile. Is travis docker-based?

@Calinou
Copy link
Member

Calinou commented Nov 18, 2020

Is travis docker-based?

No, it only offers VMs instead of containers since 2019.

Copy link
Collaborator

@Jason0214 Jason0214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much adding the curve support!

io_scene_godot/converters/simple_nodes.py Show resolved Hide resolved
logging.warning("Curve %s has no splines", node.name)
return None

spline = splines[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that we can export all the spline in the node.data.splines and only assign the active one to the Curve node? How do you think? (Btw you can get the active spline by calling node.data.splines.active)

@Jason0214
Copy link
Collaborator

If it is troublesome to have several versions of Blender, I think we might be able to use the travis CI (or github action) to generate and commit the diff after we verified the change locally. It should be possible and very helpful for future devs.

I found it is possible to generate a scene diff patch from the Travis log, I did it in #384. I found the git apply sometimes fail searching for a very long line, not sure if it's an issue with my local git or a general issue. Anyway, if you are interested you can try that PR out : )

Copy link
Collaborator

@Jason0214 Jason0214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's blocked by a mismatch between the Blender version of test scene (Blender 2.9) and the Blender version that CI runs.

How about removing the test scene temporarily from this change to get it submitted first?
And then bump the Blender version in CI and handle the out-dated test scenes in another change. I can not think of any better ways to do it : (

Ryan Roden-Corrent added 2 commits December 15, 2020 18:33
They are generated with too recent of a blender version. We'll add them
again after bumping the blender CI version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Are there any plans on adding blending Curve import (as Path)?
3 participants