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

Create multiple RigidBodies from many several selected MeshInstances in the Scene tree dock #71

Open
kone9 opened this issue Sep 15, 2019 · 0 comments

Comments

@kone9
Copy link

kone9 commented Sep 15, 2019

Describe the project you are working on:
It is a test project where I have an object broken into many pedasos..This object was imported from Blender3D and use a modify called cellfracture that transforms 1 mesh into many pedasos without losing the shape.
Salvate_Juego
Screenshot_3

Describe how this feature / enhancement will help your project:
it would help create rigid or kinematic bodies of 3D objects much faster
Screenshot_4

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
Select multiple 3D objects
Screenshot_1
to each mesh create a rigidbody and its corresponding CONCAVEPOLIGONSHAPE so that the rigidbody works correctly.
Although this is not possible to do it manually, however in unity if you can choose multiple objects add the kinematic components and collisions simultaneously and even if Godot does not work with that concept, the ideal will be to be able to create multiple rigidbody objects from selecting meshes in the node browser ...

video https://youtu.be/nenvjBrIpOE

Describe implementation detail for your proposal (in code), if possible:
Select a mesh and from that create a parent rigidbody and collision with the shape of the mesh
I could only reproduce it here.
Screenshot_4

`extends Spatial

var NodosHijos = null #creo variable de tipo arreglo

#Called when the node enters the scene tree for the first time.
func _ready():
NodosHijos = get_children()

for i in NodosHijos:
	var newCuerpoRigido = RigidBody.new()#crea un nodo RigidBody
	i.create_trimesh_collision()#crea las colsiones y las mallas
	
	var colision = i.get_child(0).get_child(0)
	print(i.get_child(0).name)
	
	#i.remove_child(colision)
	#i.get_parent().add_child(colision)
	#i.queue_free()
	newCuerpoRigido.sleeping = true#el cuerpo rigido esta activo
	i.get_parent().add_child(newCuerpoRigido)#agrega el nodo al padre y se muestra en la escena
	
	i.get_parent().remove_child(i)#remueve del padre a todas las caras
	newCuerpoRigido.add_child(i)#cada parte rota es hijo de su correspondiente kinematic
	
	#var nodoColision = i.get_child(0).get_child(0)
	#nodoColision.move_child(newCuerpoRigido)
	
	#newCuerpoRigido.add_child(i.get_child(0).get_child(0))
	
	#print(nodoColision.name)#aca tengo la colision
	#i.remove_child(i.get_child(0))
	

	
	#print("el padre se llama ",i.get_parent().name)
	#print("posicion de ",i.name,"", i.translation)
	#print("posicion del nodo KINEMATICO " , newCuerpoRigido.translation , "\n")`

If this enhancement will not be used often, can it be worked around with a few lines of script?:
If you can but as I showed in a video above, it is a basic thing to create multiple rigidbodys from the selection of many objects in the node search engine or gameobject in unity

Is there a reason why this should be core and not an add-on in the asset library?:
because it would make it easy to create rigid bodies from many selected objects ... and as I showed before this is something basic in programs like unity

GLTF mesh match for tests

techo_destruible.zip

@fire fire changed the title create rigid bodies from many selected MESHs in the node viewer Create rigid bodies from many selected MESHs in the node viewer Sep 15, 2019
@Calinou Calinou changed the title Create rigid bodies from many selected MESHs in the node viewer Create multiple RigidBodies from many several selected MeshInstances in the Scene tree dock Nov 6, 2020
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

2 participants