Added warning and skip objects with negative scale#367
Open
xphlawlessx wants to merge 2 commits intogodotengine:masterfrom
Open
Added warning and skip objects with negative scale#367xphlawlessx wants to merge 2 commits intogodotengine:masterfrom
xphlawlessx wants to merge 2 commits intogodotengine:masterfrom
Conversation
Jason0214
approved these changes
Oct 31, 2020
Collaborator
Jason0214
left a comment
There was a problem hiding this comment.
Thanks for the change!
|
|
||
| def should_export_object(self, obj): | ||
| """Checks if a node should be exported:""" | ||
| for dimension in obj.scale: |
Collaborator
There was a problem hiding this comment.
Just for your information, looks like scale with all dimensions being negative is valid in Godot (godotengine/godot#26173), but with some limitations.
I am okay with your implementation by skipping any negative scale object.
io_scene_godot/export_godot.py
Outdated
| """Checks if a node should be exported:""" | ||
| for dimension in obj.scale: | ||
| if dimension < 0: | ||
| logging.info("Negative scale is unsupported, Object '%s' was skipped", obj.name) |
Collaborator
Contributor
Author
|
Awesome thanks, ah that's much nicer with the logging. About fully negative
scale , I'll do a test and if there's away to show/ allow that I'll
certainly try.
…On Sat, 31 Oct 2020, 3:33 pm Lu Jiacheng, ***@***.***> wrote:
***@***.**** approved this pull request.
Thanks for the change!
------------------------------
In io_scene_godot/export_godot.py
<#367 (comment)>
:
> @@ -156,6 +156,10 @@ def export_object(self, obj, parent_gd_node):
def should_export_object(self, obj):
"""Checks if a node should be exported:"""
+ for dimension in obj.scale:
Just for your information, looks like scale with all dimensions being
negative is valid in Godot (godotengine/godot#26173
<godotengine/godot#26173>), but with some
limitations.
I am okay with your implementation by skipping any negative scale object.
------------------------------
In io_scene_godot/export_godot.py
<#367 (comment)>
:
> @@ -156,6 +156,10 @@ def export_object(self, obj, parent_gd_node):
def should_export_object(self, obj):
"""Checks if a node should be exported:"""
+ for dimension in obj.scale:
+ if dimension < 0:
+ logging.info("Negative scale is unsupported, Object '%s' was skipped", obj.name)
May be better to use logging.warning(), we have a hook
<https://github.com/godotengine/godot-blender-exporter/blob/master/io_scene_godot/export_godot.py#L72>
to show warning messages to the GUI. Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#367 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH2CWRHEW7YNFFSVUPOTJF3SNQU6LANCNFSM4SM4MNEA>
.
|
Sorry it took so long, I'm quite new at using Git.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a warning and ignore objects with negative scale, as a basic way to deal with Issue #24