Last active
November 11, 2015 06:42
-
-
Save tasinttttttt/1c5c1f3e0cf5c189e5e4 to your computer and use it in GitHub Desktop.
Blender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
# Create a "template" object with the physics to copy from | |
scene = bpy.context.scene | |
scene.objects.active = bpy.data.objects["template"] | |
for obj in scene.objects: | |
if obj.type == 'MESH': | |
obj.select = True | |
#bpy.ops.object.constraints_copy() | |
bpy.ops.rigidbody.object_settings_copy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Here are two ways to think about a 360° rotation from start to end frame: | |
Simple radians version. A circle in radians is 2pi. You just have to determine how much of the circle the current frame represents. | |
``` | |
frame / frame_end * 2 * pi | |
[value between 0 and 1, 0 being nothing of a pie chart, 1 being the full pie ] * [formula for a circle in radians] | |
``` | |
Degrees to radians version | |
``` | |
360 / frame_end * frame / 180 * pi | |
[get the value for one degree] [multiply it by the current frame number] [convert to radians] | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment