Forum

Adding shadows on many objects at once

01 March 2017 19:16
E21
Hello,

First of all, Congrats for the new release!

I have created a lot of objects and I must add shadow to all of them. I wonder if there's a shortcut to add shadows to many object at once because when you have 10 objects, it's ok; when you have 448, it's tedious.

Any suggestions?

Thank you!
01 March 2017 19:22
E21
Same thing would useful with Do Not Export…
02 March 2017 12:16
E21
I'm trying to make a Python script in Blender that, given a number of selected objects, select objects that I want to add shadows to and adds receiving and casting shadows.

Unfortunately, it doesn't work and I don't know see what's wrong. It results in only the last selected object to be added shadow settings. What's strange is that I have a working script, similar, and export FBX for each object: here I only changed B4W related lines.

Does anyone see the error? Some help would be appreciated!


My script:

import bpy
import os

for objectN in bpy.context.selected_objects:
bpy.ops.object.select_all(action='DESELECT')
objectN.select = True
bpy.context.object.b4w_shadow_cast = True
bpy.context.object.b4w_shadow_receive = True
02 March 2017 12:38
Hello

I always use the following script:
02 March 2017 13:19
E21
All right, thank you Roman!
02 March 2017 17:31
I would add that you can assign any property to all selected objects with ALT+click. But you have to switch off the Emulate 3 Button Mouse option in Blender User Preferences under the Input section (it is off by default).
02 March 2017 19:59
E21
Hey! Even better!

I'm learning B4W and Blender with you, guys. I know I'm asking a few questions but as soon as I'm ok with my B4W level, I'll share it with you. You're a great team!

Thanks a lot!
 
Please register or log in to leave a reply.