Closed caco26i closed 6 years ago
It doesn't look like the exporter would store rigid body settings, so you would end up with only the constraint locations in your export file but without its physical properties.
What do you think that is the best way, modify the bullet-constraints-builder to add the settings of constraints as "userData" (the exporter will export this data) or modify the Three.js Blender Export to save the settings? I'm working on a project to simulate earthquakes using Three.js. I want to do something like Dom-Ino House Exposed to Earthquake using Dynamic Fracture. Thank you.
For some reason exporting custom properties doesn't work for me with this exporter. Not entirely sure if this is a bug in the exporter but it seems to be the case as custom_properties(obj) appears never to be called. Anyways, if you can get this to work then you can write a custom script that copies all available rigid body and constraint settings into custom properties so that it can be exported using the exporter. Edit: The exporter exports custom properties only when the Scene checkbox is enabled, so it's working.
I am learning, this is my first time with blender and I am using blender because I saw your plugin. I don't know how to do that, but i will read the documentation. Thank you.
Blender is of course a large software to learn but it shouldn't be too difficult to realize such a script if you have some coding experience. You only have to find out all the attributes you need to copy which can be found in the context menu of each setting. Here is a short snippet for two settings to get the idea:
import bpy
objs = bpy.context.scene.objects
objs["Cube"]["mass"] = objs["Cube"].rigid_body.mass
objs["Constraint"]["breaking_threshold"] = objs["Constraint"].rigid_body_constraint.breaking_threshold
Can we export the model with constraints using the three js exporter?