Python Tip : Toggling mesh's double sidedness

I posted this on a social network in response to a question

"is there a python script to turn all objects mesh, "double sided" to false?"


Let me explain the above code snippet

C.scene.objects
is a shortcut for bpy.context.scene.objects. In Blender, bpy.context keeps track of the global/current application context, which in this case is teh list of objects in the currently set scene in Blender.

[obj.data for obj in C.scene.objects if obj.type in ['MESH']] 
returns a list of mesh objects in the current scene. This syntax here is that of a Python list comprehension

mesh.show_double_sided = False
This performs the actual magic. Its self explanatory.

Popular posts from this blog

Blender 2.64 - Tutorial - Intro to Masking (Rotoscoping)

Hello OSL

Render Wedges using the Blender Video Sequence Editor