Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_modifier.py
| Show All 12 Lines | |||||
| # You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||
| # along with this program; if not, write to the Free Software Foundation, | # along with this program; if not, write to the Free Software Foundation, | ||||
| # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| # | # | ||||
| # ##### END GPL LICENSE BLOCK ##### | # ##### END GPL LICENSE BLOCK ##### | ||||
| # <pep8 compliant> | # <pep8 compliant> | ||||
| import bpy | import bpy | ||||
| from bpy.types import Panel | from bpy.types import Panel, UIList | ||||
| from bpy.app.translations import pgettext_iface as iface_ | from bpy.app.translations import pgettext_iface as iface_ | ||||
| class ModifierButtonsPanel(): | class ModifierButtonsPanel(): | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "modifier" | bl_context = "modifier" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| class DATA_UL_level_set_filters(UIList): | |||||
| def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): | |||||
| if self.layout_type in {'DEFAULT', 'COMPACT'}: | |||||
| layout.prop(item, "name", text="", emboss=False, icon_value=icon) | |||||
| layout.prop(item, "mute", text="", emboss=False) | |||||
| elif self.layout_type in {'GRID'}: | |||||
| layout.alignment = 'CENTER' | |||||
| layout.label(text="", icon_value=icon) | |||||
| class DATA_PT_modifiers(ModifierButtonsPanel, Panel): | class DATA_PT_modifiers(ModifierButtonsPanel, Panel): | ||||
| bl_label = "Modifiers" | bl_label = "Modifiers" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ob = context.object | ob = context.object | ||||
| ▲ Show 20 Lines • Show All 1,295 Lines • ▼ Show 20 Lines | def DATA_TRANSFER(self, layout, ob, md): | ||||
| row.active = bool(md.object) | row.active = bool(md.object) | ||||
| row.operator("object.datalayout_transfer", text="Generate Data Layers") | row.operator("object.datalayout_transfer", text="Generate Data Layers") | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") | row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") | ||||
| sub = row.row(align=True) | sub = row.row(align=True) | ||||
| sub.active = bool(md.vertex_group) | sub.active = bool(md.vertex_group) | ||||
| sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT') | sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT') | ||||
| def PARTICLE_MESHER(self, layout, ob, md): | |||||
| row = layout.row() | |||||
| row.label(text="Particle System:") | |||||
| row.prop_search(md, "particle_system", ob, "particle_systems", text="") | |||||
| layout.separator() | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.prop(md, "voxel_size") | |||||
| col.prop(md, "half_width") | |||||
| col.prop(md, "part_scale_factor") | |||||
| col.prop(md, "min_part_radius") | |||||
| col = split.column() | |||||
| sub = col.row() | |||||
| subsub = sub.column() | |||||
| subsub.active = md.generate_trails | |||||
| subsub.prop(md, "generate_trails") | |||||
| subsub.prop(md, "trail_size") | |||||
| subsub.prop(md, "part_vel_factor") | |||||
| sub = col.row() | |||||
| subsub = sub.column() | |||||
| subsub.active = md.generate_mask | |||||
| subsub.prop(md, "generate_mask") | |||||
| subsub.prop(md, "mask_width") | |||||
| layout.separator() | |||||
| row = layout.row() | |||||
| row.label(text="Mesher Options:") | |||||
| row = layout.row() | |||||
| row.prop(md, "adaptivity") | |||||
| row.prop(md, "isovalue") | |||||
| row = layout.row() | |||||
| row.label(text="Mask Object:") | |||||
| row.prop(md, "invert_mask") | |||||
| row = layout.row() | |||||
| row.prop(md, "object", text="") | |||||
| row.prop(md, "mask_offset") | |||||
| row = layout.row() | |||||
| row.prop(md, "ext_band") | |||||
| row.prop(md, "int_band") | |||||
| layout.separator() | |||||
| row = layout.row() | |||||
| row.label(text="Level Set Filters:") | |||||
| row = layout.row() | |||||
| row.template_list("DATA_UL_level_set_filters", "levelset_filter_items", md, "filter", | |||||
| md, "active_levelset_filter_index", rows=3) | |||||
| col = row.column() | |||||
| sub = col.row() | |||||
| subsub = sub.column(align=True) | |||||
| subsub.operator("object.levelset_filter_add", icon='ZOOMIN', text="") | |||||
| subsub.operator("object.levelset_filter_remove", icon='ZOOMOUT', text="") | |||||
| sub = col.row() | |||||
| subsub = sub.column(align=True) | |||||
| subsub.operator("object.levelset_filter_move", | |||||
| icon='MOVE_UP_VEC', text="").direction = 'UP' | |||||
| subsub.operator("object.levelset_filter_move", | |||||
| icon='MOVE_DOWN_VEC', text="").direction = 'DOWN' | |||||
| filter = md.active_levelset_filter | |||||
| if filter: | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.label(text="Type:") | |||||
| col.prop(filter, "type", text="") | |||||
| col.label(text="Accuracy:") | |||||
| col.prop(filter, "accuracy", text="") | |||||
| col = split.column() | |||||
| col.label(text="Settings:") | |||||
| col.prop(filter, "iterations") | |||||
| if filter.type in {'MEDIAN', 'MEAN', 'GAUSSIAN'}: | |||||
| col.prop(filter, "width") | |||||
| if filter.type in {'OFFSET'}: | |||||
| col.prop(filter, "offset") | |||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| bpy.utils.register_module(__name__) | bpy.utils.register_module(__name__) | ||||