[Bf-blender-cvs] [9b099c86123] master: UI: Drag and Drop Modifiers, Layout Updates

Hans Goudey noreply at git.blender.org
Fri Jun 5 16:41:27 CEST 2020


Commit: 9b099c86123fc828a194c59ce5b8bbf5a56f9cdb
Author: Hans Goudey
Date:   Fri Jun 5 10:41:03 2020 -0400
Branches: master
https://developer.blender.org/rB9b099c86123fc828a194c59ce5b8bbf5a56f9cdb

UI: Drag and Drop Modifiers, Layout Updates

This patch implements the list panel system D7490 for modifiers.
It also moves modifier drawing to a callback in ModifierTypeInfo
in line with the extensible architecture refactoring goal T75724.

This adds a PanelRegister callback and utilities for registering
panels and subpanels. It also adds the callbacks for expansion saving
and drag and drop reordering described in D7490.

These utilities, callbacks, and other common UI elements shared
between modifiers live in MOD_ui_common.c.

Because modifier buttons are now in panels, we can make use of
subpanels for organization. The UI layouts also use the single
column layout style consistently used elsewhere in Blender.
Additionally, the mode-setting buttons are aligned and ordered
consistently with the outliner.

However, the large number of UI changes in this patch may mean
that additional polishing is required in master.

Thanks to William Reynish (@billreynish) who did a fair amount of the
layout work and to Julian Eisel (@Severin) for consistent help.

Differential Revision: https://developer.blender.org/D7498

===================================================================

M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/blenkernel/BKE_modifier.h
M	source/blender/blenkernel/intern/modifier.c
M	source/blender/blenloader/intern/versioning_290.c
M	source/blender/editors/include/ED_object.h
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/object/object_intern.h
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/object/object_ops.c
M	source/blender/editors/space_buttons/space_buttons.c
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_ui_api.c
M	source/blender/modifiers/CMakeLists.txt
M	source/blender/modifiers/intern/MOD_armature.c
M	source/blender/modifiers/intern/MOD_array.c
M	source/blender/modifiers/intern/MOD_bevel.c
M	source/blender/modifiers/intern/MOD_boolean.c
M	source/blender/modifiers/intern/MOD_build.c
M	source/blender/modifiers/intern/MOD_cast.c
M	source/blender/modifiers/intern/MOD_cloth.c
M	source/blender/modifiers/intern/MOD_collision.c
M	source/blender/modifiers/intern/MOD_correctivesmooth.c
M	source/blender/modifiers/intern/MOD_curve.c
M	source/blender/modifiers/intern/MOD_datatransfer.c
M	source/blender/modifiers/intern/MOD_decimate.c
M	source/blender/modifiers/intern/MOD_displace.c
M	source/blender/modifiers/intern/MOD_dynamicpaint.c
M	source/blender/modifiers/intern/MOD_edgesplit.c
M	source/blender/modifiers/intern/MOD_explode.c
M	source/blender/modifiers/intern/MOD_fluid.c
M	source/blender/modifiers/intern/MOD_hook.c
M	source/blender/modifiers/intern/MOD_laplaciandeform.c
M	source/blender/modifiers/intern/MOD_laplaciansmooth.c
M	source/blender/modifiers/intern/MOD_lattice.c
M	source/blender/modifiers/intern/MOD_mask.cc
M	source/blender/modifiers/intern/MOD_meshcache.c
M	source/blender/modifiers/intern/MOD_meshdeform.c
M	source/blender/modifiers/intern/MOD_meshsequencecache.c
M	source/blender/modifiers/intern/MOD_mirror.c
M	source/blender/modifiers/intern/MOD_multires.c
M	source/blender/modifiers/intern/MOD_normal_edit.c
M	source/blender/modifiers/intern/MOD_ocean.c
M	source/blender/modifiers/intern/MOD_particleinstance.c
M	source/blender/modifiers/intern/MOD_particlesystem.c
M	source/blender/modifiers/intern/MOD_remesh.c
M	source/blender/modifiers/intern/MOD_screw.c
M	source/blender/modifiers/intern/MOD_shapekey.c
M	source/blender/modifiers/intern/MOD_shrinkwrap.c
M	source/blender/modifiers/intern/MOD_simpledeform.c
M	source/blender/modifiers/intern/MOD_simulation.cc
M	source/blender/modifiers/intern/MOD_skin.c
M	source/blender/modifiers/intern/MOD_smooth.c
M	source/blender/modifiers/intern/MOD_softbody.c
M	source/blender/modifiers/intern/MOD_solidify.c
M	source/blender/modifiers/intern/MOD_subsurf.c
M	source/blender/modifiers/intern/MOD_surface.c
M	source/blender/modifiers/intern/MOD_surfacedeform.c
M	source/blender/modifiers/intern/MOD_triangulate.c
A	source/blender/modifiers/intern/MOD_ui_common.c
A	source/blender/modifiers/intern/MOD_ui_common.h
M	source/blender/modifiers/intern/MOD_uvproject.c
M	source/blender/modifiers/intern/MOD_uvwarp.c
M	source/blender/modifiers/intern/MOD_warp.c
M	source/blender/modifiers/intern/MOD_wave.c
M	source/blender/modifiers/intern/MOD_weighted_normal.c
M	source/blender/modifiers/intern/MOD_weightvg_util.c
M	source/blender/modifiers/intern/MOD_weightvg_util.h
M	source/blender/modifiers/intern/MOD_weightvgedit.c
M	source/blender/modifiers/intern/MOD_weightvgmix.c
M	source/blender/modifiers/intern/MOD_weightvgproximity.c
M	source/blender/modifiers/intern/MOD_weld.c
M	source/blender/modifiers/intern/MOD_wireframe.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index d58dec211be..e7536838199 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -39,1809 +39,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
-
-        ob = context.object
-
         layout.operator_menu_enum("object.modifier_add", "type")
