[Bf-blender-cvs] [de3ee9f7bbe] experimental-build: Merged changes from soc-2017-vertex_paint

Howard Trickey noreply at git.blender.org
Mon Jul 24 15:07:09 CEST 2017


Commit: de3ee9f7bbedc246df67874ef6a48440ff24d8db
Author: Howard Trickey
Date:   Mon Jul 24 09:02:38 2017 -0400
Branches: experimental-build
https://developer.blender.org/rBde3ee9f7bbedc246df67874ef6a48440ff24d8db

Merged changes from soc-2017-vertex_paint

commit 90e0c31c72d351d10044bc3579c23497b2fd51ec
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sat Jul 22 15:41:36 2017 +0530

    added the color lock in vertex paint

commit 076b351b2c805d153c242c58fdf61aaffa9338e4
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Thu Jul 20 19:46:12 2017 +0530

     now alpha blends same as the rgb colors

commit 4ed7bc28930fc3765be57737936bb4a15f0b9840
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Tue Jul 18 23:41:56 2017 +0530

    modified the ply importer to take alpha in vpaint

commit b36f866799f843156e4f1deb86e3a6f1c07f9989
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Tue Jul 18 13:21:22 2017 +0530

    removed the traces of printf() which was slowing the painting

commit 986018165b4b32ee382d16ad3e1af5399d76acb7
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Fri Jul 14 14:09:45 2017 +0530

    now alpha effect can be seen in 3d view in vpaint

commit fa889d2ad9321213b6a9519830fef46c070b1ab5
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Thu Jul 13 10:31:50 2017 +0530

    added alpha support to the collada exporter for vpaint

commit 5acf2e1a95b75da0eccbb94e1fc7e18074341b0c
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Wed Jul 12 12:34:17 2017 +0530

     added the addons to script folder, alpha supprt for fbx and oly

commit 97e46b5e1450bdb18b96a61a98fcf7248cd2d9ce
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sun Jul 9 13:53:15 2017 +0530

    added the alpha along with rgb in .ply exporter in vpaint

commit e486461f23d1eacf009a097c890181304428edee
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sat Jul 8 00:39:24 2017 +0530

     added the alpha channel in vpaint a slider and change in ply exporter

commit db3441c8c5c6526162bc850d3514c86e3b27ebdd
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sat Jul 1 12:29:50 2017 +0530

    finalised 1 = white and 0 = black for weight to vertex converter

commit bf6338c48184e528880e48043964ae7b4189ae57
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Fri Jun 30 16:25:08 2017 +0530

     added the weight to paint converter as option in paint in verte xpainting and weight in weight painting

commit 1a77b5fe7b68bc17cdbc0ff290018b2409fd211d
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Thu Jun 29 14:34:12 2017 +0530

    removed the redundant code

commit 28e4e9b0247e001d10e90f5ed5f3be0866e6e9c6
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Thu Jun 29 14:03:51 2017 +0530

     added weight to vertex paint converter

commit 88936370487d2ca83dfd80bd49f931734aa0cf1c
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Tue Jun 27 10:16:33 2017 +0530

    fixed a bug for vertex mask selection

commit 444ad728cd4df291bd19b814f390f6977ee3ddb6
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sat Jun 24 00:33:33 2017 +0530

     added non-occluded mode for the weight painting

commit 39a2294d38b0e740dbef47b423b78141d5a6d5a0
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Thu Jun 22 15:55:08 2017 +0530

    added the non-occluded mode

commit 72533b087acc69ae1f4fa6ec750ca50979ae278f
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Tue Jun 13 14:04:55 2017 +0530

    added vertex mask feature

commit b7532023812b9f3855f74a9da6f3b8986605f3a3
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sun Jun 11 18:32:04 2017 +0530

    added accumulate option

commit a03922f02347a0d16a6580f38fdb7dc76b887f53
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sat Jun 10 14:13:31 2017 +0530

    corrected typo mistake in difference blend mode

commit 3138c32878e5b75fc92a79ef331f046b87e2dd8b
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sun Jun 4 22:57:59 2017 +0530

    added softlight,exclusion,luminocity,saturtion,hue blend modes

commit b72aff483fbe6ce84dab9b5a23f6ca6f0c96988c
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Sat Jun 3 10:21:09 2017 +0530

    added Color Dodge, Difference, Screen, Hardlight, Overlay blend modes

commit 29645a58384273512560c6b27eb1c979ea514682
Author: Darshan Kadu <darsh7807 at gmail.com>
Date:   Thu Jun 1 14:04:06 2017 +0530

    applied patch D2150.id8618.diff and fixed versioning_270.c

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

A	p1.orig
A	p1.rej
M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
A	release/scripts/startup/io_mesh_ply_soc/__init__.py
A	release/scripts/startup/io_mesh_ply_soc/export_ply_soc.py
A	release/scripts/startup/io_mesh_ply_soc/import_ply_soc.py
A	release/scripts/startup/io_scene_fbx_soc/__init__.py
A	release/scripts/startup/io_scene_fbx_soc/data_types.py
A	release/scripts/startup/io_scene_fbx_soc/encode_bin.py
A	release/scripts/startup/io_scene_fbx_soc/export_fbx_bin_soc.py
A	release/scripts/startup/io_scene_fbx_soc/export_fbx_soc.py
A	release/scripts/startup/io_scene_fbx_soc/fbx2json.py
A	release/scripts/startup/io_scene_fbx_soc/fbx_utils.py
A	release/scripts/startup/io_scene_fbx_soc/import_fbx_soc.py
A	release/scripts/startup/io_scene_fbx_soc/json2fbx.py
A	release/scripts/startup/io_scene_fbx_soc/parse_fbx.py
M	source/blender/blenkernel/BKE_paint.h
M	source/blender/blenkernel/BKE_pbvh.h
M	source/blender/blenkernel/intern/CCGSubSurf.c
M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/blenkernel/intern/cdderivedmesh.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/paint.c
M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/blenkernel/intern/pbvh_intern.h
M	source/blender/blenkernel/intern/subsurf_ccg.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/collada/GeometryExporter.cpp
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_intern.h
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/space_view3d/view3d_header.c
M	source/blender/gpu/intern/gpu_buffers.c
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_brush.c
M	source/blender/makesrna/intern/rna_mesh.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/tools
A	vpaint.txt
A	"\357\200\233OB\357\200\233OA"
A	"\357\200\233OB\357\200\233OA.pub"

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

