godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.48k stars 21.08k forks source link

Godot should warn that changes are lost on editing an .obj mesh (perhaps on other imported resources too) #20659

Closed lucbf closed 2 years ago

lucbf commented 6 years ago

Godot version: 3.0.x, 3.1

I suspect Material_OV was added because of this, nevertheless there's no workaround for other nodes such as gridmap and multimesh and even if there was it would be impossible to set a .obj file as local to scene for example.

lucbf commented 6 years ago

I have to say that I've tried to fix this bug by making godot save the changes on the .import folder but I gave up when I saw that (at least aparently) godot just wants to save .tscn and .tres files.

eon-s commented 6 years ago

You mean that changes get lost on the inherited scene when editing the source model?

lucbf commented 6 years ago

No, when you create a MeshInstance node and load a obj mesh

bojidar-bg commented 5 years ago

Tested locally, seems like a slight useability issue. The "Changes may be lost!" warning does appear on imported .obj meshes: image Unfortunatelly, when you edit the mesh in-place, the warning is nowhere to be seen (I guess we shouldn't allow the user to edit imported resources in-place?) image

eon-s commented 5 years ago

Editing resources in place can be useful for testing, but maybe can be partially locked and force you to open a "preview mode" with a button or something.

elizaho commented 4 years ago

I would like to work on this.

Calinou commented 4 years ago

@elizaho Thanks for your interest in contributing. Go ahead :slightly_smiling_face:

ChristopheLY commented 4 years ago

I have a solution but it's not cover everery possibilities where current_node have a mesh

Another thing, the button warning was not update when I add or delete a mesh .obj

editor/editor_node.cpp image

ChristopheLY commented 4 years ago

I would like to add a commit but i have a PR open (#39141) , what can I do?

akien-mga commented 4 years ago

@ChristopheLY You can use separate branches to make several PRs. See https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#branching In general you should avoid making PRs from your fork's master branch, but since you already have one, it's not a problem, you just need to create a new branch and then reset it to the upstream master branch's state.

akien-mga commented 2 years ago

It took me a while to understand what the issue is exactly so I'll rephrase it.

When editing the .obj directly, as Bojidar pointed out, it does show "changes may be lost".

When editing the Mesh resource assigned to a MeshInstance3D, whether it's saved as a custom .tres or builtin in its parent node, you can change things. You can assign a material, etc.

The part which is problematic is that if you didn't save this modified Mesh resource as a .tres, and you then reimport the .obj file, any changes made on top of it in the scene will be lost.

I'll close this as duplicate of #42128 which is a bit clearer.