-
-        for md in ob.modifiers:
-            box = layout.template_modifier(md)
-            if box:
-                # match enum type to our functions, avoids a lookup table.
-                getattr(self, md.type)(box, ob, md)
-
-    # the mt.type enum is (ab)used for a lookup on function names
-    # ...to avoid lengthy if statements
-    # so each type must have a function here.
-
-    def ARMATURE(self, layout, ob, md):
-        split = layout.split()
-
-        col = split.column()
-        col.label(text="Object:")
-        col.prop(md, "object", text="")
-        col.prop(md, "use_deform_preserve_volume")
-
-        col = split.column()
-        col.label(text="Bind To:")
-        col.prop(md, "use_vertex_groups", text="Vertex Groups")
-        col.prop(md, "use_bone_envelopes", text="Bone Envelopes")
-
-        layout.separator()
-
-        split = layout.split()
-
-        row = split.row(align=True)
-        row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
-        sub = row.row(align=True)
-        sub.active = bool(md.vertex_group)
-        sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
-
-        split.prop(md, "use_multi_modifier")
-
-    def ARRAY(self, layout, _ob, md):
-        layout.prop(md, "fit_type")
-
-        if md.fit_type == 'FIXED_COUNT':
-            layout.prop(md, "count")
-        elif md.fit_type == 'FIT_LENGTH':
-            layout.prop(md, "fit_length")
-        elif md.fit_type == 'FIT_CURVE':
-            layout.prop(md, "curve")
-
-        layout.separator()
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(md, "use_constant_offset")
-        sub = col.column()
-        sub.active = md.use_constant_offset
-        sub.prop(md, "constant_offset_displace", text="")
-
-        col.separator()
-
-        col.prop(md, "use_merge_vertices", text="Merge")
-        sub = col.column()
-        sub.active = md.use_merge_vertices
-        sub.prop(md, "use_merge_vertices_cap", text="First Last")
-        sub.prop(md, "merge_threshold", text="Distance")
-
-        col = split.column()
-        col.prop(md, "use_relative_offset")
-        sub = col.column()
-        sub.active = md.use_relative_offset
-        sub.prop(md, "relative_offset_displace", text="")
-
-        col.separator()
-
-        col.prop(md, "use_object_offset")
-        sub = col.column()
-        sub.active = md.use_object_offset
-        sub.prop(md, "offset_object", text="")
-
-        row = layout.row()
-        split = row.split()
-        col = split.column()
-        col.label(text="UVs:")
-        sub = col.column(align=True)
-        sub.prop(md, "offset_u")
-        sub.prop(md, "offset_v")
-        layout.separator()
-
-        layout.prop(md, "start_cap")
-        layout.prop(md, "end_cap")
-
-    def BEVEL(self, layout, ob, md):
-        offset_type = md.offset_type
-        if offset_type == 'PERCENT':
-            layout.prop(md, "width_pct")
-        else:
-            offset_text = "Width"
-            if offset_type == 'DEPTH':
-                offset_text = "Depth"
-            elif offset_type == 'OFFSET':
-                offset_text = "Offset"
-            layout.prop(md, "width", text=offset_text)
-        layout.row().prop(md, "offset_type", expand=True)
-
-        split = layout.split()
-        col = split.column()
-        col.prop(md, "use_only_vertices")
-        col.prop(md, "use_clamp_overlap")
-        col.prop(md, "loop_slide")
-        col = split.column()
-        col.prop(md, "mark_seam")
-        col.prop(md, "mark_sharp")
-        col.prop(md, "harden_normals")
-
-        layout.row().prop(md, "segments")
-        layout.row().prop(md, "profile")
-        layout.row().prop(md, "material")
-
-        layout.label(text="Miter Type:")
-        layout.row().prop(md, "miter_outer", text="Outer")
-        layout.row().prop(md, "miter_inner", text="Inner")
-        if md.miter_inner in {'MITER_PATCH', 'MITER_ARC'}:
-            layout.row().prop(md, "spread")
-
-        layout.label(text="Limit Method:")
-        layout.row().prop(md, "limit_method", expand=True)
-        if md.limit_method == 'ANGLE':
-            layout.prop(md, "angle_limit")
-        elif md.limit_method == 'VGROUP':
-            row = layout.row(align=True)
-            row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
-            row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
-
-        layout.label(text="Face Strength Mode:")
-        layout.row().prop(md, "face_strength_mode", expand=True)
-
-        layout.label(text="Intersection Type:")
-        layout.row().prop(md, "vmesh_method", expand=True)
-        layout.row().prop(md, "use_custom_profile")
-        row = layout.row()
-        row.enabled = md.use_custom_profile
-        if md.use_custom_profile:
-            layout.template_curveprofile(md, "custom_profile")
-
-    def BOOLEAN(self, layout, _ob, md):
-        split = layout.split()
-
-        col = split.column()
-        col.label(text="Operation:")
-        col.prop(md, "operation", text="")
-
-        col = split.column()
-        col.label(text="Object:")
-        col.prop(md, "object", text="")
-
-        layout.prop(md, "double_threshold")
-
-        if bpy.app.debug:
-            layout.prop(md, "debug_options")
-
-    def BUILD(self, layout, _ob, md):
-        split = layout.split()
-
-        col = split.column()
-        col.prop(md, "frame_start")
-        col.prop(md, "frame_duration")
-        col.prop(md, "use_reverse")
-
-        col = split.column()
-        col.prop(md, "use_random_order")
-        sub = col.column()
-        sub.active = md.use_random_order
-        sub.prop(md, "seed")
-
-    def MESH_CACHE(self, layout, _ob, md):
-        layout.prop(md, "cache_format")
-        layout.prop(md, "filepath")
-
-        if md.cache_format == 'ABC':
-            layout.prop(md, "sub_object")
-
-        layout.label(text="Evaluation:")
-        layout.prop(md, "factor", slider=True)
-        layout.prop(md, "deform_mode")
-        layout.prop(md, "interpolation")
-
-        layout.label(text="Time Mapping:")
-
-        row = layout.row()
-        row.prop(md, "time_mode", expand=True)
-        row = layout.row()
-        row.prop(md, "play_mode", expand=True)
-        if md.play_mode == 'SCENE':
-            layout.prop(md, "frame_start")
-            layout.prop(md, "frame_scale")
-        else:
-            time_mode = md.time_mode
-            if time_mode == 'FRAME':
-                layout.prop(md, "eval_frame")
-            elif time_mode == 'TIME':
-                layout.prop(md, "eval_time")
-            elif time_mode == 'FACTOR':
-                layout.prop(md, "eval_factor")
-
-        layout.label(text="Axis Mapping:")
-        split = layout.split(factor=0.5, align=True)
-        split.alert = (md.forward_axis[-1] == md.up_axis[-1])
-        split.label(text="Forward/Up Axis:")
-        split.prop(md, "forward_axis", text="")
-        split.prop(md, "up_axis", text="")
-        split = layout.split(factor=0.5)
-        split.label(text="Flip Axis:")
-        row = split.row()
-        row.prop(md, "flip_axis")
-
-    def MESH_SEQUENCE_CACHE(self, layout, ob, md):
-        layout.label(text="Cache File Properties:")
-        box = layout.box()
-        box.template_cache_file(md, "cache_file")
-
-        cache_file = md.cache_file
-
-        layout.label(text="Modifier Properties:")
-        box = layout.box()
-
-        if cache_file is not None:
-            box.prop_search(md, "object_path", cache_file, "object_paths")
-
-        if ob.type == 'MESH':
-            box.row().prop(md, "read_data")
-
-    def CAST(self, layout, ob, md):
-        split = layout.split(factor=0.25)
-
-        split.label(text="Cast Type:")
-        split.prop(md, "cast_type", text="")
-
-        split = layout.split(factor=0.25)
-
-        col = split.column()
-        col.prop(md, "use_x")
-        col.prop(md, "use_y")
-        col.prop(md, "use_z")
-
-        col = split.column()
-        col.prop(md, "factor")
-        col.prop(md, "radius")
-        col.prop(md, "size")
-        col.prop(md, "use_radius_as_size")
-
-        split = layout.split()
-
-        col = split.column()
-        col.label(text="Vertex Group:")
-        row = col.row(align=True)
-        row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
-        row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
-        col = split.column()
-        col.label(text="Control Object:")
-        col.prop(md, "object", text="")
-        if md.object:
-            col.prop(md, "use_transform")
-
-    def CLOTH(self, layout, _ob, _md):
-        layout.label(text="Settings are inside the Physics tab")
-
-    def COLLISION(self, layout, _ob, _md):
-        layout.label(text="Settings are inside the Physics tab")
-
-    def CURVE(self, layout, ob, md):
-        split = layout.split()
-
-        col = split.column()
-        col.label(text="Object:")
-        col.prop(md, "object", text="")
-        col = split.column()
-        col.label(text="Vertex Group:")
-        row = col.row(align=True)
-        row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
-        row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
-        layout.label(text="Deformation Axis:")
-        layout.row().prop(md, "deform_axis", expand=True)
-
-    def DECIMATE(self, layout, ob, md):
-        decimate_type = md.decimate_type
-
-        row = layout.row()
-        row.prop(md, "decimate_type", expand=True)
-
-        if decimate_type == 'COLLAPSE':
-            has_vgroup = bool(md.vertex_group)
- 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list