godotengine / godotengine/godot

Using -rigid import hint on a blender model with an unapplied scale changes scale of rigidbody nodes directly, causing issues.

Open
#96,150 0 comments 0 reactions 0 assignees View on GitHub
bug topic:import
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Found in 4.3.stable

### System information

Godot v4.3.stable - EndeavourOS #1 SMP PREEMPT_DYNAMIC Mon, 19 Aug 2024 17:02:39 +0000 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7700S (RADV NAVI33) - AMD Ryzen 9 7940HS w/ Radeon 780M Graphics (16 Threads)

### Issue description

When importing a .blend file that has objects in it with unapplied scales, it looks like those scales get copied to the rigidbody objects created by the `-rigid` import hint. Godot actually shows a warning that this will cause issues if you open the model in the scene editor:
![image](https://github.com/user-attachments/assets/8adb311a-5674-4ed5-81b7-b0be00499f30)

Although the model looks correct in the editor, when the game is run the model will have it's scale reset. In the demo project attached you can see this causes the bottle to become massive.

In editor:
![image](https://github.com/user-attachments/assets/2dc2920d-f2e8-4448-979b-d66003282c5c)

In game:
![image](https://github.com/user-attachments/assets/0c3399f1-ad43-4b3c-a9b9-57af18e63f60)

I think this may also happen to other file formats, but I don't have as clean as an example to share.

I don't know what the proper fix for this should be. I think applying transformations in the importer would break animations, based on the warning in blender's FBX exporter. Maybe Godot should apply the scaling to the mesh and collision shape instead of the Rigidbody?

### Steps to reproduce

1. Scale an object in Blender while in Object Mode, then make sure the name of the object ends with `-rigid`
2. Create a Godot Scene with that object in it
3. Observe the scale change between the editor and runtime, or open the model's scene and see the warning.

### Minimal reproduction project (MRP)

[blendscale MRP.zip](https://github.com/user-attachments/files/16757444/blendscale.MRP.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached blendscale MRP.zip and reproduce the scale difference using the listed steps: import the unapplied-scale Blender model with the -rigid hint, then compare the editor and runtime results. Done means the rigidbody import no longer resets the model's scale at runtime while preserving the intended imported appearance.

Written by the indexing model from the issue text.

Assessment

Tech stack
blender, cpp
Domain
game-dev, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.