diff --git a/p1.orig b/p1.orig
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/p1.rej b/p1.rej
new file mode 100644
index 00000000000..7461baad21d
--- /dev/null
+++ b/p1.rej
@@ -0,0 +1,3708 @@
+--- space_view3d_toolbar.py
++++ space_view3d_toolbar.py
+@@ -51,6 +51,19 @@ def draw_keyframing_tools(context, layout):
+     row.operator("anim.keyframe_delete_v3d", text="Remove")
+ 
+ 
++# Used by vertex & weight paint
++def draw_vpaint_symmetry(layout, vpaint):
++    col = layout.column(align=True)
++    col.label(text="Mirror:")
++    row = col.row(align=True)
++
++    row.prop(vpaint, "use_symmetry_x", text="X", toggle=True)
++    row.prop(vpaint, "use_symmetry_y", text="Y", toggle=True)
++    row.prop(vpaint, "use_symmetry_z", text="Z", toggle=True)
++
++    col = layout.column()
++    col.prop(vpaint, "radial_symmetry", text="Radial")
++
+ # ********** default tools for object-mode ****************
+ 
+ 
+@@ -1132,7 +1145,11 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
+             self.prop_unified_color_picker(col, context, brush, "color", value_slider=True)
+             if settings.palette:
+                 col.template_palette(settings, "palette", color=True)
+-            self.prop_unified_color(col, context, brush, "color", text="")
++            row = col.row(align=True)
++            self.prop_unified_color(row, context, brush, "color", text="")
++            self.prop_unified_color(row, context, brush, "secondary_color", text="")
++            row.separator()
++            row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="")
+ 
+             col.separator()
+             row = col.row(align=True)
+@@ -1713,6 +1730,19 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
+         props.data_type = 'VGROUP_WEIGHTS'
+ 
+ 
++class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
++    bl_category = "Tools"
++    bl_context = "weightpaint"
++    bl_options = {'DEFAULT_CLOSED'}
++    bl_label = "Symmetry"
++
++    def draw(self, context):
++        layout = self.layout
++        toolsettings = context.tool_settings
++        wpaint = toolsettings.weight_paint
++        draw_vpaint_symmetry(layout, wpaint)
++
++
+ class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
+     bl_category = "Options"
+     bl_context = "weightpaint"
+@@ -1775,6 +1805,20 @@ class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
+ #~         col.label(text="Multiply:")
+ #~         col.prop(vpaint, "mul", text="")
+ 
++
++class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel):
++    bl_category = "Tools"
++    bl_context = "vertexpaint"
++    bl_options = {'DEFAULT_CLOSED'}
++    bl_label = "Symmetry"
++
++    def draw(self, context):
++        layout = self.layout
++        toolsettings = context.tool_settings
++        vpaint = toolsettings.vertex_paint
++        draw_vpaint_symmetry(layout, vpaint)
++
++
+ # ********** default tools for texture-paint ****************
+ 
+ 
+@@ -2054,8 +2098,10 @@ classes = (
+     VIEW3D_PT_sculpt_symmetry,
+     VIEW3D_PT_tools_brush_appearance,
+     VIEW3D_PT_tools_weightpaint,
++    VIEW3D_PT_tools_weightpaint_symmetry,
+     VIEW3D_PT_tools_weightpaint_options,
+     VIEW3D_PT_tools_vertexpaint,
++    VIEW3D_PT_tools_vertexpaint_symmetry,
+     VIEW3D_PT_tools_imagepaint_external,
+     VIEW3D_PT_tools_imagepaint_symmetry,
+     VIEW3D_PT_tools_projectpaint,
+--- BKE_paint.h
++++ BKE_paint.h
+@@ -201,10 +201,30 @@ typedef struct SculptSession {
+ 
+ 	struct SculptStroke *stroke;
+ 	struct StrokeCache *cache;
++
++	union {
++		struct {
++			int *vert_map_mem;
++			struct MeshElemMap *vert_to_loop;
++			int *poly_map_mem;
++			struct MeshElemMap *vert_to_poly;
++
++			unsigned int (*total_color)[3];
++			double *total_weight;
++			unsigned int *tot_loops_hit;
++			float *max_weight;
++			unsigned int *previous_color;
++			bool building_vp_handle;
++		} vwpaint;
++		//struct {
++		//ToDo: identify sculpt-only fields
++		//} sculpt;
++	} modes;
+ } SculptSession;
+ 
+ void BKE_sculptsession_free(struct Object *ob);
+ void BKE_sculptsession_free_deformMats(struct SculptSession *ss);
++void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss);
+ void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder);
+ void BKE_sculptsession_bm_to_me_for_render(struct Object *object);
+ void BKE_sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob,
+--- BKE_pbvh.h
++++ BKE_pbvh.h
+@@ -32,6 +32,7 @@
+ 
+ struct CCGElem;
+ struct CCGKey;
++struct CCGDerivedMesh;
+ struct CustomData;
+ struct DMFlagMat;
+ struct MPoly;
+@@ -71,7 +72,7 @@ void BKE_pbvh_build_grids(PBVH *bvh, struct CCGElem **grid_elems,
+                           struct CCGKey *key, void **gridfaces, struct DMFlagMat *flagmats,
+                           unsigned int **grid_hidden);
+ void BKE_pbvh_build_bmesh(PBVH *bvh, struct BMesh *bm, bool smooth_shading, struct BMLog *log, const int cd_vert_node_offset, const int cd_face_node_offset);
+-
++void BKE_pbvh_add_ccgdm(PBVH *bvh, struct CCGDerivedMesh *ccgdm);
+ void BKE_pbvh_free(PBVH *bvh);
+ void BKE_pbvh_free_layer_disp(PBVH *bvh);
+ 
+@@ -118,6 +119,7 @@ void BKE_pbvh_raycast_project_ray_root(
+ void BKE_pbvh_node_draw(PBVHNode *node, void *data);
+ void BKE_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3],
+                    int (*setMaterial)(int matnr, void *attribs), bool wireframe, bool fast);
++void BKE_pbvh_draw_BB(PBVH *bvh);
+ 
+ /* PBVH Access */
+ typedef enum {
+@@ -141,6 +143,7 @@ int BKE_pbvh_count_grid_quads(BLI_bitmap **grid_hidden,
+ 
+ /* multires level, only valid for type == PBVH_GRIDS */
+ void BKE_pbvh_get_grid_key(const PBVH *pbvh, struct CCGKey *key);
++struct CCGDerivedMesh *BKE_pbvh_get_ccgdm(const PBVH *bvh);
+ 
+ /* Only valid for type == PBVH_BMESH */
+ struct BMesh *BKE_pbvh_get_bmesh(PBVH *pbvh);
+@@ -189,6 +192,7 @@ void BKE_pbvh_node_num_verts(
+ void BKE_pbvh_node_get_verts(
+         PBVH *bvh, PBVHNode *node,
+         const int **r_vert_indices, struct MVert **r_verts);
++void BKE_pbvh_get_num_nodes(const PBVH *bvh, int *r_totnode);
+ 
+ void BKE_pbvh_node_get_BB(PBVHNode *node, float bb_min[3], float bb_max[3]);
+ void BKE_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max[3]);
+--- CCGSubSurf.c
++++ CCGSubSurf.c
+@@ -1196,6 +1196,7 @@ int ccgSubSurf_getNumEdges(const CCGSubSurf *ss)
+ }
+ int ccgSubSurf_getNumFaces(const CCGSubSurf *ss)
+ {
++
+ 	return ss->fMap->numEntries;
+ }
+ 
+--- DerivedMesh.c
++++ DerivedMesh.c
+@@ -2641,7 +2641,7 @@ static void mesh_build_data(
+ 	ob->lastDataMask = dataMask;
+ 	ob->lastNeedMapping = need_mapping;
+ 
+-	if ((ob->mode & OB_MODE_SCULPT) && ob->sculpt) {
++	if ((ob->mode & OB_MODE_ALL_SCULPT) && ob->sculpt) {
+ 		/* create PBVH immediately (would be created on the fly too,
+ 		 * but this avoids waiting on first stroke) */
+ 
+--- cdderivedmesh.c
++++ cdderivedmesh.c
+@@ -660,6 +660,11 @@ static void cdDM_drawMappedFaces(
+ 
+ 	const int *index_mp_to_orig  = dm->getPolyDataArray(dm, CD_ORIGINDEX);
+ 
++	if (cddm->pbvh) {
++		if (G.debug_value == 14)
++			BKE_pbvh_draw_BB(cddm->pbvh);
++	}
++
+ 	/* fist, setup common buffers */
+ 	GPU_vertex_setup(dm);
+ 	GPU_triangle_setup(dm);
+--- object.c
++++ object.c
+@@ -2679,7 +2679,7 @@ void BKE_object_sculpt_modifiers_changed(Object *ob)
+ {
+ 	SculptSession *ss = ob->sculpt;
+ 
+-	if (ss) {
++	if (ss && ss->modes.vwpaint.building_vp_handle == false) {
+ 		if (!ss->cache) {
+ 			/* we free pbvh on changes, except during sculpt since it can't deal with
+ 			 * changing PVBH node organization, we hope topology does not change in
+@@ -2690,6 +2690,9 @@ void BKE_object_sculpt_modifiers_changed(Object *ob)
+ 			}
+ 
+ 			BKE_sculptsession_free_deformMats(ob->sculpt);
++
++			/* In vertex/weight paint, force maps to be rebuilt. */
++			BKE_sculptsession_free_vwpaint_data(ob->sculpt);
+ 		}
+ 		else {
+ 			PBVHNode **nodes;
+--- paint.c
++++ paint.c
+@@ -656,6 +656,22 @@ void BKE_sculptsession_free_deformMats(SculptSession *ss)
+ 	MEM_SAFE_FREE(ss->deform_imats);
+ }
+ 
++void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss)
++{
++	/* Free maps */
++	MEM_SAFE_FREE(ss->modes.vwpaint.vert_to_loop);
++	MEM_SAFE_FREE(ss->modes.vwpaint.vert_map_mem);
++	MEM_SAFE_FREE(ss->modes.vwpaint.vert_to_poly);
++	MEM_SAFE_FREE(ss->modes.vwpaint.poly_map_mem);
++
++	/* Free average, blur, and spray brush arrays */
++	MEM_SAFE_FREE(ss->modes.vwpaint.tot_loops_hit);
++	MEM_SAFE_FREE(ss->modes.vwpaint.total_color);
++	MEM_SAFE_FREE(ss->modes.vwpaint.total_weight);
++	MEM_SAFE_FREE(ss->modes.vwpaint.max_weight);
++	MEM_SAFE_FREE(ss->modes.vwpaint.previous_color);
++}
++
+ /* Write out the sculpt dynamic-topology BMesh to the Mesh */
+ static void sculptsession_bm_to_me_update_data_only(Object *ob, bool reorder)
+ {
+@@ -697,10 +713,7 @@ void BKE_sculptsession_bm_to_me_for_render(Object *object)
+ 			 */
+ 			BKE_object_free_derived_caches(object);
+ 
+-			if (object->sculpt->pbvh) {
+-				BKE_pbvh_free(object->sculpt->pbvh);
+-				object->sculpt->pbvh = NULL;
+-			}
++			MEM_SAFE_FREE(object->sculpt->pbvh);
+ 
+ 			sculptsession_bm_to_me_update_data_only(object, false);
+ 
+@@ -747,6 +760,8 @@ void BKE_sculptsession_free(Object *ob)
+ 		if (ss->deform_imats)
+ 			MEM_freeN(ss->deform_imats);
+ 
++		BKE_sculptsession_free_vwpaint_data(ob->sculpt);
++
+ 		MEM_freeN(ss);
+ 
+ 		ob->sculpt = NULL;
+@@ -831,6 +846,9 @@ void BKE_sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
+ 	ss->modifiers_active = sculpt_modifiers_active(scene, sd, ob);
+ 	ss->show_diffuse_color = (sd->flags & SCULPT_SHOW_DIFFUSE) != 0;
+ 
++	/* This flag prevents PBVH from being freed when creating the vp_handle for texture paint */
++	ss->modes.vwpaint.building_vp_handle = false;
++
+ 	if (need_mask) {
+ 		if (mmd == NULL) {
+ 			if (!CustomData_has_layer(&me->vdata, CD_PAINT_MASK)) {
+@@ -859,7 +877,8 @@ void BKE_sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
+ 
+ 	dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
+ 
+-	if (mmd) {
++	/* VWPaint require mesh info for loop lookup, so require sculpt mode here */
++	if (mmd && ob-

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list