I'm trying to watch the coordinates of an object as it moves during a simulation, and to this end I want to add a new Panel to the Rigid Body Panel, like this:
class PHYSICS_PT_rigid_body_worldmatrix(PHYSICS_PT_rigidbody_panel, Panel): bl_label = "Rigid Body Coordinates" bl_default_closed = True @classmethod def poll(cls, context): obj = context.object return (obj and obj.rigid_body and obj.rigid_body.type == 'ACTIVE' and (not context.scene.render.use_game_engine)) def draw(self, context): layout = self.layout ob = context.object rbo = ob.rigid_body row = layout.row() row.prop(ob, "matrix_world", index=12, text="X") row.prop(ob, "matrix_world", index=13, text="Y") row.prop(ob, "matrix_world", index=14, text="Z")
This works if I put the code into
startup/bl_ui/properties_physics_rigidbody.py, but not if I put it into a script file and try to load it. It can't find
PHYSICS_PT_rigidbody_panel, even if I add this line:
from bpy.types import PHYSICS_PT_rigidbody_panel, Panel
Any ideas how to access class
Also, when I run it by editing the system files, it still has some issues. It doesn't update in real time during the simulation; I have to move the mouse into the properties window. I'd also like to see the numbers displayed in scientific notation if they are extremely small.