Hello,
Ive been posting on several forum category but I found nothing to fix a little problem. :S
I’m doing a huge dominoes animation/simulation but the problem is I didn’t set my first cube that I copied as rigid which make all the others static or unselected.
The problem is there’s like 100 cubes +. I could change them manuel but I feel like a script or any other solution could be really useful.
Is there any script for that? (copying physics property ( masses, collission compound, physics type ) from an object to other objects )
hi, when you right click on a property copy the data path, then fill this script with your values and add your properties… run it on selected objects and watch console for info on any errors
it seems complex!
How do I do that :$?
I’m a big beginner :S
I don’t know what is data path so I just oppened the python console. Selected all cubes and then past the scripts it says syntax error invalide
Hey, liero, uh, thanks?
It seems a very simple and elegant script. Makes me wish I’d paid more attention in Computer Science class.
Thanks for taking the time to post it. Great answer to a question. Gold star for you!
@franatieu
give me (us) a ‘small’ (say 10 domino) .blend file, than I will try to build that script into it …
It looks like that you have to use ‘Scripting’ building a file (in Blender) put the example script into it and somewhere the game-engine has to
be instructed to use that script at the very first time …
Yea I know about the shift+D and thow to do an animation, thats what I did but the first cube I duplicated wasn’t set as rigid :S.
Here’s above the .blend you wanted.
Do you think this script would work ? I dont kow how to use it :/. I dont even know what is a data path. lol
import bpy for obj in bpy.context.selected_objects: obj.game.physics_type = ‘RIGID_BODY’ obj.game.use_collision_bounds = True obj.game.collision_bounds_type = ‘BOX’ obj.game.collision_margin = 0.025 obj.game.use_material_physics_fh = True
thanks a lot! It works
I copyed the script into python console and there was an error but when I copy it into the text editor and click run script it actually works!
Thanks again!
I knew you guys would have a solution
I tried the (part of the script) in a python console of you blend (after selecting!!! two inbetween cubes)
and it works!
>>> for obj in bpy.context.selected_objects:
… obj.game.physics_type = ‘RIGID_BODY’
… obj.game.use_collision_bounds = True
… obj.game.collision_bounds_type = ‘BOX’
… obj.game.collision_margin = 0.025
… obj.game.use_material_physics_fh = True
…
>>>
You have to look in the good view, seeing three of the blocks falling down ;-), after pressing a P.