[Tutor] Specifying the selected object number in Blender

Marcus Mravik mmnissanzroadster9 at gmail.com
Tue Aug 5 19:35:57 CEST 2014


I am trying to specify a number based on what the selected object number in
the scene is.

import bpy

for obj in bpy.context.selected_objects:

    bpy.context.scene.objects.active = obj

    bpy.ops.graph.sound_bake(filepath="C:\\Users\\Marcus\\Music\\Don't Just
Stand There (Instrumental).mp3", low=50*(((WHERE OBJECT NUMBER GOES))),
high=100+50*(((WHERE OBJECT NUMBER GOES)))

(((WHERE THE OBJECT NUMBER GOES))) is not part of the script, it's just
where my question comes from.

My overall goal is to create a Music Visualizer with Blender and I am
trying to automate the selection of the object, applying the variable that
goes up by 50 each time, starting with 0 for the low freq and 50 for the
high freq. And ending with 7950 low and 8000 high.

-- 
mmnissanzroadster9 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140805/b0b89725/attachment.html>


More information about the Tutor mailing list