Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Allow applying modifiers, clean up code. #5

Merged
merged 4 commits into from
Dec 2, 2021

Conversation

rcorre
Copy link
Contributor

@rcorre rcorre commented Nov 29, 2021

This PR consists of a few commits:

  • Apply modifiers if no shape keys exist. This is the main feature I was interested in.
  • Clean up code. This made it more readable for me, feel free to discard if it isn't helpful.
  • Reduce verbosity, only print on error. Blender is a bit noisy, we don't need to spam the console unless it fails.
  • Fix enabled_plugins in top-level project.

If a model has modifiers, the user probably wants them applied to form
the final mesh. This is especially common with the Mirror modifier.

Howerver, `export_apply` cannot be used with shapekeys, so we should
only set it if no shapekeys exist.
- Use PoolStringArray.join to make blender args more readable/editable
- Remove unused tex_dir_global
- Use string formatting instead of String.replace
- Remove unused python imports
- Pass filepath as blender arg
We don't need to spam the console every time we run blender. Just print
the args/stdout if the command fails.
@fire
Copy link
Member

fire commented Nov 29, 2021

You can apply modifiers with shape keys here. https://github.com/V-Sekai/V-Sekai-Blender-tools/tree/main/addons/ApplyModifierForObjectWithShapeKeys

@fire
Copy link
Member

fire commented Nov 29, 2021

In my other copy of the code, I use this pattern of creating a string that is json syntax. Using string replace on it, and then json parse it and use the dictionary get on the data.

@rcorre
Copy link
Contributor Author

rcorre commented Nov 29, 2021

You can apply modifiers with shape keys here

Thanks! Though I feel like having both shapekeys and modifiers is pretty rare. Godot 3 has enough problems with shapekeys that I've learned to avoid them, so I think it is best to just keep this simple. I do often have modifiers like Mirror which I want applied on export, so it seems nice to have that option on when we can.

@fire
Copy link
Member

fire commented Nov 29, 2021

Also I uh.. have a secondary workflow where I convert blend shapes to skeletal animations, but it's a bit obscure :D.

@fire
Copy link
Member

fire commented Nov 29, 2021

I also am working in Godot 4, so I'd need to sync these changes to master of this repository. Want to keep them synced.

@rcorre
Copy link
Contributor Author

rcorre commented Nov 29, 2021

Would you like me to backport to main, or leave that to you? I'm hoping this plugin will be soon be obsolete in Godot 4 with godotengine/godot#54886 (review), right? 🤞

@fire
Copy link
Member

fire commented Nov 29, 2021

I would appreciate it if you could help me backport to main, as you know, Godot Engine 4 alpha has been promised for several months and has my attention.

@fire
Copy link
Member

fire commented Dec 2, 2021

I'll merge it in and then test it. Thanks!

@fire fire merged commit a99dfdd into V-Sekai:godot3 Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants