def draw(self, context): addon = context.preferences.addons.get(sverchok.__name__) col = self.layout.column() col_start_profiling = col.column() col_start_profiling.active = addon.preferences.profile_mode != "NONE" if profile.is_currently_enabled: col_start_profiling.operator("node.sverchok_profile_toggle", text="Stop profiling", icon="CANCEL") else: col_start_profiling.operator("node.sverchok_profile_toggle", text="Start profiling", icon="TIME") col_save = col.column() col_save.active = profile.have_gathered_stats() col_save.operator("node.sverchok_profile_dump", text="Dump data", icon="TEXT") col_save.operator("node.sverchok_profile_save", text="Save data", icon="FILE_TICK") col_save.operator("node.sverchok_profile_reset", text="Reset data", icon="X")
def draw_profiling_info_if_needed(self, layout, addon): if addon.preferences.profile_mode != "NONE": profile_col = layout.column(align=True) if profile.is_currently_enabled: profile_col.operator("node.sverchok_profile_toggle", text="Stop profiling", icon="CANCEL") else: profile_col.operator("node.sverchok_profile_toggle", text="Start profiling", icon="TIME") if profile.have_gathered_stats(): row = profile_col.row(align=True) row.operator("node.sverchok_profile_dump", text="Dump data", icon="TEXT") row.operator("node.sverchok_profile_save", text="Save data", icon="FILE_TICK") profile_col.operator("node.sverchok_profile_reset", text="Reset data", icon="X")
def draw(self, context): ng_name = context.space_data.node_tree.name layout = self.layout # layout.scale_y=1.1 layout.active = True addon = context.user_preferences.addons.get(sverchok.__name__) if addon.preferences.profile_mode != "NONE": profile_col = layout.column(align=True) if profile.is_currently_enabled: profile_col.operator("node.sverchok_profile_toggle", text="Stop profiling", icon="CANCEL") else: profile_col.operator("node.sverchok_profile_toggle", text="Start profiling", icon="TIME") if profile.have_gathered_stats(): row = profile_col.row(align=True) row.operator("node.sverchok_profile_dump", text="Dump data", icon="TEXT") row.operator("node.sverchok_profile_save", text="Save data", icon="SAVE_AS") profile_col.operator("node.sverchok_profile_reset", text="Reset data", icon="X") row = layout.row(align=True) col = row.column(align=True) col.scale_y = 3.0 col.scale_x = 0.5 u = "Update all" col.operator("node.sverchok_update_all", text=u) col = row.column(align=True) col.scale_y = 3.0 u = "Update {0}".format(ng_name) op = col.operator("node.sverchok_update_current", text=u) op.node_group = ng_name box = layout.box() little_width = 0.12 col = box.column(align=True) row = col.row(align=True) row.label(text='Layout') col0 = row.column(align=True) col0.scale_x = little_width col0.label(text='B') col1 = row.column(align=True) col1.scale_x = little_width col1.label(icon='RESTRICT_VIEW_OFF', text=' ') col2 = row.column(align=True) col2.scale_x = little_width col2.label(icon='ANIM', text=' ') col3 = row.column(align=True) col3.scale_x = little_width col3.label(text='P') col3 = row.column(align=True) col3.scale_x = little_width col3.label(text='F') for name, tree in bpy.data.node_groups.items(): if tree.bl_idname == 'SverchCustomTreeType': row = col.row(align=True) # tree name if name == ng_name: row.label(text=name) else: row.operator('node.sv_switch_layout', text=name).layout_name = name # bakery split = row.column(align=True) split.scale_x = little_width baka = split.operator('node.sverchok_bake_all', text='B') baka.node_tree_name = name # eye split = row.column(align=True) split.scale_x = little_width view_icon = 'RESTRICT_VIEW_' + ('OFF' if tree.sv_show else 'ON') split.prop(tree, 'sv_show', icon=view_icon, text=' ') split = row.column(align=True) split.scale_x = little_width # animate_icon = ('UN' if tree.sv_animate else '') + 'LOCKED' split.prop(tree, 'sv_animate', icon='ANIM', text=' ') split = row.column(align=True) split.scale_x = little_width split.prop(tree, "sv_process", toggle=True, text="P") split = row.column(align=True) split.scale_x = little_width split.prop(tree, 'use_fake_user', toggle=True, text='F') if context.scene.sv_new_version: row = layout.row() row.alert = True row.operator("node.sverchok_update_addon", text='Upgrade Sverchok addon') else: sha_update = "node.sverchok_check_for_upgrades_wsha" layout.row().operator(sha_update, text='Check for updates') layout.row().operator('node.sv_show_latest_commits')
def draw(self, context): ng_name = context.space_data.node_tree.name layout = self.layout # layout.scale_y=1.1 layout.active = True addon = context.user_preferences.addons.get(sverchok.__name__) if addon.preferences.profile_mode != "NONE": profile_col = layout.column(align=True) if profile.is_currently_enabled: profile_col.operator("node.sverchok_profile_toggle", text="Stop profiling", icon="CANCEL") else: profile_col.operator("node.sverchok_profile_toggle", text="Start profiling", icon="TIME") if profile.have_gathered_stats(): row = profile_col.row(align=True) row.operator("node.sverchok_profile_dump", text="Dump data", icon="TEXT") row.operator("node.sverchok_profile_save", text="Save data", icon="SAVE_AS") profile_col.operator("node.sverchok_profile_reset", text="Reset data", icon="X") row = layout.row(align=True) col = row.column(align=True) col.scale_y = 3.0 col.scale_x = 0.5 u = "Update all" col.operator("node.sverchok_update_all", text=u) col = row.column(align=True) col.scale_y = 3.0 u = "Update {0}".format(ng_name) op = col.operator("node.sverchok_update_current", text=u) op.node_group = ng_name box = layout.box() little_width = 0.12 col = box.column(align=True) row = col.row(align=True) row.label(text='Layout') col0 = row.column(align=True) col0.scale_x = little_width col0.label(text='B') col1 = row.column(align=True) col1.scale_x = little_width col1.label(icon='RESTRICT_VIEW_OFF', text=' ') col2 = row.column(align=True) col2.scale_x = little_width col2.label(icon='ANIM', text=' ') col3 = row.column(align=True) col3.scale_x = little_width col3.label(text='P') col3 = row.column(align=True) col3.scale_x = little_width col3.label(text='F') for name, tree in bpy.data.node_groups.items(): if tree.bl_idname == 'SverchCustomTreeType': row = col.row(align=True) # tree name if name == ng_name: row.label(text=name) else: row.operator('node.sv_switch_layout', text=name).layout_name = name # bakery split = row.column(align=True) split.scale_x = little_width baka = split.operator('node.sverchok_bake_all', text='B') baka.node_tree_name = name # eye split = row.column(align=True) split.scale_x = little_width view_icon = 'RESTRICT_VIEW_' + ('OFF' if tree.sv_show else 'ON') split.prop(tree, 'sv_show', icon=view_icon, text=' ') split = row.column(align=True) split.scale_x = little_width # animate_icon = ('UN' if tree.sv_animate else '') + 'LOCKED' split.prop(tree, 'sv_animate', icon='ANIM', text=' ') split = row.column(align=True) split.scale_x = little_width split.prop(tree, "sv_process", toggle=True, text="P") split = row.column(align=True) split.scale_x = little_width split.prop(tree, 'use_fake_user', toggle=True, text='F') if context.scene.sv_new_version: row = layout.row() row.alert = True row.operator( "node.sverchok_update_addon", text='Upgrade Sverchok addon') else: sha_update = "node.sverchok_check_for_upgrades_wsha" layout.row().operator(sha_update, text='Check for updates') layout.row().operator('node.sv_show_latest_commits')