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.

Comments

Post a Comment

Your comments are very much appreciated. Thank You.

Popular Posts