Hello:)
I am writing small script. If there was no Gui it would be really easy. Unfortunatelly I need to add gui.I have never do it before so I have got small problem.
import bpyclass DS_Panel(bpy.types.Panel):
bl_idname = "VIEW3D_SD"
bl_label = "SD_Panel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
def draw(self, context):
layout=self.layout
layout.label("Also Small Class")
layout.label("Choose export type")
col = layout.column(align=1)
row = col.row()
row.operator("DS_TF")
row.operator("DS_T")
class DS_FF(bpy.types.Panel):
bl_idname = "DS_F"
def execute(self,context):
n=0
for n in range(len(bpy.data.objects)):
if(bpy.data.objects[n].type=="MESH"):
bpy.data.objects[n].data.show_double_sided=False
return {'FINISHED'}
class DS_TF(bpy.types.Panel):
bl_idname = "DS_T"
bl_label = "TRUE"
def execute(self,context):
n=0
for n in range(len(bpy.data.objects)):
if(bpy.data.objects[n].type=="MESH"):
bpy.data.objects[n].data.show_double_sided=True
return {'FINISHED'}
def register():
bpy.utils.register_class( DS_Panel )
bpy.utils.register_class(DS_FF)
bpy.utils.register_class(DS_TF)
if __name__ == "__main__":
register()
I used 3 class. Functions are in 2 class.
Id is different that class name
Error is in line
row.operator("DS_TF")
row.operator("DS_T")
I do not know why it doesn’t work. Maybe someone know what is wrong…Thanks for any reply:)
should be
col = layout.column(align=True) # True instead of 1
these operators probably don’t exist, if their bl_idname was e.g. “mesh.ds_tf”, then you’d have to do:
row.operator(“mesh.ds_tf”)
row.operator(“mesh.ds_t”)