Hello everyone. I am a beginner with python scripting and I just want to have a script add keyframes to the lock locations and rotations in the physics panel in the game engine for over 140 objects. I have tried a lot of different python commands and I cant seem to get anything working. “bpy.context.active_object.keyframe_insert(GameObjectSettings.lock_location_x)” is what I tried in the console and nothing happened. Any solutions?
I can’t locate “lock locations” in physics panel, aren’t they in the object tab?
In the game engine, my objects are set to rigid bodies. You should be able to see the lock locations options. And yes, you can do the same in the object tab but I just started out with the physics tab.
But there is no bpy in the Game Engine at runtime, correct?
I have no idea. I just want to have a script put keyframes on those lock locations and rotations options. That is all.
it is possible that the transform locks from blender object tab end up to as GameObjectSettings properties?
question: do you need to enable the locks in general, or do you need to enable/disable them at runtime?
I was able to get a script to enable the locks in general, and I do need to enable/disable them at runtime.
i’m not sure whether they are available in game engine or not, an object in BGE doesn’t have a .game property like it exists in regular blender to access the locks. It might be impossible to set this at runtime, but perhaps it’s replacable with a constraint?
I never thought of that. Ill play around some more!
It turns out that after some physics adjusting, all of the shards retain their position and rotation until they hit the ground but when they hit the ground, some really strange things happen with the shards. Ill cell fracture the glass again and start over.
EDIT: It turns out that I actually will not be needing the script to do anything. I just need to be really thorough in making sure I cant do it without scripts the first time. Thanks for your help though!