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

Bone2D nodes are rendered wrongly when parent node is scaled #76087

Open
ciqven opened this issue Apr 15, 2023 · 3 comments
Open

Bone2D nodes are rendered wrongly when parent node is scaled #76087

ciqven opened this issue Apr 15, 2023 · 3 comments

Comments

@ciqven
Copy link

ciqven commented Apr 15, 2023

Godot version

v4.0.2.stable.official [7a0977c]

System information

Linux amd64, nvidia GTX 1080 TI driver Version: 525.105.17

Issue description

Greetings, I am facing what I think is an issue with the in-editor display of Bone2D. When I have the following scene tree for say a character:

Node2D
    Skeleton2D
        Bone2D
            ...

2023-04-15-133606_1911x1556_scrot

Then, when I scale the top Node2D down, the in-editor rendered bones scale correctly.
2023-04-15-133654_1911x1556_scrot

However, as soon as I hit ctrl+s to save, the bones are rendered big and chunky instead.
2023-04-15-133711_1911x1556_scrot

Steps to reproduce

  1. Create new project
  2. Make a Node2D scene
  3. Add a Node2D, this is the character root
  4. Add a Skeleton2D to the character root from step 3
  5. Add a number of Bone2D nodes to make a visible skeleton
  6. Scale the character root down (to e.g 0.2)
  7. Observe the in-editor rendered bones to scale nicely
  8. Save the project with ctrl+s
  9. Observe the bones being rendered way thicker.

Minimal reproduction project

bone2d_render_bug.zip

@Chaosus
Copy link
Member

Chaosus commented Jun 1, 2023

Scaling is tricky in computer graphics, and generally you should use it carefully with physics and bones (especially). Probably there is no good fix for this, since Blender have same problem with bones for a long time. Probably someone who understand this topic should write a portion documentation about it.

@ciqven
Copy link
Author

ciqven commented Jun 1, 2023

Thanks for the reply! I am aware that scaling in bones & physics is often unreliable in game engines. I encountered this bug during the making of a quick prototype and would put more care into getting the sizes right and not needing scaling in an actual project, of course.

However, I still felt like reporting this because this is purely about the in-editor display of (indirectly) scaled bones. This is, to my eyes at least, a different kind of bug than the usual 'weird' behavior with scaled bones or physics.

I did a quick test in Blender, and can indeed confirm it has roughly the same bug with 'Octahedral' and 'B-Bone' viewport display modes. However, other modes ('Envelope', for example) seem to not have this problem.

Lastly, it seems Godot differs from Blender here in that it renders the bones in a way that I would consider correct, until the user saves the project.

I'll leave it to someone with more knowledge of editor internals to triage whether this is worth fixing, or if we should just add a warning (perhaps even in-editor?) about scaling bones/skeletons/physics. Thank you for your time.

@wapoa
Copy link

wapoa commented Aug 4, 2023

Thanks, as a new user getting into animation in Godot I believe that my bone issues are coming from scaling bones. I would not have known otherwise so a message would've been helpful. I will now redo my entire structure without scaling and hopefully will have better results, but as you noted everything looks fine until you save or reload the project. Bone structure also differs in the Polygon editor as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants