[Bf-blender-cvs] [ab3b1aa3bf0] lanpr-under-gp: LineArt: Don't retain line art buffer result after modifier evaluation.
Commit: ab3b1aa3bf0e23c85c5577f3d1f12cc014fd014c Author: YimingWu Date: Tue Jul 28 13:44:10 2020 +0800 Branches: lanpr-under-gp https://developer.blender.org/rBab3b1aa3bf0e23c85c5577f3d1f12cc014fd014c LineArt: Don't retain line art buffer result after modifier evaluation. === M source/blender/editors/lineart/lineart_cpu.c === diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c index 31466c58976..e27c149fa54 100644 --- a/source/blender/editors/lineart/lineart_cpu.c +++ b/source/blender/editors/lineart/lineart_cpu.c @@ -3982,6 +3982,11 @@ void ED_lineart_post_frame_update_external(bContext *C, Scene *scene, Depsgraph else if (ED_lineart_modifier_sync_flag_check(LRT_SYNC_FRESH)) { /* At this stage GP should have all the data. We clear the flag */ ED_lineart_modifier_sync_flag_set(LRT_SYNC_IDLE, false); +/* Due to using GPencil modifiers, and the scene is updated each time some value is changed, we + * really don't need to keep the buffer any longer. If in the future we want fast refresh on + * parameter changes (e.g. thickness or picking different result in an already validated + * buffer), remove this call below. */ +ED_lineart_destroy_render_data_external(); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [20b39e4bd6a] lanpr-under-gp: LineArt: Memory allocation now dynamically stretch each pool for better efficiency and large model handling.
Commit: 20b39e4bd6ae85f30323c538efd612cb836b1eca Author: YimingWu Date: Tue Jul 28 12:14:42 2020 +0800 Branches: lanpr-under-gp https://developer.blender.org/rB20b39e4bd6ae85f30323c538efd612cb836b1eca LineArt: Memory allocation now dynamically stretch each pool for better efficiency and large model handling. === M source/blender/editors/include/ED_lineart.h M source/blender/editors/lineart/lineart_intern.h M source/blender/editors/lineart/lineart_util.c === diff --git a/source/blender/editors/include/ED_lineart.h b/source/blender/editors/include/ED_lineart.h index 17a82862bd2..38586ffbf20 100644 --- a/source/blender/editors/include/ED_lineart.h +++ b/source/blender/editors/include/ED_lineart.h @@ -41,12 +41,12 @@ typedef struct LineartStaticMemPoolNode { Link item; + int size; int used_byte; /* User memory starts here */ } LineartStaticMemPoolNode; typedef struct LineartStaticMemPool { - int each_size; ListBase pools; SpinLock lock_mem; } LineartStaticMemPool; @@ -318,9 +318,7 @@ typedef struct LineartSharedResource { #define DBL_EDGE_LIM 1e-9 #define LRT_MEMORY_POOL_1MB 1048576 -#define LRT_MEMORY_POOL_128MB 134217728 -#define LRT_MEMORY_POOL_256MB 268435456 -#define LRT_MEMORY_POOL_512MB 536870912 +#define LRT_MEMORY_POOL_64MB 67108864 typedef enum eLineartCullState { LRT_CULL_DONT_CARE = 0, diff --git a/source/blender/editors/lineart/lineart_intern.h b/source/blender/editors/lineart/lineart_intern.h index eb8d467996d..5f2ad5e3add 100644 --- a/source/blender/editors/lineart/lineart_intern.h +++ b/source/blender/editors/lineart/lineart_intern.h @@ -53,7 +53,7 @@ void *list_append_pointer_static_pool(struct LineartStaticMemPool *mph, ListBase void *list_pop_pointer_no_free(ListBase *h); void list_remove_pointer_item_no_free(ListBase *h, LinkData *lip); -LineartStaticMemPoolNode *mem_new_static_pool(struct LineartStaticMemPool *smp); +LineartStaticMemPoolNode *mem_new_static_pool(struct LineartStaticMemPool *smp, int size); void *mem_static_aquire(struct LineartStaticMemPool *smp, int size); void *mem_static_aquire_thread(struct LineartStaticMemPool *smp, int size); void *mem_static_destroy(LineartStaticMemPool *smp); diff --git a/source/blender/editors/lineart/lineart_util.c b/source/blender/editors/lineart/lineart_util.c index 1f7836cf6d0..799bd24a9b8 100644 --- a/source/blender/editors/lineart/lineart_util.c +++ b/source/blender/editors/lineart/lineart_util.c @@ -85,9 +85,15 @@ void list_remove_pointer_item_no_free(ListBase *h, LinkData *lip) BLI_remlink(h, (void *)lip); } -LineartStaticMemPoolNode *mem_new_static_pool(LineartStaticMemPool *smp) +LineartStaticMemPoolNode *mem_new_static_pool(LineartStaticMemPool *smp, int size) { - LineartStaticMemPoolNode *smpn = MEM_callocN(LRT_MEMORY_POOL_128MB, "mempool"); + int set_size = size; + if (set_size < LRT_MEMORY_POOL_64MB) { +set_size = LRT_MEMORY_POOL_64MB; /* Prevent too many small allocations. */ + } + int total_size = size + sizeof(LineartStaticMemPoolNode); + LineartStaticMemPoolNode *smpn = MEM_callocN(total_size, "mempool"); + smpn->size = total_size; smpn->used_byte = sizeof(LineartStaticMemPoolNode); BLI_addhead(>pools, smpn); return smpn; @@ -97,8 +103,8 @@ void *mem_static_aquire(LineartStaticMemPool *smp, int size) LineartStaticMemPoolNode *smpn = smp->pools.first; void *ret; - if (!smpn || (smpn->used_byte + size) > LRT_MEMORY_POOL_128MB) { -smpn = mem_new_static_pool(smp); + if (!smpn || (smpn->used_byte + size) > smpn->size) { +smpn = mem_new_static_pool(smp, size); } ret = ((unsigned char *)smpn) + smpn->used_byte; @@ -114,8 +120,8 @@ void *mem_static_aquire_thread(LineartStaticMemPool *smp, int size) BLI_spin_lock(>lock_mem); - if (!smpn || (smpn->used_byte + size) > LRT_MEMORY_POOL_128MB) { -smpn = mem_new_static_pool(smp); + if (!smpn || (smpn->used_byte + size) > smpn->size) { +smpn = mem_new_static_pool(smp, size); } ret = ((unsigned char *)smpn) + smpn->used_byte; @@ -135,8 +141,6 @@ void *mem_static_destroy(LineartStaticMemPool *smp) MEM_freeN(smpn); } - smp->each_size = 0; - return ret; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [29f160a7a86] lanpr-under-gp: LineArt: Don't allow frame number 0 to be baked.
Commit: 29f160a7a86680d44bd3ec28915429090256a1cc Author: YimingWu Date: Tue Jul 28 11:53:29 2020 +0800 Branches: lanpr-under-gp https://developer.blender.org/rB29f160a7a86680d44bd3ec28915429090256a1cc LineArt: Don't allow frame number 0 to be baked. === M source/blender/editors/lineart/lineart_cpu.c === diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c index ad155fa99f9..31466c58976 100644 --- a/source/blender/editors/lineart/lineart_cpu.c +++ b/source/blender/editors/lineart/lineart_cpu.c @@ -3807,7 +3807,7 @@ static int lineart_gpencil_bake_strokes_exec(bContext *C, wmOperator *UNUSED(op) Scene *scene = CTX_data_scene(C); Depsgraph *dg = CTX_data_depsgraph_pointer(C); int frame; - int frame_begin = scene->r.sfra; + int frame_begin = MAX2(scene->r.sfra, 1); int frame_end = scene->r.efra; int frame_total = frame_end - frame_begin; int frame_orig = scene->r.cfra; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5fc69361be5] lanpr-under-gp: LineArt: Ensure notification of line art gpencil objects when enable/disableing line art.
Commit: 5fc69361be52339f49ead4a036261c9993eaf375 Author: YimingWu Date: Tue Jul 28 11:49:15 2020 +0800 Branches: lanpr-under-gp https://developer.blender.org/rB5fc69361be52339f49ead4a036261c9993eaf375 LineArt: Ensure notification of line art gpencil objects when enable/disableing line art. === M source/blender/editors/lineart/lineart_cpu.c M source/blender/makesrna/intern/rna_scene.c === diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c index b44668d7b65..ad155fa99f9 100644 --- a/source/blender/editors/lineart/lineart_cpu.c +++ b/source/blender/editors/lineart/lineart_cpu.c @@ -3948,6 +3948,11 @@ void SCENE_OT_lineart_bake_strokes(wmOperatorType *ot) void ED_lineart_post_frame_update_external(bContext *C, Scene *scene, Depsgraph *dg) { if (!(scene->lineart.flags & LRT_AUTO_UPDATE)) { +/* This way the modifier will update, removing remaing strokes in the viewport. */ +if (ED_lineart_modifier_sync_flag_check(LRT_SYNC_WAITING)) { + ED_lineart_modifier_sync_flag_set(LRT_SYNC_IDLE, false); + lineart_gpencil_notify_targets(dg); +} return; } if (ED_lineart_modifier_sync_flag_check(LRT_SYNC_WAITING)) { diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 2719ffe6a83..08a42b76b24 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -7288,7 +7288,8 @@ static void rna_def_scene_lineart(BlenderRNA *brna) RNA_def_property_boolean_default(prop, 0); RNA_def_property_ui_text( prop, "Auto Update", "Automatically update Line Art cache when frame changes"); - RNA_def_property_update(prop, NC_SCENE, NULL); + /* Also use this update callback to trigger the modifier to clear the frame */ + RNA_def_property_update(prop, NC_SCENE, "rna_lineart_update"); prop = RNA_def_property(srna, "gpencil_overwrite", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", LRT_GPENCIL_OVERWRITE); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1c533861242] soc-2020-outliner: Merge branch 'master' into soc-2020-outliner
Commit: 1c5338612421e36f95f892edd8a2d8ab9c8aa4c4 Author: Nathan Craddock Date: Mon Jul 27 21:36:21 2020 -0600 Branches: soc-2020-outliner https://developer.blender.org/rB1c5338612421e36f95f892edd8a2d8ab9c8aa4c4 Merge branch 'master' into soc-2020-outliner === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [601ce87b1ad] soc-2020-outliner: Fix: Incorrect context menu after merge
Commit: 601ce87b1add9d27c2d50504b7123d47ed9c38c0 Author: Nathan Craddock Date: Mon Jul 27 21:38:24 2020 -0600 Branches: soc-2020-outliner https://developer.blender.org/rB601ce87b1add9d27c2d50504b7123d47ed9c38c0 Fix: Incorrect context menu after merge Accidentally resolved merge conflicts wrong. === M release/scripts/startup/bl_ui/space_outliner.py === diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index bc9b7d45c3d..fab639dd3ba 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -312,7 +312,7 @@ class OUTLINER_MT_object(Menu): layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK' layout.separator() -layout.operator("outliner.collection_new", text="New Collection").nested = True +layout.operator("outliner.collection_new", text="New Collection") layout.separator() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [289aac723a1] master: Merge branch 'blender-v2.90-release'
Commit: 289aac723a178724ca64d39eb2daac14344f7316 Author: Nathan Craddock Date: Mon Jul 27 21:17:03 2020 -0600 Branches: master https://developer.blender.org/rB289aac723a178724ca64d39eb2daac14344f7316 Merge branch 'blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ed19781a2a2] blender-v2.90-release: Fix T77951: Remove duplicate outliner menu entries
Commit: ed19781a2a286540c1f4939258e3d7e96e9ab18c Author: Nathan Craddock Date: Mon Jul 27 21:02:03 2020 -0600 Branches: blender-v2.90-release https://developer.blender.org/rBed19781a2a286540c1f4939258e3d7e96e9ab18c Fix T77951: Remove duplicate outliner menu entries Move the common entries (View and Area) into a static method to be called from other menus to avoid duplicating the New Collection and ID Paste operators. === M release/scripts/startup/bl_ui/space_outliner.py === diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index aa4d0b94b7f..5a54d4ca2d8 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -107,6 +107,14 @@ class OUTLINER_MT_editor_menus(Menu): class OUTLINER_MT_context_menu(Menu): bl_label = "Outliner Context Menu" +@staticmethod +def draw_common_operators(layout): +layout.menu("OUTLINER_MT_context_menu_view") + +layout.separator() + +layout.menu("INFO_MT_area") + def draw(self, context): space = context.space_data @@ -116,11 +124,7 @@ class OUTLINER_MT_context_menu(Menu): OUTLINER_MT_collection_new.draw_without_context_menu(context, layout) layout.separator() -layout.menu("OUTLINER_MT_context_menu_view") - -layout.separator() - -layout.menu("INFO_MT_area") +OUTLINER_MT_context_menu.draw_common_operators(layout) class OUTLINER_MT_context_menu_view(Menu): @@ -242,7 +246,7 @@ class OUTLINER_MT_collection(Menu): layout.separator() -OUTLINER_MT_context_menu.draw(self, context) +OUTLINER_MT_context_menu.draw_common_operators(layout) class OUTLINER_MT_collection_new(Menu): @@ -250,7 +254,7 @@ class OUTLINER_MT_collection_new(Menu): @staticmethod def draw_without_context_menu(context, layout): -layout.operator("outliner.collection_new", text="New Collection").nested = False +layout.operator("outliner.collection_new", text="New Collection").nested = True layout.operator("outliner.id_paste", text="Paste Data-Blocks", icon='PASTEDOWN') def draw(self, context): @@ -260,7 +264,7 @@ class OUTLINER_MT_collection_new(Menu): layout.separator() -OUTLINER_MT_context_menu.draw(self, context) +OUTLINER_MT_context_menu.draw_common_operators(layout) class OUTLINER_MT_object(Menu): @@ -303,11 +307,15 @@ class OUTLINER_MT_object(Menu): layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK' layout.separator() +layout.operator("outliner.collection_new", text="New Collection").nested = True + +layout.separator() + layout.operator_menu_enum("outliner.id_operation", "type", text="ID Data") layout.separator() -OUTLINER_MT_context_menu.draw(self, context) +OUTLINER_MT_context_menu.draw_common_operators(layout) class OUTLINER_PT_filter(Panel): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6ad75949b95] blender-v2.90-release: Fix: Wrong outliner restrict column for gpencil layer hide
Commit: 6ad75949b952d7a7911ae91ebc46006203c0da4f Author: Nathan Craddock Date: Mon Jul 27 20:07:55 2020 -0600 Branches: blender-v2.90-release https://developer.blender.org/rB6ad75949b952d7a7911ae91ebc46006203c0da4f Fix: Wrong outliner restrict column for gpencil layer hide The icon was drawing in the viewport disable rather than the viewport hide column. Unreported. === M source/blender/editors/space_outliner/outliner_draw.c === diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 47215f3ccda..a45b415b629 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1376,13 +1376,13 @@ static void outliner_draw_restrictbuts(uiBlock *block, ID *id = tselem->id; bGPDlayer *gpl = (bGPDlayer *)te->directdata; -if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) { +if (soops->show_restrict_flags & SO_RESTRICT_HIDE) { bt = uiDefIconButBitS(block, UI_BTYPE_ICON_TOGGLE, GP_LAYER_HIDE, 0, ICON_HIDE_OFF, -(int)(region->v2d.cur.xmax - restrict_offsets.viewport), +(int)(region->v2d.cur.xmax - restrict_offsets.hide), te->ys, UI_UNIT_X, UI_UNIT_Y, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5222521bc7f] lanpr-under-gp: LineArt: Don't retain strokes when disabled auto_update. Also prevent render dead-lock.
Commit: 5222521bc7f9b789f91edcee5f8c519f7a600781 Author: YimingWu Date: Tue Jul 28 11:05:49 2020 +0800 Branches: lanpr-under-gp https://developer.blender.org/rB5222521bc7f9b789f91edcee5f8c519f7a600781 LineArt: Don't retain strokes when disabled auto_update. Also prevent render dead-lock. === M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c === diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c index ea471e592a0..4e11402eb38 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c @@ -129,6 +129,11 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)md; bGPdata *gpd = ob->data; + Scene *s = DEG_get_evaluated_scene(depsgraph); + if (!(s->lineart.flags & LRT_AUTO_UPDATE)) { +return; + } + /* Guard early, don't trigger calculation when no gpencil frame is present. Probably should * disable in the isModifierDisabled() function but we need addtional arg for depsgraph and * gpd.*/ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [03f56a9fd69] lanpr-under-gp: LineArt: Fix frame cleaning at the wrong time.
Commit: 03f56a9fd69c40a5f0ad0bbb5e8cd2cc1c862c07 Author: YimingWu Date: Tue Jul 28 10:34:41 2020 +0800 Branches: lanpr-under-gp https://developer.blender.org/rB03f56a9fd69c40a5f0ad0bbb5e8cd2cc1c862c07 LineArt: Fix frame cleaning at the wrong time. === M source/blender/editors/lineart/lineart_cpu.c === diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c index cb25f04b991..b44668d7b65 100644 --- a/source/blender/editors/lineart/lineart_cpu.c +++ b/source/blender/editors/lineart/lineart_cpu.c @@ -3854,8 +3854,7 @@ static int lineart_gpencil_bake_strokes_exec(bContext *C, wmOperator *UNUSED(op) bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, frame, GP_GETFRAME_ADD_NEW); /* Clear original frame */ -if ((scene->lineart.flags & LRT_GPENCIL_OVERWRITE) && gpf->strokes.first && -(!cleared)) { +if ((scene->lineart.flags & LRT_GPENCIL_OVERWRITE) && (!cleared)) { BKE_gpencil_layer_frame_delete(gpl, gpf); gpf = BKE_gpencil_layer_frame_get(gpl, frame, GP_GETFRAME_ADD_NEW); cleared = 1; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a7ed36c8034] lanpr-under-gp: Merge remote-tracking branch 'origin/master' into lanpr-under-gp
Commit: a7ed36c80344b5427357e6d9e2d157484eb8a556 Author: YimingWu Date: Tue Jul 28 09:21:44 2020 +0800 Branches: lanpr-under-gp https://developer.blender.org/rBa7ed36c80344b5427357e6d9e2d157484eb8a556 Merge remote-tracking branch 'origin/master' into lanpr-under-gp === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [74d6113c329] soc-2020-soft-body: added buttons to gui but they do nothing at the moment
Commit: 74d6113c329131f51994929ae5a43935eb6be2a6 Author: mattoverby Date: Mon Jul 27 19:06:36 2020 -0500 Branches: soc-2020-soft-body https://developer.blender.org/rB74d6113c329131f51994929ae5a43935eb6be2a6 added buttons to gui but they do nothing at the moment === M extern/softbody/src/admmpd_types.h M release/scripts/startup/bl_ui/properties_physics_softbody.py M source/blender/makesdna/DNA_object_force_types.h M source/blender/makesrna/intern/rna_object_force.c === diff --git a/extern/softbody/src/admmpd_types.h b/extern/softbody/src/admmpd_types.h index f96bd10c8e7..2903d0add95 100644 --- a/extern/softbody/src/admmpd_types.h +++ b/extern/softbody/src/admmpd_types.h @@ -21,7 +21,7 @@ enum EnergyTermType { }; struct Options { -double timestep_s; // TODO: Figure out delta time from blender api +double timestep_s; int max_admm_iters; int max_cg_iters; int max_gs_iters; diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py index 3b080822b95..029a35e51e3 100644 --- a/release/scripts/startup/bl_ui/properties_physics_softbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py @@ -32,7 +32,6 @@ COMPAT_OB_TYPES = {'MESH', 'LATTICE', 'CURVE', 'SURFACE', 'FONT'} def softbody_panel_enabled(md): return (md.point_cache.is_baked is False) - class PhysicButtonsPanel: bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -55,6 +54,8 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel): md = context.soft_body softbody = md.settings +layout.prop(softbody, "solver_mode") + layout.prop(softbody, "collision_collection") @@ -75,15 +76,25 @@ class PHYSICS_PT_softbody_object(PhysicButtonsPanel, Panel): layout.enabled = softbody_panel_enabled(md) flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) -col = flow.column() -col.prop(softbody, "friction") +if softbody.solver_mode=='LEGACY': -col.separator() +col = flow.column() +col.prop(softbody, "friction") -col = flow.column() -col.prop(softbody, "mass") +col.separator() + +col = flow.column() +col.prop(softbody, "mass") -col.prop_search(softbody, "vertex_group_mass", ob, "vertex_groups", text="Control Point") +col.prop_search(softbody, "vertex_group_mass", ob, "vertex_groups", text="Control Point") + +elif softbody.solver_mode=='ADMMPD': + +col = flow.column() +col.prop(softbody, "admmpd_youngs") +col.prop(softbody, "admmpd_poisson") +col.prop(softbody, "admmpd_material") +col.prop(softbody, "admmpd_density_kgm3") class PHYSICS_PT_softbody_simulation(PhysicButtonsPanel, Panel): @@ -92,6 +103,12 @@ class PHYSICS_PT_softbody_simulation(PhysicButtonsPanel, Panel): bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} +@classmethod +def poll(cls, context): +md = context.soft_body +softbody = md.settings +return (softbody.solver_mode=='LEGACY') + def draw(self, context): layout = self.layout layout.use_property_split = True @@ -139,6 +156,9 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel): layout.prop_search(softbody, "vertex_group_goal", ob, "vertex_groups", text="Vertex Group") +if softbody.solver_mode == 'ADMMPD': +layout.prop(softbody, "admmpd_goalstiff") + class PHYSICS_PT_softbody_goal_strengths(PhysicButtonsPanel, Panel): bl_label = "Strengths" @@ -146,6 +166,12 @@ class PHYSICS_PT_softbody_goal_strengths(PhysicButtonsPanel, Panel): bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} +@classmethod +def poll(cls, context): +md = context.soft_body +softbody = md.settings +return (softbody.solver_mode=='LEGACY') + def draw(self, context): layout = self.layout layout.use_property_split = True @@ -172,6 +198,12 @@ class PHYSICS_PT_softbody_goal_settings(PhysicButtonsPanel, Panel): bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} +@classmethod +def poll(cls, context): +md = context.soft_body +softbody = md.settings +return (softbody.solver_mode=='LEGACY') + def draw(self, context): layout = self.layout layout.use_property_split = True @@ -195,6 +227,12 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel): bl_options =
[Bf-blender-cvs] [6eb096d80aa] soc-2020-outliner: Outliner: Fix wrong offset for row highlights
Commit: 6eb096d80aa91892f7b707410edb28396038f233 Author: Nathan Craddock Date: Mon Jul 27 16:11:56 2020 -0600 Branches: soc-2020-outliner https://developer.blender.org/rB6eb096d80aa91892f7b707410edb28396038f233 Outliner: Fix wrong offset for row highlights The row highlight on the right was slightly cut off. === M source/blender/editors/space_outliner/outliner_draw.c === diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index f5ccbd3433a..aab4db3eca6 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -3584,8 +3584,13 @@ static void draw_line_highlight(int x, int y, int maxx, int maxy, const float co { const float pad = U.pixelsize; UI_draw_roundbox_corner_set(UI_CNR_ALL); - UI_draw_roundbox_aa( - true, (float)x + pad, (float)y + pad, (float)maxx - pad, (float)maxy - pad, 5.0f, color); + UI_draw_roundbox_aa(true, + (float)x + pad, + (float)y + pad, + (float)maxx - (pad * 2), /* Extra offset needed on right. */ + (float)maxy - pad, + 5.0f, + color); } static void outliner_draw_highlights_recursive(const ARegion *region, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [814771e316d] soc-2020-outliner: Outliner: Move collection enable icon to restrict column
Commit: 814771e316da89cabbccf70e0f0b6ff7c98af6f1 Author: Nathan Craddock Date: Mon Jul 27 15:55:47 2020 -0600 Branches: soc-2020-outliner https://developer.blender.org/rB814771e316da89cabbccf70e0f0b6ff7c98af6f1 Outliner: Move collection enable icon to restrict column The checkbox behaves as a restriction button, and drawing it vertically in the restriction column allows easier click+drag support. This also removes clutter from the mode column. === M source/blender/editors/space_outliner/outliner_draw.c M source/blender/editors/space_outliner/outliner_utils.c === diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index e5316ae9d49..f5ccbd3433a 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -849,8 +849,8 @@ typedef struct RestrictProperties { PropertyRNA *object_hide_viewport, *object_hide_select, *object_hide_render; PropertyRNA *base_hide_viewport; PropertyRNA *collection_hide_viewport, *collection_hide_select, *collection_hide_render; - PropertyRNA *layer_collection_holdout, *layer_collection_indirect_only, - *layer_collection_hide_viewport; + PropertyRNA *layer_collection_exclude, *layer_collection_holdout, + *layer_collection_indirect_only, *layer_collection_hide_viewport; PropertyRNA *modifier_show_viewport, *modifier_show_render; PropertyRNA *constraint_enable; PropertyRNA *bone_hide_viewport; @@ -866,6 +866,7 @@ typedef struct RestrictPropertiesActive { bool collection_hide_viewport; bool collection_hide_select; bool collection_hide_render; + bool layer_collection_exclude; bool layer_collection_holdout; bool layer_collection_indirect_only; bool layer_collection_hide_viewport; @@ -955,8 +956,7 @@ static bool outliner_restrict_properties_collection_set(Scene *scene, NULL; Collection *collection = outliner_collection_from_tree_element(te); - if ((collection->flag & COLLECTION_IS_MASTER) || - (layer_collection && ((layer_collection->flag & LAYER_COLLECTION_EXCLUDE) != 0))) { + if (collection->flag & COLLECTION_IS_MASTER) { return false; } @@ -996,6 +996,8 @@ static void outliner_draw_restrictbuts(uiBlock *block, "hide_viewport"); props.collection_hide_select = RNA_struct_type_find_property(_Collection, "hide_select"); props.collection_hide_render = RNA_struct_type_find_property(_Collection, "hide_render"); +props.layer_collection_exclude = RNA_struct_type_find_property(_LayerCollection, + "exclude"); props.layer_collection_holdout = RNA_struct_type_find_property(_LayerCollection, "holdout"); props.layer_collection_indirect_only = RNA_struct_type_find_property(_LayerCollection, @@ -1013,6 +1015,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, } struct { +int enable; int select; int hide; int viewport; @@ -1043,6 +1046,10 @@ static void outliner_draw_restrictbuts(uiBlock *block, if (soops->show_restrict_flags & SO_RESTRICT_SELECT) { restrict_offsets.select = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH; } + if (soops->show_restrict_flags & SO_RESTRICT_ENABLE) { +restrict_offsets.enable = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH; + } + BLI_assert((restrict_column_offset * UI_UNIT_X + V2D_SCROLL_WIDTH) == outliner_restrict_columns_width(soops)); @@ -1431,6 +1438,26 @@ static void outliner_draw_restrictbuts(uiBlock *block, Collection *collection = outliner_collection_from_tree_element(te); if (layer_collection != NULL) { +if (soops->show_restrict_flags & SO_RESTRICT_ENABLE) { + bt = uiDefIconButR_prop(block, + UI_BTYPE_ICON_TOGGLE, + 0, + 0, + (int)(region->v2d.cur.xmax) - restrict_offsets.enable, + te->ys, + UI_UNIT_X, + UI_UNIT_Y, + _collection_ptr, + props.layer_collection_exclude, + -1, + 0, + 0, + 0, + 0, + NULL); +
[Bf-blender-cvs] [14f1a0ae7c9] soc-2020-outliner: Merge branch 'master' into soc-2020-outliner
Commit: 14f1a0ae7c9b7f85e2957d65713711ec5c07ff33 Author: Nathan Craddock Date: Mon Jul 27 14:16:00 2020 -0600 Branches: soc-2020-outliner https://developer.blender.org/rB14f1a0ae7c9b7f85e2957d65713711ec5c07ff33 Merge branch 'master' into soc-2020-outliner === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3c316c91adf] greasepencil-object: GPencil: Add generic Y axis invert to main function
Commit: 3c316c91adf1f23ba8000d82df11c253ed0d9a66 Author: Antonio Vazquez Date: Mon Jul 27 23:24:24 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB3c316c91adf1f23ba8000d82df11c253ed0d9a66 GPencil: Add generic Y axis invert to main function This removes duplicate code === M source/blender/io/gpencil/intern/gpencil_io_base.cc M source/blender/io/gpencil/intern/gpencil_io_base.h M source/blender/io/gpencil/intern/gpencil_io_svg.cc === diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc index 46cec62b923..fbd92632ae9 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc @@ -76,21 +76,32 @@ void GpencilExporter::set_out_filename(struct bContext *C, char *filename) bool GpencilExporter::gpencil_3d_point_to_screen_space(struct ARegion *region, const float diff_mat[4][4], const float co[3], + const bool invert, float r_co[2]) { float parent_co[3]; mul_v3_m4v3(parent_co, diff_mat, co); float screen_co[2]; - // eV3DProjTest test = (eV3DProjTest)(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN); eV3DProjTest test = (eV3DProjTest)(V3D_PROJ_RET_OK); if (ED_view3d_project_float_global(region, parent_co, screen_co, test) == V3D_PROJ_RET_OK) { if (!ELEM(V2D_IS_CLIPPED, screen_co[0], screen_co[1])) { copy_v2_v2(r_co, screen_co); + /* Invert Y axis. */ + if (invert) { +r_co[1] = params.region->winy - r_co[1]; + } + return true; } } r_co[0] = V2D_IS_CLIPPED; r_co[1] = V2D_IS_CLIPPED; + + /* Invert Y axis. */ + if (invert) { +r_co[1] = params.region->winy - r_co[1]; + } + return false; } @@ -150,18 +161,14 @@ float GpencilExporter::stroke_point_radius_get(const struct bGPDlayer *gpl, float v1[2], screen_co[2], screen_ex[2]; pt = >points[0]; - gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_co); - /* Invert Y axis. */ - screen_co[1] = params.region->winy - screen_co[1]; + gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, true, screen_co); /* Radius. */ bGPDstroke *gps_perimeter = BKE_gpencil_stroke_perimeter_from_view( rv3d, gpd, gpl, gps, 3, diff_mat); pt = _perimeter->points[0]; - gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_ex); - /* Invert Y axis. */ - screen_ex[1] = params.region->winy - screen_ex[1]; + gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, true, screen_ex); sub_v2_v2v2(v1, screen_co, screen_ex); float radius = len_v2(v1); diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.h b/source/blender/io/gpencil/intern/gpencil_io_base.h index 603f08901c9..2cadaf29429 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.h +++ b/source/blender/io/gpencil/intern/gpencil_io_base.h @@ -48,6 +48,7 @@ class GpencilExporter { bool gpencil_3d_point_to_screen_space(struct ARegion *region, const float diff_mat[4][4], const float co[3], +const bool invert, float r_co[2]); bool is_stroke_thickness_constant(struct bGPDstroke *gps); diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index b5ad18e840f..e2c35b694f6 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -289,9 +289,7 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, ("stylestroke" + std::to_string(gps->mat_nr + 1)).c_str()); bGPDspoint *pt = >points[0]; - gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_co); - /* Invert Y axis. */ - screen_co[1] = params.region->winy - screen_co[1]; + gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, true, screen_co); gps_node.append_attribute("cx").set_value(screen_co[0]); gps_node.append_attribute("cy").set_value(screen_co[1]); @@ -328,9 +326,7 @@ void GpencilExporterSVG::export_stroke_path(pugi::xml_node gpl_node, } bGPDspoint *pt = >points[i]; float screen_co[2]; -gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_co); -/* Invert Y axis. */ -screen_co[1] = params.region->winy - screen_co[1]; +gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, true, screen_co); txt.append(std::to_string(screen_co[0]) + "," + std::to_string(screen_co[1])); }
[Bf-blender-cvs] [86e39af1525] greasepencil-object: GPencil: Remove duplicated code for SVG point radius
Commit: 86e39af15250d1b2342982366b2677b9f0896cc0 Author: Antonio Vazquez Date: Mon Jul 27 23:17:20 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB86e39af15250d1b2342982366b2677b9f0896cc0 GPencil: Remove duplicated code for SVG point radius Now it's using the same function in all places. === M source/blender/io/gpencil/intern/gpencil_io_svg.cc === diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index eeb8732e147..b5ad18e840f 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -281,16 +281,14 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, float diff_mat[4][4]) { BLI_assert(gps->totpoints == 1); - RegionView3D *rv3d = (RegionView3D *)params.region->regiondata; - bGPDspoint *pt = NULL; - float v1[2], screen_co[2], screen_ex[2]; + float screen_co[2]; pugi::xml_node gps_node = gpl_node.append_child("circle"); gps_node.append_attribute("class").set_value( ("stylestroke" + std::to_string(gps->mat_nr + 1)).c_str()); - pt = >points[0]; + bGPDspoint *pt = >points[0]; gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_co); /* Invert Y axis. */ screen_co[1] = params.region->winy - screen_co[1]; @@ -299,18 +297,7 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, gps_node.append_attribute("cy").set_value(screen_co[1]); /* Radius. */ - bGPDstroke *gps_perimeter = BKE_gpencil_stroke_perimeter_from_view( - rv3d, gpd, gpl, gps, 3, diff_mat); - - pt = _perimeter->points[0]; - gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_ex); - /* Invert Y axis. */ - screen_ex[1] = params.region->winy - screen_ex[1]; - - sub_v2_v2v2(v1, screen_co, screen_ex); - float radius = len_v2(v1); - BKE_gpencil_free_stroke(gps_perimeter); - + float radius = stroke_point_radius_get(gpl, gps, diff_mat); gps_node.append_attribute("r").set_value(radius); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d0f688a33d8] greasepencil-object: GPencil: Fix error when use perimter function
Commit: d0f688a33d8c778d271e361e9cf8e900d2b0ca94 Author: Antonio Vazquez Date: Mon Jul 27 23:10:29 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rBd0f688a33d8c778d271e361e9cf8e900d2b0ca94 GPencil: Fix error when use perimter function The BKE function was changing the original stroke. Now a temp copy is done. === M source/blender/blenkernel/intern/gpencil_geom.c === diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c index 5afe05ed168..99b9134d5e0 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.c +++ b/source/blender/blenkernel/intern/gpencil_geom.c @@ -3067,18 +3067,19 @@ bGPDstroke *BKE_gpencil_stroke_perimeter_from_view(struct RegionView3D *rv3d, if (gps->totpoints == 0) { return NULL; } + bGPDstroke *gps_temp = BKE_gpencil_stroke_duplicate(gps, true); - BKE_gpencil_stroke_to_view_space(rv3d, gps, diff_mat); + BKE_gpencil_stroke_to_view_space(rv3d, gps_temp, diff_mat); int num_perimeter_points = 0; ListBase *perimeter_points = gpencil_stroke_perimeter_ex( - gpd, gpl, gps, subdivisions, _perimeter_points); + gpd, gpl, gps_temp, subdivisions, _perimeter_points); if (num_perimeter_points == 0) { return NULL; } /* create new stroke */ - bGPDstroke *perimeter_stroke = BKE_gpencil_stroke_new(gps->mat_nr, num_perimeter_points, 1); + bGPDstroke *perimeter_stroke = BKE_gpencil_stroke_new(gps_temp->mat_nr, num_perimeter_points, 1); tPerimeterPoint *curr = perimeter_points->first; for (int i = 0; i < num_perimeter_points; i++) { @@ -3107,6 +3108,8 @@ bGPDstroke *BKE_gpencil_stroke_perimeter_from_view(struct RegionView3D *rv3d, perimeter_stroke->flag |= GP_STROKE_SELECT | GP_STROKE_CYCLIC; + BKE_gpencil_free_stroke(gps_temp); + return perimeter_stroke; } /** \} */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [85898fb122d] greasepencil-object: GPencil: Add option to export SVG in constant thickness lines
Commit: 85898fb122d2e2c160a18a3dd9c9ac3a5af44edb Author: Antonio Vazquez Date: Mon Jul 27 22:57:29 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB85898fb122d2e2c160a18a3dd9c9ac3a5af44edb GPencil: Add option to export SVG in constant thickness lines === M source/blender/editors/io/io_gpencil.c M source/blender/io/gpencil/gpencil_io_exporter.h M source/blender/io/gpencil/intern/gpencil_io_base.cc M source/blender/io/gpencil/intern/gpencil_io_base.h M source/blender/io/gpencil/intern/gpencil_io_svg.cc M source/blender/io/gpencil/intern/gpencil_io_svg.h === diff --git a/source/blender/editors/io/io_gpencil.c b/source/blender/editors/io/io_gpencil.c index 9783697575c..6d21f6f6161 100644 --- a/source/blender/editors/io/io_gpencil.c +++ b/source/blender/editors/io/io_gpencil.c @@ -148,10 +148,12 @@ static int wm_gpencil_export_exec(bContext *C, wmOperator *op) const bool only_active_frame = RNA_boolean_get(op->ptr, "only_active_frame"); const bool use_fill = RNA_boolean_get(op->ptr, "use_fill"); + const bool use_norm_thickness = RNA_boolean_get(op->ptr, "use_normalized_thickness"); /* Set flags. */ int flag = 0; SET_FLAG_FROM_TEST(flag, use_fill, GP_EXPORT_FILL); + SET_FLAG_FROM_TEST(flag, use_norm_thickness, GP_EXPORT_NORM_THICKNESS); struct GpencilExportParams params = { .C = C, @@ -238,6 +240,7 @@ static void ui_gpencil_export_settings(uiLayout *layout, PointerRNA *imfptr) sub = uiLayoutColumn(col, true); uiItemR(sub, imfptr, "use_fill", 0, NULL, ICON_NONE); + uiItemR(sub, imfptr, "use_normalized_thickness", 0, NULL, ICON_NONE); } static void wm_gpencil_export_draw(bContext *C, wmOperator *op) @@ -339,6 +342,11 @@ void WM_OT_gpencil_export(wmOperatorType *ot) RNA_def_boolean(ot->srna, "only_active_frame", true, "Active Frame", "Export only active frame"); RNA_def_boolean(ot->srna, "use_fill", true, "Fill", "Export filled areas"); + RNA_def_boolean(ot->srna, + "use_normalized_thickness", + false, + "Normalize", + "Export strokes with constant thickness along the stroke"); /* This dummy prop is used to check whether we need to init the start and * end frame values to that of the scene's, otherwise they are reset at diff --git a/source/blender/io/gpencil/gpencil_io_exporter.h b/source/blender/io/gpencil/gpencil_io_exporter.h index eb779112fe4..1d30b4b45de 100644 --- a/source/blender/io/gpencil/gpencil_io_exporter.h +++ b/source/blender/io/gpencil/gpencil_io_exporter.h @@ -53,6 +53,8 @@ struct GpencilExportParams { typedef enum eGpencilExportParams_Flag { /* Export Filled strokes. */ GP_EXPORT_FILL = (1 << 0), + /* Export normalized thickness. */ + GP_EXPORT_NORM_THICKNESS = (1 << 1), } eGpencilExportParams_Flag; bool gpencil_io_export(const struct GpencilExportParams *params); diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc index e3917e304df..773329e80af 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc @@ -25,6 +25,7 @@ #include "BKE_context.h" #include "BKE_gpencil.h" +#include "BKE_gpencil_geom.h" #include "BKE_main.h" #include "BLI_blenlib.h" @@ -35,6 +36,7 @@ #include "DNA_gpencil_types.h" #include "DNA_object_types.h" +#include "DNA_screen_types.h" #ifdef WIN32 # include "utfconv.h" @@ -92,6 +94,29 @@ bool GpencilExporter::gpencil_3d_point_to_screen_space(struct ARegion *region, return false; } +/** + * Get average pressure + * \param gps: Pointer to stroke + * \retun value + */ +float GpencilExporter::stroke_average_pressure(struct bGPDstroke *gps) +{ + bGPDspoint *pt = NULL; + + if (gps->totpoints == 1) { +pt = >points[0]; +return pt->pressure; + } + + float tot = 0.0f; + for (int i = 0; i < gps->totpoints; i++) { +pt = >points[i]; +tot += pt->pressure; + } + + return tot / (float)gps->totpoints; +} + /** * Check if the thickness of the stroke is constant * \param gps: Pointer to stroke @@ -116,6 +141,35 @@ bool GpencilExporter::is_stroke_thickness_constant(struct bGPDstroke *gps) return true; } +float GpencilExporter::point_radius(const struct bGPDlayer *gpl, +struct bGPDstroke *gps, +float diff_mat[4][4]) +{ + RegionView3D *rv3d = (RegionView3D *)params.region->regiondata; + bGPDspoint *pt = NULL; + float v1[2], screen_co[2], screen_ex[2]; + + pt = >points[0]; + gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_co); + /* Invert Y axis. */ + screen_co[1] = params.region->winy - screen_co[1]; + + /* Radius. */ + bGPDstroke *gps_perimeter =
[Bf-blender-cvs] [5f87e343ff1] greasepencil-object: GPencil: Rename export functions
Commit: 5f87e343ff1b614f2a9afa948ae5432e4e588b73 Author: Antonio Vazquez Date: Mon Jul 27 23:01:07 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB5f87e343ff1b614f2a9afa948ae5432e4e588b73 GPencil: Rename export functions === M source/blender/io/gpencil/intern/gpencil_io_base.cc M source/blender/io/gpencil/intern/gpencil_io_base.h M source/blender/io/gpencil/intern/gpencil_io_svg.cc === diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc index 773329e80af..46cec62b923 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc @@ -99,7 +99,7 @@ bool GpencilExporter::gpencil_3d_point_to_screen_space(struct ARegion *region, * \param gps: Pointer to stroke * \retun value */ -float GpencilExporter::stroke_average_pressure(struct bGPDstroke *gps) +float GpencilExporter::stroke_average_pressure_get(struct bGPDstroke *gps) { bGPDspoint *pt = NULL; @@ -141,9 +141,9 @@ bool GpencilExporter::is_stroke_thickness_constant(struct bGPDstroke *gps) return true; } -float GpencilExporter::point_radius(const struct bGPDlayer *gpl, -struct bGPDstroke *gps, -float diff_mat[4][4]) +float GpencilExporter::stroke_point_radius_get(const struct bGPDlayer *gpl, + struct bGPDstroke *gps, + float diff_mat[4][4]) { RegionView3D *rv3d = (RegionView3D *)params.region->regiondata; bGPDspoint *pt = NULL; diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.h b/source/blender/io/gpencil/intern/gpencil_io_base.h index 31a31c2080d..603f08901c9 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.h +++ b/source/blender/io/gpencil/intern/gpencil_io_base.h @@ -51,8 +51,10 @@ class GpencilExporter { float r_co[2]); bool is_stroke_thickness_constant(struct bGPDstroke *gps); - float stroke_average_pressure(struct bGPDstroke *gps); - float point_radius(const struct bGPDlayer *gpl, struct bGPDstroke *gps, float diff_mat[4][4]); + float stroke_average_pressure_get(struct bGPDstroke *gps); + float stroke_point_radius_get(const struct bGPDlayer *gpl, +struct bGPDstroke *gps, +float diff_mat[4][4]); std::string rgb_to_hex(float color[3]); std::string to_lower_string(char *input_text); diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index 0afa8165e39..eeb8732e147 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -374,7 +374,7 @@ void GpencilExporterSVG::export_stroke_polyline(pugi::xml_node gpl_node, bGPDspoint *pt = >points[0]; float avg_pressure = pt->pressure; if (!is_thickness_const) { -avg_pressure = stroke_average_pressure(gps); +avg_pressure = stroke_average_pressure_get(gps); } /* Get the thickness in pixels using a simple 1 point stroke. */ @@ -386,7 +386,7 @@ void GpencilExporterSVG::export_stroke_polyline(pugi::xml_node gpl_node, copy_v3_v3(_dst->x, _src->x); pt_dst->pressure = avg_pressure; - float radius = point_radius(gpl, gps_temp, diff_mat); + float radius = stroke_point_radius_get(gpl, gps_temp, diff_mat); BKE_gpencil_free_stroke(gps_temp); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ace832bf7c4] master: Merge branch 'blender-v2.90-release'
Commit: ace832bf7c4a21a63a315b529403ff35898483c4 Author: Pablo Dobarro Date: Mon Jul 27 22:21:57 2020 +0200 Branches: master https://developer.blender.org/rBace832bf7c4a21a63a315b529403ff35898483c4 Merge branch 'blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [221604cdd66] blender-v2.90-release: Fix Sculpt Relax operation when deforming mesh boundaries
Commit: 221604cdd663e88c0d2c2400144329f0a70f3d87 Author: Pablo Dobarro Date: Sun Jul 19 23:42:44 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB221604cdd663e88c0d2c2400144329f0a70f3d87 Fix Sculpt Relax operation when deforming mesh boundaries Previously, mesh boundaries were relaxed as any other vertex, which was causing artifacts and unwanted deformation. In order to prevent this, the mesh filter was using the automasking system to lock the boundary vertices, which was hacked into the tool. For the brush, the only solution was to enable boundary automasking to lock those vertices in plance. Now the relax vertex function slides the boundary vertices along the mesh boundary edges, relaxing all the topology correctly while preserving the shape of the mesh. The automasking hack in the relax mesh filter was also removed as now vertices slide correctly along the boundary. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8350 === M source/blender/editors/sculpt_paint/sculpt.c M source/blender/editors/sculpt_paint/sculpt_face_set.c M source/blender/editors/sculpt_paint/sculpt_filter_mesh.c === diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index aa8161836f9..590d04bed3d 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3147,21 +3147,49 @@ void SCULPT_relax_vertex(SculptSession *ss, { float smooth_pos[3]; float final_disp[3]; - int count = 0; + float boundary_normal[3]; + int avg_count = 0; + int neighbor_count = 0; zero_v3(smooth_pos); + zero_v3(boundary_normal); + const bool is_boundary = SCULPT_vertex_is_boundary(ss, vd->index); SculptVertexNeighborIter ni; SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vd->index, ni) { +neighbor_count++; if (!filter_boundary_face_sets || (filter_boundary_face_sets && !SCULPT_vertex_has_unique_face_set(ss, ni.index))) { - add_v3_v3(smooth_pos, SCULPT_vertex_co_get(ss, ni.index)); - count++; + + /* When the vertex to relax is boundary, use only connected boundary vertices for the average + * position. */ + if (is_boundary) { +if (SCULPT_vertex_is_boundary(ss, ni.index)) { + add_v3_v3(smooth_pos, SCULPT_vertex_co_get(ss, ni.index)); + avg_count++; + + /* Calculate a normal for the constraint plane using the edges of the boundary. */ + float to_neighbor[3]; + sub_v3_v3v3(to_neighbor, SCULPT_vertex_co_get(ss, ni.index), vd->co); + normalize_v3(to_neighbor); + add_v3_v3(boundary_normal, to_neighbor); +} + } + else { +add_v3_v3(smooth_pos, SCULPT_vertex_co_get(ss, ni.index)); +avg_count++; + } } } SCULPT_VERTEX_NEIGHBORS_ITER_END(ni); - if (count > 0) { -mul_v3_fl(smooth_pos, 1.0f / (float)count); + /* Don't modify corner vertices. */ + if (neighbor_count <= 2) { +copy_v3_v3(r_final_pos, vd->co); +return; + } + + if (avg_count > 0) { +mul_v3_fl(smooth_pos, 1.0f / (float)avg_count); } else { copy_v3_v3(r_final_pos, vd->co); @@ -3171,11 +3199,12 @@ void SCULPT_relax_vertex(SculptSession *ss, float plane[4]; float smooth_closest_plane[3]; float vno[3]; - if (vd->no) { -normal_short_to_float_v3(vno, vd->no); + + if (is_boundary && avg_count == 2) { +normalize_v3_v3(vno, boundary_normal); } else { -copy_v3_v3(vno, vd->fno); +SCULPT_vertex_normal_get(ss, vd->index, vno); } if (is_zero_v3(vno)) { @@ -3256,6 +3285,7 @@ static void do_slide_relax_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int t TaskParallelSettings settings; BKE_pbvh_parallel_range_settings(, true, totnode); if (ss->cache->alt_smooth) { +SCULPT_boundary_info_ensure(ob); for (int i = 0; i < 4; i++) { BLI_task_parallel_range(0, totnode, , do_topology_relax_task_cb_ex, ); } diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.c b/source/blender/editors/sculpt_paint/sculpt_face_set.c index 031b4f8731d..1940b007cb0 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.c +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.c @@ -205,6 +205,7 @@ void SCULPT_do_draw_face_sets_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, in TaskParallelSettings settings; BKE_pbvh_parallel_range_settings(, true, totnode); if (ss->cache->alt_smooth) { +SCULPT_boundary_info_ensure(ob); for (int i = 0; i < 4; i++) { BLI_task_parallel_range(0, totnode, , do_relax_face_sets_brush_task_cb_ex, ); } diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c index 9c9726ff3db..e9a98a17f8a 100644 ---
[Bf-blender-cvs] [00065269521] blender-v2.90-release: Fix T79074: Mesh Topology info not being updated after changes
Commit: 00065269521186ba90d088ee2443d89fbcebfce0 Author: Pablo Dobarro Date: Tue Jul 21 03:25:03 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB00065269521186ba90d088ee2443d89fbcebfce0 Fix T79074: Mesh Topology info not being updated after changes All these data arrays are created for a specific topology, so they should be freed and updated when the PBVH rebuilds. Previously, this was only happening when freeing the SculptSession, but it also needs to happen in BKE_sculpt_update_object_before_eval to avoid reusing out of date data. Reviewed By: sergey Maniphest Tasks: T79074 Differential Revision: https://developer.blender.org/D8357 === M source/blender/blenkernel/intern/paint.c === diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 5feaacee254..d6fbba74a89 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -1314,6 +1314,13 @@ static void sculptsession_free_pbvh(Object *object) MEM_SAFE_FREE(ss->preview_vert_index_list); ss->preview_vert_index_count = 0; + + MEM_SAFE_FREE(ss->preview_vert_index_list); + + MEM_SAFE_FREE(ss->vertex_info.connected_component); + MEM_SAFE_FREE(ss->vertex_info.boundary); + + MEM_SAFE_FREE(ss->fake_neighbors.fake_neighbor_index); } void BKE_sculptsession_bm_to_me_for_render(Object *object) @@ -1366,13 +1373,6 @@ void BKE_sculptsession_free(Object *ob) MEM_SAFE_FREE(ss->deform_cos); MEM_SAFE_FREE(ss->deform_imats); -MEM_SAFE_FREE(ss->preview_vert_index_list); - -MEM_SAFE_FREE(ss->vertex_info.connected_component); -MEM_SAFE_FREE(ss->vertex_info.boundary); - -MEM_SAFE_FREE(ss->fake_neighbors.fake_neighbor_index); - if (ss->pose_ik_chain_preview) { for (int i = 0; i < ss->pose_ik_chain_preview->tot_segments; i++) { MEM_SAFE_FREE(ss->pose_ik_chain_preview->segments[i].weights); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7eebebebc7b] blender-v2.90-release: Fix T79164: Sculpting with smooth shading doesn't update normals
Commit: 7eebebebc7bb08621d97a8318a37366fbd7b02e8 Author: Pablo Dobarro Date: Wed Jul 22 16:44:47 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB7eebebebc7bb08621d97a8318a37366fbd7b02e8 Fix T79164: Sculpting with smooth shading doesn't update normals Just a missing update flag Reviewed By: sergey Maniphest Tasks: T79164 Differential Revision: https://developer.blender.org/D8364 === M source/blender/editors/sculpt_paint/sculpt_smooth.c === diff --git a/source/blender/editors/sculpt_paint/sculpt_smooth.c b/source/blender/editors/sculpt_paint/sculpt_smooth.c index 1a699c91e9b..7fbbcd1c896 100644 --- a/source/blender/editors/sculpt_paint/sculpt_smooth.c +++ b/source/blender/editors/sculpt_paint/sculpt_smooth.c @@ -242,6 +242,9 @@ static void do_smooth_brush_task_cb_ex(void *__restrict userdata, madd_v3_v3v3fl(val, vd.co, val, fade); SCULPT_clip(sd, ss, vd.co, val); } + if (vd.mvert) { +vd.mvert->flag |= ME_VERT_PBVH_UPDATE; + } } } BKE_pbvh_vertex_iter_end; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4f3233dd536] blender-v2.90-release: Fix T78242: Crash when using a Sculpt color tools that needs connectivity for the first time
Commit: 4f3233dd536e8839c304dd34cd8aec89bfd8ca34 Author: Pablo Dobarro Date: Fri Jul 17 18:07:47 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB4f3233dd536e8839c304dd34cd8aec89bfd8ca34 Fix T78242: Crash when using a Sculpt color tools that needs connectivity for the first time When there is no color layer available, BKE_sculpt_update_object_for_edit creates a new one and tags the mesh with ID_RECLAC_GEOMETRY, so this layer is inmediatly available when the tool starts. This also deletes the PBVH and when it is created again in BKE_sculpt_update_object_after_eval, the pmap is not initialized, making the tool crash. This moves the color layer creation to a separate function outside BKE_sculpt_update_object_for_edit, which now runs after the color layer is available, so it won't need to update again and the pmap will still be available when the tool is used. Reviewed By: sergey Maniphest Tasks: T78242 Differential Revision: https://developer.blender.org/D8135 === M source/blender/blenkernel/BKE_paint.h M source/blender/blenkernel/intern/paint.c M source/blender/editors/sculpt_paint/sculpt.c M source/blender/editors/sculpt_paint/sculpt_filter_color.c === diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index e3a6fb4ba2e..1c02aece06f 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -451,6 +451,10 @@ 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); +/* Create new color layer on object if it doesn't have one and if experimental feature set has + * sculpt vertex color enabled. Returns truth if new layer has been added, false otherwise. */ +void BKE_sculpt_color_layer_create_if_needed(struct Object *object); + void BKE_sculpt_update_object_for_edit(struct Depsgraph *depsgraph, struct Object *ob_orig, bool need_pmap, diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 50feb8e99c8..5feaacee254 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -1484,7 +1484,7 @@ static void sculpt_update_object(Depsgraph *depsgraph, Mesh *me_eval, bool need_pmap, bool need_mask, - bool need_colors) + bool UNUSED(need_colors)) { Scene *scene = DEG_get_input_scene(depsgraph); Sculpt *sd = scene->toolsettings->sculpt; @@ -1514,16 +1514,6 @@ static void sculpt_update_object(Depsgraph *depsgraph, } } - /* Add a color layer if a color tool is used. */ - Mesh *orig_me = BKE_object_get_original_mesh(ob); - if (need_colors && U.experimental.use_sculpt_vertex_colors) { -if (!CustomData_has_layer(_me->vdata, CD_PROP_COLOR)) { - CustomData_add_layer(_me->vdata, CD_PROP_COLOR, CD_DEFAULT, NULL, orig_me->totvert); - BKE_mesh_update_customdata_pointers(orig_me, true); - DEG_id_tag_update(_me->id, ID_RECALC_GEOMETRY); -} - } - /* tessfaces aren't used and will become invalid */ BKE_mesh_tessface_clear(me); @@ -1684,10 +1674,26 @@ void BKE_sculpt_update_object_after_eval(Depsgraph *depsgraph, Object *ob_eval) Mesh *me_eval = BKE_object_get_evaluated_mesh(ob_eval); BLI_assert(me_eval != NULL); - sculpt_update_object(depsgraph, ob_orig, me_eval, false, false, false); } +void BKE_sculpt_color_layer_create_if_needed(struct Object *object) +{ + Mesh *orig_me = BKE_object_get_original_mesh(object); + if (!U.experimental.use_sculpt_vertex_colors) { +return; + } + + if (CustomData_has_layer(_me->vdata, CD_PROP_COLOR)) { +return; + } + + CustomData_add_layer(_me->vdata, CD_PROP_COLOR, CD_DEFAULT, NULL, orig_me->totvert); + BKE_mesh_update_customdata_pointers(orig_me, true); + DEG_id_tag_update(_me->id, ID_RECALC_GEOMETRY); + return; +} + void BKE_sculpt_update_object_for_edit( Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool need_mask, bool need_colors) { diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index da5d6588dc8..aa8161836f9 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -7140,7 +7140,6 @@ static void sculpt_brush_init_tex(const Scene *scene, Sculpt *sd, SculptSession static void sculpt_brush_stroke_init(bContext *C, wmOperator *op) { - Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C);
[Bf-blender-cvs] [b378f32d737] soc-2020-soft-body: merged from master
Commit: b378f32d737bae2b203365b81fcf5da1a80351bb Author: mattoverby Date: Mon Jul 27 13:25:31 2020 -0500 Branches: soc-2020-soft-body https://developer.blender.org/rBb378f32d737bae2b203365b81fcf5da1a80351bb merged from master === === diff --cc intern/CMakeLists.txt index 52ece1fea90,0758567bb78..149fd3e4b2c --- a/intern/CMakeLists.txt +++ b/intern/CMakeLists.txt @@@ -30,8 -30,8 +30,13 @@@ add_subdirectory(opensubdiv add_subdirectory(mikktspace) add_subdirectory(glew-mx) add_subdirectory(eigen) + add_subdirectory(sky) + ++ ++ ++ +add_subdirectory(softbody) + if(WITH_AUDASPACE) add_subdirectory(audaspace) endif() diff --cc release/datafiles/locale index 1cc27d5282a,4af22e0492f..4b5779bc192 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 1cc27d5282aa4978ee36663aca857eb550df194b -Subproject commit 4af22e0492f401c609a0203cad1a9bc7fa00b863 ++Subproject commit 4b5779bc192b2cc59d77abc188f9e8d7e4a50cd5 diff --cc release/scripts/addons index 5d33d1a1c25,25b00a0a52c..8f6903bc925 --- a/release/scripts/addons +++ b/release/scripts/addons @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 5d33d1a1c2531e64bda78d46b517571f2b1e98e7 -Subproject commit 25b00a0a52c81408b9dc15ea320a79ee956b3c0a ++Subproject commit 8f6903bc92531aa8e5d4c64a0a108c2904506a83 diff --cc release/scripts/startup/bl_ui/properties_data_mesh.py index ccf66360ad0,77308fed014..57563d674d0 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@@ -483,12 -514,12 +514,15 @@@ class DATA_PT_remesh(MeshButtonsPanel, col.prop(mesh, "use_remesh_preserve_volume", text="Volume") col.prop(mesh, "use_remesh_preserve_paint_mask", text="Paint Mask") col.prop(mesh, "use_remesh_preserve_sculpt_face_sets", text="Face Sets") + if context.preferences.experimental.use_sculpt_vertex_colors: + col.prop(mesh, "use_remesh_preserve_vertex_colors", text="Vertex Colors") + col.operator("object.voxel_remesh", text="Voxel Remesh") -else: +elif mesh.remesh_mode == 'QUAD': col.operator("object.quadriflow_remesh", text="QuadriFlow Remesh") +else: +col.operator("object.tetgen_remesh", text="Tetrahedralize") + class DATA_PT_customdata(MeshButtonsPanel, Panel): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3b1f4d1a817] soc-2020-soft-body: test commit
Commit: 3b1f4d1a81712894f45261e677a5f5538a03a846 Author: mattoverby Date: Mon Jul 27 12:42:54 2020 -0500 Branches: soc-2020-soft-body https://developer.blender.org/rB3b1f4d1a81712894f45261e677a5f5538a03a846 test commit === M extern/softbody/README.md === diff --git a/extern/softbody/README.md b/extern/softbody/README.md index 78144e7b666..2d8929d6ba1 100644 --- a/extern/softbody/README.md +++ b/extern/softbody/README.md @@ -1,3 +1,5 @@ # SoftBody # +TODO + ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a0b0a47d810] master: GPencil: Scale stroke thickness when use Offset modifier scale
Commit: a0b0a47d8104e6c0ef56745c713ea7f7a34099ce Author: Antonio Vazquez Date: Mon Jul 27 19:09:32 2020 +0200 Branches: master https://developer.blender.org/rBa0b0a47d8104e6c0ef56745c713ea7f7a34099ce GPencil: Scale stroke thickness when use Offset modifier scale === M source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c === diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c index 9cc3712e8f4..75f929e979e 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c @@ -105,19 +105,23 @@ static void deformStroke(GpencilModifierData *md, bGPDspoint *pt = >points[i]; MDeformVert *dvert = gps->dvert != NULL ? >dvert[i] : NULL; -/* verify vertex group */ +/* Verify vertex group. */ const float weight = get_modifier_point_weight( dvert, (mmd->flag & GP_OFFSET_INVERT_VGROUP) != 0, def_nr); if (weight < 0.0f) { continue; } -/* calculate matrix */ +/* Calculate matrix. */ mul_v3_v3fl(loc, mmd->loc, weight); mul_v3_v3fl(rot, mmd->rot, weight); mul_v3_v3fl(scale, mmd->scale, weight); add_v3_fl(scale, 1.0); loc_eul_size_to_mat4(mat, loc, rot, scale); +/* Apply scale to thickness. */ +float unit_scale = (scale[0] + scale[1] + scale[2]) / 3.0f; +pt->pressure *= unit_scale; + mul_m4_v3(mat, >x); } /* Calc geometry data. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e8869d9c711] master: Merge remote-tracking branch 'origin/blender-v2.90-release'
Commit: e8869d9c7110f17c5fed6929410273d8a8105808 Author: Sybren A. Stüvel Date: Mon Jul 27 19:02:44 2020 +0200 Branches: master https://developer.blender.org/rBe8869d9c7110f17c5fed6929410273d8a8105808 Merge remote-tracking branch 'origin/blender-v2.90-release' === === diff --cc tests/gtests/runner/CMakeLists.txt index 8f9bc225678,18d8f57364f..59537aab571 --- a/tests/gtests/runner/CMakeLists.txt +++ b/tests/gtests/runner/CMakeLists.txt @@@ -77,10 -66,8 +77,10 @@@ set(_GOOGLETEST_DISCOVER_TESTS_SCRIP ) gtest_discover_tests(blender_test - # So that unit tests know where to find files: +# So that the binary can find its shared libs on window. + WORKING_DIRECTORY "$" +# So that unit tests know where to find files: EXTRA_ARGS --test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests" - --test-release-dir "$/${BLENDER_VERSION}" + --test-release-dir "${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}" ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2584a2a4e7b] blender-v2.90-release: Fix USD unit test on buildbot
Commit: 2584a2a4e7b2cb657c863e35a62afd83e5bbafb8 Author: Sybren A. Stüvel Date: Mon Jul 27 18:36:19 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB2584a2a4e7b2cb657c863e35a62afd83e5bbafb8 Fix USD unit test on buildbot The buildbot uses a separate `CMAKE_INSTALL_PREFIX`. This means that the unit test could not find its USD JSON files in the build directory. Using `${CMAKE_INSTALL_PREFIX}` instead of `$` solved this. === M tests/gtests/runner/CMakeLists.txt === diff --git a/tests/gtests/runner/CMakeLists.txt b/tests/gtests/runner/CMakeLists.txt index 4da0bce09a4..18d8f57364f 100644 --- a/tests/gtests/runner/CMakeLists.txt +++ b/tests/gtests/runner/CMakeLists.txt @@ -69,5 +69,5 @@ gtest_discover_tests(blender_test # So that unit tests know where to find files: EXTRA_ARGS --test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests" ---test-release-dir "$/${BLENDER_VERSION}" +--test-release-dir "${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}" ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e893430a630] blender-v2.90-release: Partly revert "Fix T77276: Generating Python API docs raises many warnings"
Commit: e893430a6306ded059270e7df9d78180cdc0d9e3 Author: Aaron Carlisle Date: Mon Jul 27 13:01:28 2020 -0400 Branches: blender-v2.90-release https://developer.blender.org/rBe893430a6306ded059270e7df9d78180cdc0d9e3 Partly revert "Fix T77276: Generating Python API docs raises many warnings" This commit reverts the "noindex" part of the original commit. using noindex made it imposible to link to a specific property. The original warnings do not pose an issue so until a proper solution is found I am reverting this commit. This reverts commit 953c232db31f1a76f99ceb43119681ce0df1ab17 === M doc/python_api/sphinx_doc_gen.py === diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 8ad96a6e4f5..2c9445dce97 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -696,13 +696,11 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier): doc = undocumented_message(module_name, type_name, identifier) if type(descr) == GetSetDescriptorType: -fw(ident + ".. attribute:: %s\n" % identifier) -fw(ident + " :noindex:\n\n") +fw(ident + ".. attribute:: %s\n\n" % identifier) write_indented_lines(ident + " ", fw, doc, False) fw("\n") elif type(descr) == MemberDescriptorType: # same as above but use 'data' -fw(ident + ".. data:: %s\n" % identifier) -fw(ident + " :noindex:\n\n") +fw(ident + ".. data:: %s\n\n" % identifier) write_indented_lines(ident + " ", fw, doc, False) fw("\n") elif type(descr) in {MethodDescriptorType, ClassMethodDescriptorType}: @@ -742,14 +740,11 @@ def pyprop2sphinx(ident, fw, identifier, py_prop): ''' # readonly properties use "data" directive, variables use "attribute" directive if py_prop.fset is None: -fw(ident + ".. data:: %s\n" % identifier) -fw(ident + " :noindex:\n\n") +fw(ident + ".. data:: %s\n\n" % identifier) else: -fw(ident + ".. attribute:: %s\n" % identifier) -fw(ident + " :noindex:\n\n") +fw(ident + ".. attribute:: %s\n\n" % identifier) write_indented_lines(ident + " ", fw, py_prop.__doc__) if py_prop.fset is None: -fw("\n") fw(ident + " (readonly)\n\n") else: fw("\n") @@ -915,8 +910,7 @@ def pymodule2sphinx(basepath, module_name, module, title): elif issubclass(value_type, (bool, int, float, str, tuple)): # constant, not much fun we can do here except to list it. # TODO, figure out some way to document these! -fw(".. data:: %s\n" % attribute) -fw(" :noindex:\n\n") +fw(".. data:: %s\n\n" % attribute) write_indented_lines(" ", fw, "constant value %s" % repr(value), False) fw("\n") else: @@ -1126,8 +1120,7 @@ def pycontext2sphinx(basepath): type_descr = prop.get_type_description( class_fmt=":class:`bpy.types.%s`", collection_id=_BPY_PROP_COLLECTION_ID) -fw(".. data:: %s\n" % prop.identifier) -fw(" :noindex:\n\n") +fw(".. data:: %s\n\n" % prop.identifier) if prop.description: fw(" %s\n\n" % prop.description) @@ -1172,8 +1165,7 @@ def pycontext2sphinx(basepath): i = 0 while char_array[i] is not None: member = ctypes.string_at(char_array[i]).decode(encoding="ascii") -fw(".. data:: %s\n" % member) -fw(" :noindex:\n\n") +fw(".. data:: %s\n\n" % member) member_type, is_seq = context_type_map[member] fw(" :type: %s :class:`bpy.types.%s`\n\n" % ("sequence of " if is_seq else "", member_type)) unique.add(member) @@ -1379,11 +1371,9 @@ def pyrna2sphinx(basepath): type_descr = prop.get_type_description(class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID) # readonly properties use "data" directive, variables properties use "attribute" directive if 'readonly' in type_descr: -fw(" .. data:: %s\n" % prop.identifier) -fw(" :noindex:\n\n") +fw(" .. data:: %s\n\n" % prop.identifier) else: -fw(" .. attribute:: %s\n" % prop.identifier) -fw(" :noindex:\n\n") +fw(" .. attribute:: %s\n\n" % prop.identifier) if prop.description: fw(" %s\n\n" % prop.description) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [219bea85721] greasepencil-object: GPencil: Rename export_stroke function
Commit: 219bea85721b778c503c62d121b5362ec97a Author: Antonio Vazquez Date: Mon Jul 27 18:59:30 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB219bea85721b778c503c62d121b5362ec97a GPencil: Rename export_stroke function === M source/blender/io/gpencil/intern/gpencil_io_svg.cc M source/blender/io/gpencil/intern/gpencil_io_svg.h === diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index c87ae5dd1fa..f70c2311af3 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -234,7 +234,7 @@ void GpencilExporterSVG::export_layers(void) else { /* Fill. */ if ((is_fill) && (params.flag & GP_EXPORT_FILL)) { - export_stroke(gpl_node, gps, diff_mat, true); + export_stroke_path(gpl_node, gps, diff_mat, true); } /* Stroke. */ @@ -246,7 +246,7 @@ void GpencilExporterSVG::export_layers(void) // ED_gpencil_project_stroke_to_view(params.C, gpl, gps_perimeter); BKE_gpencil_stroke_sample(gps_perimeter, 0.03f, false); - export_stroke(gpl_node, gps_perimeter, diff_mat, false); + export_stroke_path(gpl_node, gps_perimeter, diff_mat, false); BKE_gpencil_free_stroke(gps_perimeter); } @@ -301,16 +301,16 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, } /** - * Export a stroke + * Export a stroke using path * \param gpl_node: Node of the layer. * \param gps: Stroke to export. * \param diff_mat: Transformation matrix. * \param is_fill: True if the stroke is only fill */ -void GpencilExporterSVG::export_stroke(pugi::xml_node gpl_node, - struct bGPDstroke *gps, - float diff_mat[4][4], - const bool is_fill) +void GpencilExporterSVG::export_stroke_path(pugi::xml_node gpl_node, +struct bGPDstroke *gps, +float diff_mat[4][4], +const bool is_fill) { pugi::xml_node gps_node = gpl_node.append_child("path"); diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.h b/source/blender/io/gpencil/intern/gpencil_io_svg.h index 91152237bd4..adf4f6d99f5 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.h +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.h @@ -55,10 +55,10 @@ class GpencilExporterSVG : public GpencilExporter { struct bGPDlayer *gpl, struct bGPDstroke *gps, float diff_mat[4][4]); - void export_stroke(pugi::xml_node gpl_node, - struct bGPDstroke *gps, - float diff_mat[4][4], - const bool is_fill); + void export_stroke_path(pugi::xml_node gpl_node, + struct bGPDstroke *gps, + float diff_mat[4][4], + const bool is_fill); }; } // namespace gpencil ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e6fab8dc399] greasepencil-object: GPencil: New function to determine if the stroke has same thickness in all points
Commit: e6fab8dc399302d35fe1bb8266f8672852dafb50 Author: Antonio Vazquez Date: Mon Jul 27 18:59:57 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rBe6fab8dc399302d35fe1bb8266f8672852dafb50 GPencil: New function to determine if the stroke has same thickness in all points === M source/blender/io/gpencil/intern/gpencil_io_base.cc M source/blender/io/gpencil/intern/gpencil_io_base.h === diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc index 528a5d16112..e3917e304df 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc @@ -33,6 +33,7 @@ #include "BLI_string.h" #include "BLI_utildefines.h" +#include "DNA_gpencil_types.h" #include "DNA_object_types.h" #ifdef WIN32 @@ -91,6 +92,30 @@ bool GpencilExporter::gpencil_3d_point_to_screen_space(struct ARegion *region, return false; } +/** + * Check if the thickness of the stroke is constant + * \param gps: Pointer to stroke + * \retun true if all points thickness are equal. + */ +bool GpencilExporter::is_stroke_thickness_constant(struct bGPDstroke *gps) +{ + if (gps->totpoints == 1) { +return true; + } + + bGPDspoint *pt = >points[0]; + float prv_pressure = pt->pressure; + + for (int i = 0; i < gps->totpoints; i++) { +pt = >points[i]; +if (pt->pressure != prv_pressure) { + return false; +} + } + + return true; +} + /** * Convert a color to Hex value (#FF) * \param color: Original RGB color diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.h b/source/blender/io/gpencil/intern/gpencil_io_base.h index 28e0650f5e1..1dfce8b4f36 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.h +++ b/source/blender/io/gpencil/intern/gpencil_io_base.h @@ -47,6 +47,8 @@ class GpencilExporter { const float co[3], float r_co[2]); + bool is_stroke_thickness_constant(struct bGPDstroke *gps); + std::string rgb_to_hex(float color[3]); std::string to_lower_string(char *input_text); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [729da8bfac0] master: CTest: Fix blender_test not working on windows.
Commit: 729da8bfac05b3f71cb2cbb9992aa505920fb5e6 Author: Ray Molenkamp Date: Mon Jul 27 10:55:34 2020 -0600 Branches: master https://developer.blender.org/rB729da8bfac05b3f71cb2cbb9992aa505920fb5e6 CTest: Fix blender_test not working on windows. MSVC does need the wholearchive flag but it was not set, so no tests were actually linked into the binary. Reviewed By: sybren Differential Revision: https://developer.blender.org/D8404 === M tests/gtests/runner/CMakeLists.txt === diff --git a/tests/gtests/runner/CMakeLists.txt b/tests/gtests/runner/CMakeLists.txt index 4da0bce09a4..8f9bc225678 100644 --- a/tests/gtests/runner/CMakeLists.txt +++ b/tests/gtests/runner/CMakeLists.txt @@ -36,7 +36,7 @@ endif() # directly referenced from other code. get_property(_test_libs GLOBAL PROPERTY BLENDER_TEST_LIBS) if(WIN32) - list(APPEND TEST_LIBS ${_test_libs}) + # Win32 is set using target_link_options after target creation. elseif(APPLE) list(APPEND TEST_LIBS "-Wl,-force_load" ${_test_libs}) elseif(UNIX) @@ -44,7 +44,6 @@ elseif(UNIX) else() message(FATAL_ERROR "Unknown how to link whole-archive with your compiler ${CMAKE_CXX_COMPILER_ID}") endif() -unset(_test_libs) # This builds `bin/tests/blender_test`, but does not add it as a single test. setup_libdirs() @@ -56,6 +55,18 @@ BLENDER_SRC_GTEST_EX( ) setup_liblinks(blender_test) +if(WIN32) + foreach(_lib ${_test_libs}) +# Both target_link_libraries and target_link_options are required here +# target_link_libraries will add any dependend libraries, while just setting +# the wholearchive flag in target link options will not. +target_link_libraries(blender_test ${_lib}) +target_link_options(blender_test PRIVATE /wholearchive:$) + endforeach() +endif() + +unset(_test_libs) + # This runs the blender_test executable with `--gtest_list_tests`, then # exposes those tests individually to the ctest runner. # See https://cmake.org/cmake/help/v3.18/module/GoogleTest.html @@ -66,7 +77,9 @@ set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT ) gtest_discover_tests(blender_test - # So that unit tests know where to find files: +# So that the binary can find its shared libs on window. + WORKING_DIRECTORY "$" +# So that unit tests know where to find files: EXTRA_ARGS --test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests" --test-release-dir "$/${BLENDER_VERSION}" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [412cd801b98] temp-usd-test-cmake-install-prefix: Fix USD unit test on buildbot
Commit: 412cd801b98ab85646b100b12926a259fd21f513 Author: Sybren A. Stüvel Date: Mon Jul 27 18:36:19 2020 +0200 Branches: temp-usd-test-cmake-install-prefix https://developer.blender.org/rB412cd801b98ab85646b100b12926a259fd21f513 Fix USD unit test on buildbot The buildbot uses a separate `CMAKE_INSTALL_PREFIX`. This means that the unit test could not find its USD JSON files in the build directory. Using `${CMAKE_INSTALL_PREFIX}` instead of `$` solved this. === M tests/gtests/runner/CMakeLists.txt === diff --git a/tests/gtests/runner/CMakeLists.txt b/tests/gtests/runner/CMakeLists.txt index 4da0bce09a4..18d8f57364f 100644 --- a/tests/gtests/runner/CMakeLists.txt +++ b/tests/gtests/runner/CMakeLists.txt @@ -69,5 +69,5 @@ gtest_discover_tests(blender_test # So that unit tests know where to find files: EXTRA_ARGS --test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests" ---test-release-dir "$/${BLENDER_VERSION}" +--test-release-dir "${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}" ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8643663965a] greasepencil-object: Merge branch 'master' into greasepencil-object
Commit: 8643663965a34048e1d6115ea508a04edf859393 Author: Antonio Vazquez Date: Mon Jul 27 18:36:03 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB8643663965a34048e1d6115ea508a04edf859393 Merge branch 'master' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [94e1b14ceac] greasepencil-object: GPencil: New option to disable fill strokes in SVG export
Commit: 94e1b14ceac84b109af05f3da45919b916dd1133 Author: Antonio Vazquez Date: Mon Jul 27 18:35:38 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB94e1b14ceac84b109af05f3da45919b916dd1133 GPencil: New option to disable fill strokes in SVG export === M source/blender/editors/io/io_gpencil.c M source/blender/io/gpencil/gpencil_io_exporter.h M source/blender/io/gpencil/intern/gpencil_io_svg.cc === diff --git a/source/blender/editors/io/io_gpencil.c b/source/blender/editors/io/io_gpencil.c index 81f73431763..9783697575c 100644 --- a/source/blender/editors/io/io_gpencil.c +++ b/source/blender/editors/io/io_gpencil.c @@ -147,6 +147,11 @@ static int wm_gpencil_export_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", filename); const bool only_active_frame = RNA_boolean_get(op->ptr, "only_active_frame"); + const bool use_fill = RNA_boolean_get(op->ptr, "use_fill"); + + /* Set flags. */ + int flag = 0; + SET_FLAG_FROM_TEST(flag, use_fill, GP_EXPORT_FILL); struct GpencilExportParams params = { .C = C, @@ -156,6 +161,7 @@ static int wm_gpencil_export_exec(bContext *C, wmOperator *op) .mode = GP_EXPORT_TO_SVG, .frame_start = RNA_int_get(op->ptr, "start"), .frame_end = RNA_int_get(op->ptr, "end"), + .flag = flag, }; /* Take some defaults from the scene, if not specified explicitly. */ Scene *scene = CTX_data_scene(C); @@ -223,6 +229,15 @@ static void ui_gpencil_export_settings(uiLayout *layout, PointerRNA *imfptr) uiLayoutSetActive(sub, !RNA_boolean_get(imfptr, "only_active_frame")); uiItemR(sub, imfptr, "start", 0, IFACE_("Frame Start"), ICON_NONE); uiItemR(sub, imfptr, "end", 0, IFACE_("End"), ICON_NONE); + + box = uiLayoutBox(layout); + row = uiLayoutRow(box, false); + uiItemL(row, IFACE_("Export Options"), ICON_SCENE_DATA); + + col = uiLayoutColumn(box, false); + + sub = uiLayoutColumn(col, true); + uiItemR(sub, imfptr, "use_fill", 0, NULL, ICON_NONE); } static void wm_gpencil_export_draw(bContext *C, wmOperator *op) @@ -323,6 +338,7 @@ void WM_OT_gpencil_export(wmOperatorType *ot) INT_MAX); RNA_def_boolean(ot->srna, "only_active_frame", true, "Active Frame", "Export only active frame"); + RNA_def_boolean(ot->srna, "use_fill", true, "Fill", "Export filled areas"); /* This dummy prop is used to check whether we need to init the start and * end frame values to that of the scene's, otherwise they are reset at diff --git a/source/blender/io/gpencil/gpencil_io_exporter.h b/source/blender/io/gpencil/gpencil_io_exporter.h index 83d3c5037f8..eb779112fe4 100644 --- a/source/blender/io/gpencil/gpencil_io_exporter.h +++ b/source/blender/io/gpencil/gpencil_io_exporter.h @@ -46,8 +46,15 @@ struct GpencilExportParams { double frame_end; /** Frame subfix. */ char frame[5]; + /** Flags. */ + int flag; }; +typedef enum eGpencilExportParams_Flag { + /* Export Filled strokes. */ + GP_EXPORT_FILL = (1 << 0), +} eGpencilExportParams_Flag; + bool gpencil_io_export(const struct GpencilExportParams *params); #ifdef __cplusplus diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index 431e4d1f913..c87ae5dd1fa 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -68,6 +68,7 @@ GpencilExporterSVG::GpencilExporterSVG(const struct GpencilExportParams *params) this->params.C = params->C; this->params.filename = params->filename; this->params.mode = params->mode; + this->params.flag = params->flag; this->gpd = (bGPdata *)params->ob->data; @@ -232,7 +233,7 @@ void GpencilExporterSVG::export_layers(void) } else { /* Fill. */ -if (is_fill) { +if ((is_fill) && (params.flag & GP_EXPORT_FILL)) { export_stroke(gpl_node, gps, diff_mat, true); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [68bebaf28f7] greasepencil-edit-curve: Merge branch 'master' into greasepencil-edit-curve
Commit: 68bebaf28f7f5d7d5030ae559b2e24859a6cc862 Author: Antonio Vazquez Date: Mon Jul 27 18:34:04 2020 +0200 Branches: greasepencil-edit-curve https://developer.blender.org/rB68bebaf28f7f5d7d5030ae559b2e24859a6cc862 Merge branch 'master' into greasepencil-edit-curve === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [634bf8e4fcb] property-search-ui: Merge branch 'master' into property-search-ui
Commit: 634bf8e4fcb73c1787e58f42bec380eda9b3df6e Author: Hans Goudey Date: Mon Jul 27 12:34:08 2020 -0400 Branches: property-search-ui https://developer.blender.org/rB634bf8e4fcb73c1787e58f42bec380eda9b3df6e Merge branch 'master' into property-search-ui === === diff --cc source/blender/editors/space_buttons/space_buttons.c index ac0baeb1a68,67efd8f4b8e..63b91163125 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@@ -48,11 -48,8 +48,9 @@@ #include "RNA_define.h" #include "RNA_enum_types.h" +#include "UI_interface.h" #include "UI_resources.h" - #include "GPU_glew.h" - #include "buttons_intern.h" /* own include */ /* default callbacks for buttons space * */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6531eabab3e] soc-2020-fluid-tools: Merge branch 'master' into soc-2020-fluid-tools
Commit: 6531eabab3e59116853ab2f3790e311af6b89d2a Author: Sriharsha Kotcharlakot Date: Mon Jul 27 20:18:00 2020 +0530 Branches: soc-2020-fluid-tools https://developer.blender.org/rB6531eabab3e59116853ab2f3790e311af6b89d2a Merge branch 'master' into soc-2020-fluid-tools === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e54289cdf35] master: Merge branch 'blender-v2.90-release'
Commit: e54289cdf3503fcb874ae06990e7e7c7668bf5ca Author: Bastien Montagne Date: Mon Jul 27 18:15:56 2020 +0200 Branches: master https://developer.blender.org/rBe54289cdf3503fcb874ae06990e7e7c7668bf5ca Merge branch 'blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1ae8855f8e2] blender-v2.90-release: Fix T78308: Weight Transfer Operator "Deform Pose Bones" destination setting doesn't work.
Commit: 1ae8855f8e2dfd5aa710fa521be75be0c81a5971 Author: Bastien Montagne Date: Mon Jul 27 18:12:40 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB1ae8855f8e2dfd5aa710fa521be75be0c81a5971 Fix T78308: Weight Transfer Operator "Deform Pose Bones" destination setting doesn't work. Some modes were working by mere chance in that ugly 'reversed' case, but the to/from selection modes were not properly swapped... Should also be safe for 2.83. === M source/blender/editors/object/object_data_transfer.c === diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index aebc77ec44b..5a0656ee916 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -420,8 +420,8 @@ static int data_transfer_exec(bContext *C, wmOperator *op) const float ray_radius = RNA_float_get(op->ptr, "ray_radius"); const float islands_precision = RNA_float_get(op->ptr, "islands_precision"); - const int layers_src = RNA_enum_get(op->ptr, "layers_select_src"); - const int layers_dst = RNA_enum_get(op->ptr, "layers_select_dst"); + int layers_src = RNA_enum_get(op->ptr, "layers_select_src"); + int layers_dst = RNA_enum_get(op->ptr, "layers_select_dst"); int layers_select_src[DT_MULTILAYER_INDEX_MAX] = {0}; int layers_select_dst[DT_MULTILAYER_INDEX_MAX] = {0}; const int fromto_idx = BKE_object_data_transfer_dttype_to_srcdst_index(data_type); @@ -447,6 +447,10 @@ static int data_transfer_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } + if (reverse_transfer) { +SWAP(int, layers_src, layers_dst); + } + if (fromto_idx != DT_MULTILAYER_INDEX_INVALID) { layers_select_src[fromto_idx] = layers_src; layers_select_dst[fromto_idx] = layers_dst; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [960ce1e394f] blender-v2.90-release: Fix T78306: Weight Transfer Operator target mesh doesn't update when transforming bones.
Commit: 960ce1e394fac320788f95bfe4e7c8c4e07b7b4d Author: Bastien Montagne Date: Mon Jul 27 17:37:46 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB960ce1e394fac320788f95bfe4e7c8c4e07b7b4d Fix T78306: Weight Transfer Operator target mesh doesn't update when transforming bones. Data transfer operator was missing tagging DEG for relations updates. Should be portable to 2.83 as well. === M source/blender/editors/object/object_data_transfer.c === diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 14bf73027d9..aebc77ec44b 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -508,13 +508,15 @@ static int data_transfer_exec(bContext *C, wmOperator *op) BLI_freelistN(_objects); - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL); + if (changed) { +DEG_relations_tag_update(CTX_data_main(C)); +WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL); + } #if 0 /* TODO */ /* Note: issue with that is that if canceled, operator cannot be redone... Nasty in our case. */ return changed ? OPERATOR_FINISHED : OPERATOR_CANCELLED; #else - (void)changed; return OPERATOR_FINISHED; #endif } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7fd68db8412] master: Merge branch 'blender-v2.90-release'
Commit: 7fd68db84122e2b9373987393b17c6aa160ac549 Author: Bastien Montagne Date: Mon Jul 27 17:40:10 2020 +0200 Branches: master https://developer.blender.org/rB7fd68db84122e2b9373987393b17c6aa160ac549 Merge branch 'blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a5b2aa96e4a] blender-v2.90-release: CMake: reject older GCC version when using precompiled Linux libraries
Commit: a5b2aa96e4a72b9270462a59d6317a0659e8c6e2 Author: Sybren A. Stüvel Date: Mon Jul 27 17:29:13 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rBa5b2aa96e4a72b9270462a59d6317a0659e8c6e2 CMake: reject older GCC version when using precompiled Linux libraries In the situation where the precompiled libraries are used on Linux + GCC, a version of GCC older than 9.3 is guaranteed to cause problems. This just implents a fatal error message when we know it doesn't make sense to continue. We could do more checks and add some warnings, but it's very likely that these will be ignored amongst the other noise. Reviewed By: sergey, brecht Differential Revision: https://developer.blender.org/D8396 === M build_files/cmake/platform/platform_unix.cmake === diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 96244b65f21..c5e8893424b 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -36,6 +36,11 @@ if(NOT DEFINED LIBDIR) elseif(EXISTS ${LIBDIR_CENTOS7_ABI}) set(LIBDIR ${LIBDIR_CENTOS7_ABI}) set(WITH_CXX11_ABI OFF) + +if(CMAKE_COMPILER_IS_GNUCC AND + CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3) + message(FATAL_ERROR "GCC version must be at least 9.3 for precompiled libraries, found ${CMAKE_C_COMPILER_VERSION}") +endif() endif() # Avoid namespace pollustion. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2e376cfcc8b] master: Merge remote-tracking branch 'origin/blender-v2.90-release'
Commit: 2e376cfcc8b0561ea56c192daa4c96642fe84083 Author: Sybren A. Stüvel Date: Mon Jul 27 17:32:28 2020 +0200 Branches: master https://developer.blender.org/rB2e376cfcc8b0561ea56c192daa4c96642fe84083 Merge remote-tracking branch 'origin/blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9a53d4a882d] master: Particles: support Clamp node
Commit: 9a53d4a882d3297e5f4f0d94b84ece8078fe50be Author: Jacques Lucke Date: Mon Jul 27 17:12:01 2020 +0200 Branches: master https://developer.blender.org/rB9a53d4a882d3297e5f4f0d94b84ece8078fe50be Particles: support Clamp node === M release/scripts/startup/nodeitems_builtins.py M source/blender/nodes/CMakeLists.txt R073source/blender/nodes/shader/nodes/node_shader_clamp.c source/blender/nodes/shader/nodes/node_shader_clamp.cc === diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 8ae41a9e19c..2c9d7ae769a 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -523,7 +523,7 @@ simulation_node_categories = [ ]), SimulationNodeCategory("SIM_CONVERTER", "Converter", items=[ NodeItem("ShaderNodeMapRange"), -not_implemented_node("ShaderNodeClamp"), +NodeItem("ShaderNodeClamp"), NodeItem("ShaderNodeMath"), NodeItem("ShaderNodeValToRGB"), NodeItem("ShaderNodeVectorMath"), diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index bb2aaf35e52..c53e01ac80f 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -160,7 +160,7 @@ set(SRC shader/nodes/node_shader_bsdf_velvet.c shader/nodes/node_shader_bump.c shader/nodes/node_shader_camera.c - shader/nodes/node_shader_clamp.c + shader/nodes/node_shader_clamp.cc shader/nodes/node_shader_common.c shader/nodes/node_shader_curves.c shader/nodes/node_shader_displacement.c diff --git a/source/blender/nodes/shader/nodes/node_shader_clamp.c b/source/blender/nodes/shader/nodes/node_shader_clamp.cc similarity index 73% rename from source/blender/nodes/shader/nodes/node_shader_clamp.c rename to source/blender/nodes/shader/nodes/node_shader_clamp.cc index 808f9686f0a..1077f616a62 100644 --- a/source/blender/nodes/shader/nodes/node_shader_clamp.c +++ b/source/blender/nodes/shader/nodes/node_shader_clamp.cc @@ -50,6 +50,30 @@ static int gpu_shader_clamp(GPUMaterial *mat, GPU_stack_link(mat, node, "clamp_range", in, out); } +static void sh_node_clamp_expand_in_mf_network(blender::nodes::NodeMFNetworkBuilder ) +{ + static blender::fn::CustomMF_SI_SI_SI_SO minmax_fn{ + "Clamp (Min Max)", + [](float value, float min, float max) { return std::min(std::max(value, min), max); }}; + static blender::fn::CustomMF_SI_SI_SI_SO range_fn{ + "Clamp (Range)", [](float value, float a, float b) { +if (a < b) { + return clamp_f(value, a, b); +} +else { + return clamp_f(value, b, a); +} + }}; + + int clamp_type = builder.bnode().custom1; + if (clamp_type == NODE_CLAMP_MINMAX) { +builder.set_matching_fn(minmax_fn); + } + else { +builder.set_matching_fn(range_fn); + } +} + void register_node_type_sh_clamp(void) { static bNodeType ntype; @@ -58,6 +82,7 @@ void register_node_type_sh_clamp(void) node_type_socket_templates(, sh_node_clamp_in, sh_node_clamp_out); node_type_init(, node_shader_init_clamp); node_type_gpu(, gpu_shader_clamp); + ntype.expand_in_mf_network = sh_node_clamp_expand_in_mf_network; nodeRegisterType(); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bd4b29d63de] master: Cleanup: fixed compiler warning about `strncat`
Commit: bd4b29d63de6cccdb524e965b28b8cf68e169cef Author: Sybren A. Stüvel Date: Mon Jul 27 17:03:32 2020 +0200 Branches: master https://developer.blender.org/rBbd4b29d63de6cccdb524e965b28b8cf68e169cef Cleanup: fixed compiler warning about `strncat` `strncat(command, "x", 1)` is the same as `strcat(command, "x")`, except that the latter form doesn't trigger a GCC warning. No functional changes. === M extern/cuew/src/cuew.c === diff --git a/extern/cuew/src/cuew.c b/extern/cuew/src/cuew.c index f477ec48a18..7a1b0018a24 100644 --- a/extern/cuew/src/cuew.c +++ b/extern/cuew/src/cuew.c @@ -879,7 +879,7 @@ int cuewCompilerVersion(void) { } /* get --version output */ - strncat(command, "\"", 1); + strcat(command, "\""); strncat(command, path, sizeof(command) - 1); strncat(command, "\" --version", sizeof(command) - strlen(path) - 1); pipe = popen(command, "r"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7afee455b1c] lanpr-under-gp: LineArt: Fix compiler warnings
Commit: 7afee455b1c2a8a376048367da59c8cb1c50f4b7 Author: Antonio Vazquez Date: Mon Jul 27 16:53:23 2020 +0200 Branches: lanpr-under-gp https://developer.blender.org/rB7afee455b1c2a8a376048367da59c8cb1c50f4b7 LineArt: Fix compiler warnings === M source/blender/editors/lineart/lineart_cpu.c === diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c index 9013f6ef663..cb25f04b991 100644 --- a/source/blender/editors/lineart/lineart_cpu.c +++ b/source/blender/editors/lineart/lineart_cpu.c @@ -3652,7 +3652,6 @@ void ED_lineart_gpencil_generate_from_chain(Depsgraph *depsgraph, static int tempnum = 0; tempnum++; int color_idx = 0; - Scene *scene = DEG_get_evaluated_scene(depsgraph); Object *orig_ob = NULL; if (ob) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0dd6a7647cd] lanpr-under-gp: Merge branch 'master' into lanpr-under-gp
Commit: 0dd6a7647cd442ce4f6a18199b610a6e421759c3 Author: Antonio Vazquez Date: Mon Jul 27 16:49:01 2020 +0200 Branches: lanpr-under-gp https://developer.blender.org/rB0dd6a7647cd442ce4f6a18199b610a6e421759c3 Merge branch 'master' into lanpr-under-gp === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c7ee66e517b] master: Cleanup: remove outdated comment
Commit: c7ee66e517b2ae54f1304ae9b0085e6ed7a246c2 Author: Jacques Lucke Date: Mon Jul 27 16:42:04 2020 +0200 Branches: master https://developer.blender.org/rBc7ee66e517b2ae54f1304ae9b0085e6ed7a246c2 Cleanup: remove outdated comment === M source/blender/draw/intern/draw_cache_impl_pointcloud.c === diff --git a/source/blender/draw/intern/draw_cache_impl_pointcloud.c b/source/blender/draw/intern/draw_cache_impl_pointcloud.c index 5807b779113..06cedb9f72c 100644 --- a/source/blender/draw/intern/draw_cache_impl_pointcloud.c +++ b/source/blender/draw/intern/draw_cache_impl_pointcloud.c @@ -155,9 +155,6 @@ static void pointcloud_batch_cache_ensure_pos(Object *ob, PointCloudBatchCache * } PointCloud *pointcloud = ob->data; - /* Assume points always have a radius for now. - * TODO: Check if the logic below makes sense when there are multiple point clouds, some that - * have a radius and others that don't. */ const bool has_radius = pointcloud->radius != NULL; static GPUVertFormat format = {0}; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [38e65331a83] master: Particles: initial support for events and actions
Commit: 38e65331a8345054874e81668772dc8c66ad1a1e Author: Jacques Lucke Date: Mon Jul 27 16:26:32 2020 +0200 Branches: master https://developer.blender.org/rB38e65331a8345054874e81668772dc8c66ad1a1e Particles: initial support for events and actions The following nodes work now (although things can still be improved of course): Particle Birth Event, Praticle Time Step Event, Set Particle Attribute and Execute Condition. Multiple Set Particle Attribute nodes can be chained using the "Execute" sockets. They will be executed from left to right. === M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/intern/node.c M source/blender/functions/FN_attributes_ref.hh M source/blender/functions/FN_cpp_type.hh M source/blender/functions/FN_spans.hh M source/blender/functions/intern/attributes_ref.cc M source/blender/nodes/simulation/nodes/node_sim_set_particle_attribute.cc M source/blender/simulation/intern/particle_function.cc M source/blender/simulation/intern/particle_function.hh M source/blender/simulation/intern/simulation_collect_influences.cc M source/blender/simulation/intern/simulation_solver.cc M source/blender/simulation/intern/simulation_solver_influences.hh === diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 8439eadcec3..8ae41a9e19c 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -498,16 +498,16 @@ simulation_node_categories = [ not_implemented_node("SimulationNodeEmitParticles"), ]), SimulationNodeCategory("SIM_EVENTS", "Events", items=[ -not_implemented_node("SimulationNodeParticleBirthEvent"), -not_implemented_node("SimulationNodeParticleTimeStepEvent"), +NodeItem("SimulationNodeParticleBirthEvent"), +NodeItem("SimulationNodeParticleTimeStepEvent"), not_implemented_node("SimulationNodeParticleMeshCollisionEvent"), ]), SimulationNodeCategory("SIM_FORCES", "Forces", items=[ NodeItem("SimulationNodeForce"), ]), SimulationNodeCategory("SIM_EXECUTE", "Execute", items=[ -not_implemented_node("SimulationNodeSetParticleAttribute"), -not_implemented_node("SimulationNodeExecuteCondition"), +NodeItem("SimulationNodeSetParticleAttribute"), +NodeItem("SimulationNodeExecuteCondition"), not_implemented_node("SimulationNodeMultiExecute"), ]), SimulationNodeCategory("SIM_NOISE", "Noise", items=[ diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index ca1354e9fea..8d7cb90fb71 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -846,12 +846,12 @@ static void socket_id_user_increment(bNodeSocket *sock) switch ((eNodeSocketDatatype)sock->type) { case SOCK_OBJECT: { bNodeSocketValueObject *default_value = sock->default_value; - id_us_plus(_value->value->id); + id_us_plus((ID *)default_value->value); break; } case SOCK_IMAGE: { bNodeSocketValueImage *default_value = sock->default_value; - id_us_plus(_value->value->id); + id_us_plus((ID *)default_value->value); break; } case SOCK_FLOAT: diff --git a/source/blender/functions/FN_attributes_ref.hh b/source/blender/functions/FN_attributes_ref.hh index ed14676731e..c694f11b7a7 100644 --- a/source/blender/functions/FN_attributes_ref.hh +++ b/source/blender/functions/FN_attributes_ref.hh @@ -50,12 +50,12 @@ class AttributesInfoBuilder : NonCopyable, NonMovable { AttributesInfoBuilder() = default; ~AttributesInfoBuilder(); - template void add(StringRef name, const T _value) + template bool add(StringRef name, const T _value) { -this->add(name, CPPType::get(), (const void *)_value); +return this->add(name, CPPType::get(), (const void *)_value); } - void add(StringRef name, const CPPType , const void *default_value = nullptr); + bool add(StringRef name, const CPPType , const void *default_value = nullptr); }; /** diff --git a/source/blender/functions/FN_cpp_type.hh b/source/blender/functions/FN_cpp_type.hh index 594890e353a..531a9073784 100644 --- a/source/blender/functions/FN_cpp_type.hh +++ b/source/blender/functions/FN_cpp_type.hh @@ -371,7 +371,7 @@ class CPPType : NonCopyable, NonMovable { void copy_to_initialized_n(const void *src, void *dst, int64_t n) const { -BLI_assert(src != dst); +BLI_assert(n == 0 || src != dst); BLI_assert(n == 0 || this->pointer_can_point_to_instance(src)); BLI_assert(n == 0 || this->pointer_can_point_to_instance(dst)); @@ -380,7 +380,7 @@ class CPPType : NonCopyable, NonMovable { void copy_to_initialized_indices(const
[Bf-blender-cvs] [6f5d01779a5] master: Functions: add some tests for virtual spans
Commit: 6f5d01779a50931aeefbc3593af27d3ffacdab72 Author: Jacques Lucke Date: Mon Jul 27 16:35:54 2020 +0200 Branches: master https://developer.blender.org/rB6f5d01779a50931aeefbc3593af27d3ffacdab72 Functions: add some tests for virtual spans === M source/blender/functions/FN_spans.hh M source/blender/functions/tests/FN_spans_test.cc === diff --git a/source/blender/functions/FN_spans.hh b/source/blender/functions/FN_spans.hh index a81f3ea3633..62fa7c8ed4b 100644 --- a/source/blender/functions/FN_spans.hh +++ b/source/blender/functions/FN_spans.hh @@ -217,7 +217,7 @@ template struct VSpanBase { case VSpanCategory::FullArray: return true; case VSpanCategory::FullPointerArray: -return false; +return virtual_size_ <= 1; } BLI_assert(false); return false; diff --git a/source/blender/functions/tests/FN_spans_test.cc b/source/blender/functions/tests/FN_spans_test.cc index 527c91d7846..fbcf1fda71e 100644 --- a/source/blender/functions/tests/FN_spans_test.cc +++ b/source/blender/functions/tests/FN_spans_test.cc @@ -56,6 +56,7 @@ TEST(virtual_span, EmptyConstructor) EXPECT_EQ(span.size(), 0); EXPECT_TRUE(span.is_empty()); EXPECT_FALSE(span.is_single_element()); + EXPECT_TRUE(span.is_full_array()); GVSpan converted(span); EXPECT_EQ(converted.type(), CPPType::get()); @@ -73,6 +74,7 @@ TEST(virtual_span, SpanConstructor) EXPECT_EQ(virtual_span[2], 8); EXPECT_EQ(virtual_span[3], 6); EXPECT_FALSE(virtual_span.is_single_element()); + EXPECT_TRUE(virtual_span.is_full_array()); GVSpan converted(span); EXPECT_EQ(converted.type(), CPPType::get()); @@ -93,6 +95,7 @@ TEST(virtual_span, PointerSpanConstructor) EXPECT_EQ(span[2], 6); EXPECT_EQ([1], ); EXPECT_FALSE(span.is_single_element()); + EXPECT_FALSE(span.is_full_array()); GVSpan converted(span); EXPECT_EQ(converted.type(), CPPType::get()); @@ -115,6 +118,7 @@ TEST(virtual_span, SingleConstructor) EXPECT_EQ([1], ); EXPECT_EQ([2], ); EXPECT_TRUE(span.is_single_element()); + EXPECT_FALSE(span.is_full_array()); GVSpan converted(span); EXPECT_EQ(converted.type(), CPPType::get()); @@ -130,6 +134,7 @@ TEST(generic_virtual_span, TypeConstructor) EXPECT_EQ(span.size(), 0); EXPECT_TRUE(span.is_empty()); EXPECT_FALSE(span.is_single_element()); + EXPECT_TRUE(span.is_full_array()); VSpan converted = span.typed(); EXPECT_EQ(converted.size(), 0); @@ -146,6 +151,7 @@ TEST(generic_virtual_span, GenericSpanConstructor) EXPECT_EQ(span[2], [2]); EXPECT_EQ(span[3], [3]); EXPECT_FALSE(span.is_single_element()); + EXPECT_TRUE(span.is_full_array()); int materialized[4] = {0}; span.materialize_to_uninitialized(materialized); @@ -172,6 +178,7 @@ TEST(generic_virtual_span, SpanConstructor) EXPECT_EQ(span[1], [1]); EXPECT_EQ(span[2], [2]); EXPECT_FALSE(span.is_single_element()); + EXPECT_TRUE(span.is_full_array()); int materialized[3] = {0}; span.materialize_to_uninitialized(materialized); @@ -197,6 +204,7 @@ TEST(generic_virtual_span, SingleConstructor) EXPECT_EQ(span[2], ); EXPECT_TRUE(span.is_single_element()); EXPECT_EQ(span.as_single_element(), ); + EXPECT_FALSE(span.is_full_array()); int materialized[3] = {0}; span.materialize_to_uninitialized({1, 2}, materialized); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a83bb170b09] master: Merge branch 'blender-v2.90-release'
Commit: a83bb170b09d109b93e80002112e4a28ce5d6ff9 Author: Patrick Mours Date: Mon Jul 27 16:18:44 2020 +0200 Branches: master https://developer.blender.org/rBa83bb170b09d109b93e80002112e4a28ce5d6ff9 Merge branch 'blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d64e171c4ba] blender-v2.90-release master: Cycles: Enable OptiX on first generation Maxwell GPUs again
Commit: d64e171c4ba1648c647e5b160cc80c5dd15d05c6 Author: Patrick Mours Date: Mon Jul 27 16:11:00 2020 +0200 Branches: blender-v2.90-release master https://developer.blender.org/rBd64e171c4ba1648c647e5b160cc80c5dd15d05c6 Cycles: Enable OptiX on first generation Maxwell GPUs again === M intern/cycles/device/device_optix.cpp M intern/cycles/kernel/CMakeLists.txt === diff --git a/intern/cycles/device/device_optix.cpp b/intern/cycles/device/device_optix.cpp index ca10cee76ad..1cc45983565 100644 --- a/intern/cycles/device/device_optix.cpp +++ b/intern/cycles/device/device_optix.cpp @@ -1746,11 +1746,10 @@ void device_optix_info(const vector _devices, vector" --target 52 +-target 50 -ptx -i ${CMAKE_CURRENT_SOURCE_DIR}/${input} ${cuda_flags} @@ -563,7 +563,7 @@ if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES) COMMAND ${CUDA_NVCC_EXECUTABLE} --ptx - -arch=sm_52 + -arch=sm_50 ${cuda_flags} ${input} WORKING_DIRECTORY ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4a38856327a] temp-remesh-octree: Increase hard limit for Remesher octree depth
Commit: 4a38856327a9c42936b23160b629ea83dc0c94db Author: Dalai Felinto Date: Mon Jul 27 16:03:32 2020 +0200 Branches: temp-remesh-octree https://developer.blender.org/rB4a38856327a9c42936b23160b629ea83dc0c94db Increase hard limit for Remesher octree depth Adding more precision to help making watertight objects to be printed. === M source/blender/makesrna/intern/rna_modifier.c === diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 86f05c350f3..137a008e782 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -5494,7 +5494,8 @@ static void rna_def_modifier_remesh(BlenderRNA *brna) prop = RNA_def_property(srna, "octree_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "depth"); - RNA_def_property_range(prop, 1, 12); + RNA_def_property_range(prop, 1, 24); + RNA_def_property_ui_range(prop, 1, 12, 1, 3); RNA_def_property_ui_text( prop, "Octree Depth", "Resolution of the octree; higher values give finer details"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4c5e1f1c25c] master: Merge remote-tracking branch 'origin/blender-v2.90-release'
Commit: 4c5e1f1c25c126aa151e75b07a46f00eac2b8de6 Author: Sybren A. Stüvel Date: Mon Jul 27 15:49:02 2020 +0200 Branches: master https://developer.blender.org/rB4c5e1f1c25c126aa151e75b07a46f00eac2b8de6 Merge remote-tracking branch 'origin/blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [79312962ded] blender-v2.90-release: Cleanup: Fix compiler warning about function without prototype
Commit: 79312962ded4e4cab03c452e53f1c621626554e3 Author: Sybren A. Stüvel Date: Mon Jul 27 15:48:47 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB79312962ded4e4cab03c452e53f1c621626554e3 Cleanup: Fix compiler warning about function without prototype No functional changes. === M source/blender/windowmanager/xr/intern/wm_xr_session.c === diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.c b/source/blender/windowmanager/xr/intern/wm_xr_session.c index 88b7e589a9c..8e7101ddcd5 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_session.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_session.c @@ -177,8 +177,8 @@ static bool wm_xr_session_draw_data_needs_reset_to_base_pose(const wmXrSessionSt (state->prev_base_pose_object != settings->base_pose_object)); } -wmXrSessionStateEvent wm_xr_session_state_to_event(const wmXrSessionState *state, - const XrSessionSettings *settings) +static wmXrSessionStateEvent wm_xr_session_state_to_event(const wmXrSessionState *state, + const XrSessionSettings *settings) { if (!state->is_view_data_set) { return SESSION_STATE_EVENT_START; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [81a0027f13d] master: Merge remote-tracking branch 'origin/blender-v2.90-release'
Commit: 81a0027f13dc63654b724e45d7ddbb08c4b3954c Author: Sybren A. Stüvel Date: Mon Jul 27 15:26:08 2020 +0200 Branches: master https://developer.blender.org/rB81a0027f13dc63654b724e45d7ddbb08c4b3954c Merge remote-tracking branch 'origin/blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [71506698ded] blender-v2.90-release: Cleanup: Fix compiler warning about missing parentheses
Commit: 71506698dede690f5954136a746346953564b15a Author: Sybren A. Stüvel Date: Mon Jul 27 15:25:33 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB71506698dede690f5954136a746346953564b15a Cleanup: Fix compiler warning about missing parentheses The code was well-defined, given that `&&` binds stronger than `||`, but still GCC warns about this. No functional changes. === M source/blender/blenkernel/intern/sequencer.c === diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 742b20c7de9..42276b7f5c0 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -6054,9 +6054,9 @@ bool BKE_sequencer_render_loop_check(Sequence *seq_main, Sequence *seq) return true; } - if (seq_main->seq1 && BKE_sequencer_render_loop_check(seq_main->seq1, seq) || - seq_main->seq2 && BKE_sequencer_render_loop_check(seq_main->seq2, seq) || - seq_main->seq3 && BKE_sequencer_render_loop_check(seq_main->seq3, seq)) { + if ((seq_main->seq1 && BKE_sequencer_render_loop_check(seq_main->seq1, seq)) || + (seq_main->seq2 && BKE_sequencer_render_loop_check(seq_main->seq2, seq)) || + (seq_main->seq3 && BKE_sequencer_render_loop_check(seq_main->seq3, seq))) { return true; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f8a0a5a3504] master: PointCloud: Fix viewport issue when using radius attrib after not using it
Commit: f8a0a5a350406e18cf07b4e2285c2d094a6fc321 Author: Clément Foucault Date: Mon Jul 27 15:39:56 2020 +0200 Branches: master https://developer.blender.org/rBf8a0a5a350406e18cf07b4e2285c2d094a6fc321 PointCloud: Fix viewport issue when using radius attrib after not using it This was a simple issue with the static GPUVertFormat being the same for both cases. === M source/blender/draw/intern/draw_cache_impl_pointcloud.c === diff --git a/source/blender/draw/intern/draw_cache_impl_pointcloud.c b/source/blender/draw/intern/draw_cache_impl_pointcloud.c index 0a1687524f5..5807b779113 100644 --- a/source/blender/draw/intern/draw_cache_impl_pointcloud.c +++ b/source/blender/draw/intern/draw_cache_impl_pointcloud.c @@ -158,9 +158,10 @@ static void pointcloud_batch_cache_ensure_pos(Object *ob, PointCloudBatchCache * /* Assume points always have a radius for now. * TODO: Check if the logic below makes sense when there are multiple point clouds, some that * have a radius and others that don't. */ - const bool has_radius = true; + const bool has_radius = pointcloud->radius != NULL; static GPUVertFormat format = {0}; + static GPUVertFormat format_no_radius = {0}; static uint pos; if (format.attr_len == 0) { /* initialize vertex format */ @@ -170,11 +171,11 @@ static void pointcloud_batch_cache_ensure_pos(Object *ob, PointCloudBatchCache * * If the vertex shader has more components than the array provides, the extras are given * values from the vector (0, 0, 0, 1) for the missing XYZW components. */ -int comp_len = has_radius ? 4 : 3; -pos = GPU_vertformat_attr_add(, "pos", GPU_COMP_F32, comp_len, GPU_FETCH_FLOAT); +pos = GPU_vertformat_attr_add(_no_radius, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); +pos = GPU_vertformat_attr_add(, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); } - cache->pos = GPU_vertbuf_create_with_format(); + cache->pos = GPU_vertbuf_create_with_format(has_radius ? : _no_radius); GPU_vertbuf_data_alloc(cache->pos, pointcloud->totpoint); if (has_radius) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [90212c3cb52] greasepencil-object: GPencil: Fix style error in Illustrator
Commit: 90212c3cb527b1a0567ae381dabb1c09a43cdff5 Author: Antonio Vazquez Date: Mon Jul 27 13:22:34 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB90212c3cb527b1a0567ae381dabb1c09a43cdff5 GPencil: Fix style error in Illustrator The style name cannot contain underscore character === M source/blender/io/gpencil/intern/gpencil_io_svg.cc === diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index 0847d6572dd..431e4d1f913 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -156,7 +156,7 @@ void GpencilExporterSVG::export_style_list(void) linearrgb_to_srgb_v3_v3(col, gp_style->stroke_rgba); std::string stroke_hex = rgb_to_hex(col); sprintf(out, - "\n\t.style_stroke_%d{stroke: %s; fill: %s;}", + "\n\t.stylestroke%d{stroke: %s; fill: %s;}", id, stroke_hex.c_str(), stroke_hex.c_str()); @@ -168,7 +168,7 @@ void GpencilExporterSVG::export_style_list(void) linearrgb_to_srgb_v3_v3(col, gp_style->fill_rgba); std::string stroke_hex = rgb_to_hex(col); sprintf(out, - "\n\t.style_fill_%d{stroke: %s; fill: %s;}", + "\n\t.stylefill%d{stroke: %s; fill: %s;}", id, stroke_hex.c_str(), stroke_hex.c_str()); @@ -273,7 +273,7 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, pugi::xml_node gps_node = gpl_node.append_child("circle"); gps_node.append_attribute("class").set_value( - ("style_stroke_" + std::to_string(gps->mat_nr + 1)).c_str()); + ("stylestroke" + std::to_string(gps->mat_nr + 1)).c_str()); pt = >points[0]; gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_co); @@ -313,7 +313,7 @@ void GpencilExporterSVG::export_stroke(pugi::xml_node gpl_node, { pugi::xml_node gps_node = gpl_node.append_child("path"); - std::string style_type = (is_fill) ? "_fill_" : "_stroke_"; + std::string style_type = (is_fill) ? "fill" : "stroke"; gps_node.append_attribute("class").set_value( ("style" + style_type + std::to_string(gps->mat_nr + 1)).c_str()); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7a85be00b58] greasepencil-object: GPencil: Calculate real radius size for SVG point
Commit: 7a85be00b5877e637757f012e5b014b8fbb62062 Author: Antonio Vazquez Date: Mon Jul 27 13:01:10 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rB7a85be00b5877e637757f012e5b014b8fbb62062 GPencil: Calculate real radius size for SVG point === M source/blender/io/gpencil/intern/gpencil_io_svg.cc === diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index 6a4baa05a72..7b151e2b6ec 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -269,13 +269,15 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, float diff_mat[4][4]) { BLI_assert(gps->totpoints == 1); + RegionView3D *rv3d = (RegionView3D *)params.region->regiondata; + bGPDspoint *pt = NULL; pugi::xml_node gps_node = gpl_node.append_child("circle"); gps_node.append_attribute("class").set_value( ("style_stroke_" + std::to_string(gps->mat_nr + 1)).c_str()); - bGPDspoint *pt = >points[0]; + pt = >points[0]; float screen_co[2]; gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_co); /* Invert Y axis. */ @@ -285,10 +287,25 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, gps_node.append_attribute("cy").set_value(screen_co[1]); /* Radius. */ - /* TODO: This is wrong. */ - float defaultpixsize = 1000.0f / gpd->pixfactor; - float stroke_radius = ((gps->thickness + gpl->line_change) / defaultpixsize) / 2.0f; - gps_node.append_attribute("r").set_value(stroke_radius); + bGPDstroke *gps_tmp = BKE_gpencil_stroke_duplicate(gps, true); + bGPDstroke *gps_perimeter = BKE_gpencil_stroke_perimeter_from_view( + rv3d, gpd, gpl, gps_tmp, 3, diff_mat); + + pt = _perimeter->points[0]; + float screen_ex[2]; + gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_ex); + /* Invert Y axis. */ + screen_ex[1] = params.region->winy - screen_ex[1]; + + float v1[2]; + sub_v2_v2v2(v1, screen_co, screen_ex); + float radius = len_v2(v1); + BKE_gpencil_free_stroke(gps_perimeter); + BKE_gpencil_free_stroke(gps_tmp); + + // float defaultpixsize = 1000.0f / gpd->pixfactor; + // float stroke_radius = ((gps->thickness + gpl->line_change) / defaultpixsize) / 2.0f; + gps_node.append_attribute("r").set_value(radius); } /** @@ -304,8 +321,6 @@ void GpencilExporterSVG::export_stroke(pugi::xml_node gpl_node, const bool is_fill) { pugi::xml_node gps_node = gpl_node.append_child("path"); - // gps_node.append_attribute("fill").set_value("#00"); - // gps_node.append_attribute("stroke").set_value("#00"); std::string style_type = (is_fill) ? "_fill_" : "_stroke_"; gps_node.append_attribute("class").set_value( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b9e488b08a8] greasepencil-object: GPencil: Remove duplicated temp stroke
Commit: b9e488b08a82d908e05e969a20e038718a7ad4c2 Author: Antonio Vazquez Date: Mon Jul 27 13:06:32 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rBb9e488b08a82d908e05e969a20e038718a7ad4c2 GPencil: Remove duplicated temp stroke This was to bypass a bug, but now it's not required. === M source/blender/io/gpencil/intern/gpencil_io_svg.cc === diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index 7b151e2b6ec..0847d6572dd 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -238,10 +238,8 @@ void GpencilExporterSVG::export_layers(void) /* Stroke. */ if (is_stroke) { - /* Create a duplicate to avoid any transformation. */ - bGPDstroke *gps_tmp = BKE_gpencil_stroke_duplicate(gps, true); bGPDstroke *gps_perimeter = BKE_gpencil_stroke_perimeter_from_view( - rv3d, gpd, gpl, gps_tmp, 3, diff_mat); + rv3d, gpd, gpl, gps, 3, diff_mat); /* Reproject and sample stroke. */ // ED_gpencil_project_stroke_to_view(params.C, gpl, gps_perimeter); @@ -250,7 +248,6 @@ void GpencilExporterSVG::export_layers(void) export_stroke(gpl_node, gps_perimeter, diff_mat, false); BKE_gpencil_free_stroke(gps_perimeter); - BKE_gpencil_free_stroke(gps_tmp); } } } @@ -271,6 +268,7 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, BLI_assert(gps->totpoints == 1); RegionView3D *rv3d = (RegionView3D *)params.region->regiondata; bGPDspoint *pt = NULL; + float v1[2], screen_co[2], screen_ex[2]; pugi::xml_node gps_node = gpl_node.append_child("circle"); @@ -278,7 +276,6 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, ("style_stroke_" + std::to_string(gps->mat_nr + 1)).c_str()); pt = >points[0]; - float screen_co[2]; gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_co); /* Invert Y axis. */ screen_co[1] = params.region->winy - screen_co[1]; @@ -287,24 +284,18 @@ void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, gps_node.append_attribute("cy").set_value(screen_co[1]); /* Radius. */ - bGPDstroke *gps_tmp = BKE_gpencil_stroke_duplicate(gps, true); bGPDstroke *gps_perimeter = BKE_gpencil_stroke_perimeter_from_view( - rv3d, gpd, gpl, gps_tmp, 3, diff_mat); + rv3d, gpd, gpl, gps, 3, diff_mat); pt = _perimeter->points[0]; - float screen_ex[2]; gpencil_3d_point_to_screen_space(params.region, diff_mat, >x, screen_ex); /* Invert Y axis. */ screen_ex[1] = params.region->winy - screen_ex[1]; - float v1[2]; sub_v2_v2v2(v1, screen_co, screen_ex); float radius = len_v2(v1); BKE_gpencil_free_stroke(gps_perimeter); - BKE_gpencil_free_stroke(gps_tmp); - // float defaultpixsize = 1000.0f / gpd->pixfactor; - // float stroke_radius = ((gps->thickness + gpl->line_change) / defaultpixsize) / 2.0f; gps_node.append_attribute("r").set_value(radius); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9ce2c5bf507] master: Cleanup: remove workaround for old BLI_dynstr_vappendf bug
Commit: 9ce2c5bf507923ac3add5c8452709310ed5b3b75 Author: Campbell Barton Date: Mon Jul 27 13:02:33 2020 +1000 Branches: master https://developer.blender.org/rB9ce2c5bf507923ac3add5c8452709310ed5b3b75 Cleanup: remove workaround for old BLI_dynstr_vappendf bug Remove workaround from 1c806f6bb454dca6f682ecd741bd2fe03b9617bb as this doesn't seem to be needed anymore. === M source/blender/python/intern/bpy_capi_utils.c === diff --git a/source/blender/python/intern/bpy_capi_utils.c b/source/blender/python/intern/bpy_capi_utils.c index 89ef2f40a30..0befd6aad2f 100644 --- a/source/blender/python/intern/bpy_capi_utils.c +++ b/source/blender/python/intern/bpy_capi_utils.c @@ -128,33 +128,21 @@ bool BPy_errors_to_report_ex(ReportList *reports, const bool use_full, const boo const char *filename; int lineno; -PyObject *pystring_format; /* workaround, see below */ -const char *cstring; - PyC_FileAndNum(, ); if (filename == NULL) { filename = ""; } -#if 0 /* ARG!. workaround for a bug in blenders use of vsnprintf */ BKE_reportf(reports, RPT_ERROR, -"%s\nlocation: %s:%d\n", +TIP_("%s\nlocation: %s:%d\n"), _PyUnicode_AsString(pystring), filename, lineno); -#else -pystring_format = PyUnicode_FromFormat( -TIP_("%s\nlocation: %s:%d\n"), _PyUnicode_AsString(pystring), filename, lineno); - -cstring = _PyUnicode_AsString(pystring_format); -BKE_report(reports, RPT_ERROR, cstring); - -/* not exactly needed. just for testing */ -fprintf(stderr, TIP_("%s\nlocation: %s:%d\n"), cstring, filename, lineno); -Py_DECREF(pystring_format); /* workaround */ -#endif +/* Not exactly needed. Useful for developers tracking down issues. */ +fprintf( +stderr, TIP_("%s\nlocation: %s:%d\n"), _PyUnicode_AsString(pystring), filename, lineno); } else { BKE_report(reports, RPT_ERROR, _PyUnicode_AsString(pystring)); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d7cb67454df] master: Cleanup: match call signature for UI unit number evaluation
Commit: d7cb67454df75cf17882d7fa742ba40eec347105 Author: Campbell Barton Date: Mon Jul 27 12:03:02 2020 +1000 Branches: master https://developer.blender.org/rBd7cb67454df75cf17882d7fa742ba40eec347105 Cleanup: match call signature for UI unit number evaluation Also rename ui_but_string_set_eval_num to ui_but_string_eval_number as it doesn't set any of the buttons values. === M source/blender/editors/interface/interface.c M source/blender/editors/interface/interface_handlers.c M source/blender/editors/interface/interface_intern.h === diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index cd4653c3026..8c4f337f2d9 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2800,25 +2800,33 @@ char *ui_but_string_get_dynamic(uiBut *but, int *r_str_size) return str; } -static bool ui_set_but_string_eval_num_unit(bContext *C, -uiBut *but, -const char *str, -double *r_value) +static bool ui_number_from_string_units( +bContext *C, const char *str, const int unit_type, const UnitSettings *unit, double *r_value) { + return user_string_to_number(C, str, unit, unit_type, r_value); +} + +static bool ui_number_from_string_units_with_but(bContext *C, + const char *str, + const uiBut *but, + double *r_value) +{ + const int unit_type = RNA_SUBTYPE_UNIT_VALUE(UI_but_unit_type_get(but)); const UnitSettings *unit = but->block->unit; - int type = RNA_SUBTYPE_UNIT_VALUE(UI_but_unit_type_get(but)); - return user_string_to_number(C, str, unit, type, r_value); + return ui_number_from_string_units(C, str, unit_type, unit, r_value); } static bool ui_number_from_string(bContext *C, const char *str, double *r_value) { + bool ok; #ifdef WITH_PYTHON - return BPY_execute_string_as_number(C, NULL, str, true, r_value); + ok = BPY_execute_string_as_number(C, NULL, str, true, r_value); #else UNUSED_VARS(C); *r_value = atof(str); - return true; + ok = true; #endif + return ok; } static bool ui_number_from_string_factor(bContext *C, const char *str, double *r_value) @@ -2852,7 +2860,7 @@ static bool ui_number_from_string_percentage(bContext *C, const char *str, doubl return ui_number_from_string(C, str, r_value); } -bool ui_but_string_set_eval_num(bContext *C, uiBut *but, const char *str, double *r_value) +bool ui_but_string_eval_number(bContext *C, const uiBut *but, const char *str, double *r_value) { if (str[0] == '\0') { *r_value = 0.0; @@ -2866,7 +2874,7 @@ bool ui_but_string_set_eval_num(bContext *C, uiBut *but, const char *str, double if (ui_but_is_float(but)) { if (ui_but_is_unit(but)) { - return ui_set_but_string_eval_num_unit(C, but, str, r_value); + return ui_number_from_string_units_with_but(C, str, but, r_value); } if (subtype == PROP_FACTOR) { return ui_number_from_string_factor(C, str, r_value); @@ -3006,7 +3014,7 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str) /* number editing */ double value; -if (ui_but_string_set_eval_num(C, but, str, ) == false) { +if (ui_but_string_eval_number(C, but, str, ) == false) { WM_report_banner_show(); return false; } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 88ad5d8fec1..1128cceb6e3 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2364,7 +2364,7 @@ static void ui_but_paste_numeric_value(bContext *C, { double value; - if (ui_but_string_set_eval_num(C, but, buf_paste, )) { + if (ui_but_string_eval_number(C, but, buf_paste, )) { button_activate_state(C, but, BUTTON_STATE_NUM_EDITING); data->value = value; ui_but_string_set(C, but, buf_paste); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 249134c6abf..49d9561a75f 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -517,10 +517,10 @@ extern void ui_but_string_get(uiBut *but, char *str, const size_t maxlen) ATTR_N extern char *ui_but_string_get_dynamic(uiBut *but, int *r_str_size); extern void ui_but_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen) ATTR_NONNULL(); extern bool ui_but_string_set(struct bContext *C, uiBut *but, const char *str) ATTR_NONNULL(); -extern bool ui_but_string_set_eval_num(struct
[Bf-blender-cvs] [b18c376946b] master: Cleanup: quiet warnings without DDS
Commit: b18c376946bc205c5cb35214478862fd0548bf9f Author: Campbell Barton Date: Mon Jul 27 21:00:21 2020 +1000 Branches: master https://developer.blender.org/rBb18c376946bc205c5cb35214478862fd0548bf9f Cleanup: quiet warnings without DDS === M source/blender/gpu/intern/gpu_texture_image.cc === diff --git a/source/blender/gpu/intern/gpu_texture_image.cc b/source/blender/gpu/intern/gpu_texture_image.cc index 97c74c83230..5b53ba0544b 100644 --- a/source/blender/gpu/intern/gpu_texture_image.cc +++ b/source/blender/gpu/intern/gpu_texture_image.cc @@ -482,6 +482,8 @@ static uint gpu_texture_create_from_ibuf(Image *ima, ImBuf *ibuf, eGPUTextureTar gpu_create_gl_tex_compressed(, textarget, ima, ibuf); return bindcode; } +#else + (void)gpu_create_gl_tex_compressed; #endif /* Regular uncompressed texture. */ @@ -1232,7 +1234,7 @@ bool GPU_upload_dxt_texture(ImBuf *ibuf, bool use_srgb, uint *bindcode) glBindTexture(GL_TEXTURE_2D, 0); return true; #else - UNUSED_VARS(ibuf, use_srgb); + UNUSED_VARS(ibuf, use_srgb, bindcode); return false; #endif } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7beef1fd33b] master: PyAPI: simplify syntax error reports
Commit: 7beef1fd33b37f62d14a7de7150cfc7b0d88f159 Author: Campbell Barton Date: Mon Jul 27 13:46:51 2020 +1000 Branches: master https://developer.blender.org/rB7beef1fd33b37f62d14a7de7150cfc7b0d88f159 PyAPI: simplify syntax error reports The result of syntax errors read poorly in reports, resulting in cryptic and unhelpful information. Change PyC_ExceptionBuffer_Simple only to extract the initial text, making syntax errors when entering invalid numeric expressions into buttons easier to follow. === M source/blender/python/generic/py_capi_utils.c === diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index f46588206ee..406dbdafe22 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -634,7 +634,7 @@ error_cleanup: PyObject *PyC_ExceptionBuffer_Simple(void) { - PyObject *string_io_buf; + PyObject *string_io_buf = NULL; PyObject *error_type, *error_value, *error_traceback; @@ -648,7 +648,19 @@ PyObject *PyC_ExceptionBuffer_Simple(void) return NULL; } - string_io_buf = PyObject_Str(error_value); + if (PyErr_GivenExceptionMatches(error_type, PyExc_SyntaxError)) { +/* Special exception for syntax errors, + * in these cases the full error is verbose and not very useful, + * just use the initial text so we know what the error is. */ +if (PyTuple_CheckExact(error_value) && PyTuple_GET_SIZE(error_value) >= 1) { + string_io_buf = PyObject_Str(PyTuple_GET_ITEM(error_value, 0)); +} + } + + if (string_io_buf == NULL) { +string_io_buf = PyObject_Str(error_value); + } + /* Python does this too */ if (UNLIKELY(string_io_buf == NULL)) { string_io_buf = PyUnicode_FromFormat("", Py_TYPE(error_value)->tp_name); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [565d7f75ccf] master: UI: improve errors when evaluating a number button fails
Commit: 565d7f75ccfe955821991793fcd6335e58b6825b Author: Campbell Barton Date: Mon Jul 27 13:46:58 2020 +1000 Branches: master https://developer.blender.org/rB565d7f75ccfe955821991793fcd6335e58b6825b UI: improve errors when evaluating a number button fails Showing the Python error without any explanation is often not enough information and doesn't hint that the error was in the user input. The error report from a invalid expression such as '..1' used to be: ('invalid syntax', ('', 1, 1, '..1')) Now reads: Error evaluating number, see Info editor for details: invalid syntax Address issue raised by T78913. === M source/blender/editors/include/ED_numinput.h M source/blender/editors/interface/interface.c M source/blender/editors/interface/interface_context_menu.c M source/blender/editors/interface/interface_region_tooltip.c M source/blender/editors/util/numinput.c M source/blender/python/BPY_extern.h M source/blender/python/intern/bpy_capi_utils.c M source/blender/python/intern/bpy_capi_utils.h M source/blender/python/intern/bpy_interface.c === diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h index 8c8f3e6f4a3..16d05a7793a 100644 --- a/source/blender/editors/include/ED_numinput.h +++ b/source/blender/editors/include/ED_numinput.h @@ -103,8 +103,12 @@ bool handleNumInput(struct bContext *C, NumInput *n, const struct wmEvent *event #define NUM_MODAL_INCREMENT_UP 18 #define NUM_MODAL_INCREMENT_DOWN 19 -bool user_string_to_number( -bContext *C, const char *str, const struct UnitSettings *unit, int type, double *r_value); +bool user_string_to_number(bContext *C, + const char *str, + const struct UnitSettings *unit, + int type, + const char *error_prefix, + double *r_value); /** \} */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 8c4f337f2d9..9441e48ef24 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2800,10 +2800,16 @@ char *ui_but_string_get_dynamic(uiBut *but, int *r_str_size) return str; } +/** + * Report a generic error prefix when evaluating a string with #BPY_execute_string_as_number + * as the Python error on it's own doesn't provide enough context. + */ +#define UI_NUMBER_EVAL_ERROR_PREFIX IFACE_("Error evaluating number, see Info editor for details") + static bool ui_number_from_string_units( bContext *C, const char *str, const int unit_type, const UnitSettings *unit, double *r_value) { - return user_string_to_number(C, str, unit, unit_type, r_value); + return user_string_to_number(C, str, unit, unit_type, UI_NUMBER_EVAL_ERROR_PREFIX, r_value); } static bool ui_number_from_string_units_with_but(bContext *C, @@ -2820,7 +2826,7 @@ static bool ui_number_from_string(bContext *C, const char *str, double *r_value) { bool ok; #ifdef WITH_PYTHON - ok = BPY_execute_string_as_number(C, NULL, str, true, r_value); + ok = BPY_execute_string_as_number(C, NULL, str, UI_NUMBER_EVAL_ERROR_PREFIX, r_value); #else UNUSED_VARS(C); *r_value = atof(str); diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index a08c5c45b6f..aaa5e1c0cf1 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -407,7 +407,7 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um) "'%s').label", idname); char *expr_result = NULL; - if (BPY_execute_string_as_string(C, expr_imports, expr, true, _result)) { + if (BPY_execute_string_as_string(C, expr_imports, expr, __func__, _result)) { STRNCPY(drawstr, expr_result); MEM_freeN(expr_result); } diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index 46814e11b9e..7c64e4c2709 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -433,7 +433,7 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but, bool is if (has_valid_context == false) { expr_result = BLI_strdup(has_valid_context_error); } -else if (BPY_execute_string_as_string(C, expr_imports, expr, true, _result)) { +else if (BPY_execute_string_as_string(C, expr_imports, expr, __func__, _result)) { if (STREQ(expr_result, "")) { MEM_freeN(expr_result); expr_result
[Bf-blender-cvs] [0b04f0e4e63] master: GPU: Fix crash and missing texture due to recent C++ port
Commit: 0b04f0e4e63ff88e493bedb6bd9ea4fe5b3557ca Author: Clément Foucault Date: Mon Jul 27 13:37:14 2020 +0200 Branches: master https://developer.blender.org/rB0b04f0e4e63ff88e493bedb6bd9ea4fe5b3557ca GPU: Fix crash and missing texture due to recent C++ port Fix T79306 DRW: small issues with yesterday commits modifying TEXTARGET Fix T79303 Image texture node crashes EEVEE when connected to a shader output === M source/blender/draw/intern/draw_manager_data.c M source/blender/gpu/GPU_draw.h M source/blender/gpu/GPU_texture.h M source/blender/gpu/intern/gpu_texture.c M source/blender/gpu/intern/gpu_texture_image.cc M source/blender/makesdna/DNA_image_types.h === diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index 9d8050504ab..a8105785d53 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -1295,7 +1295,7 @@ static void drw_shgroup_material_texture(DRWShadingGroup *grp, GPUMaterialTexture *tex, const char *name, eGPUSamplerState state, - int textarget) + eGPUTextureTarget textarget) { GPUTexture *gputex = GPU_texture_from_blender(tex->ima, tex->iuser, NULL, textarget); @@ -1316,13 +1316,13 @@ void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, struct GPUMaterial /* Image */ if (tex->tiled_mapping_name[0]) { drw_shgroup_material_texture( -grp, tex, tex->sampler_name, tex->sampler_state, GL_TEXTURE_2D_ARRAY); +grp, tex, tex->sampler_name, tex->sampler_state, TEXTARGET_2D_ARRAY); drw_shgroup_material_texture( -grp, tex, tex->tiled_mapping_name, tex->sampler_state, GL_TEXTURE_1D_ARRAY); +grp, tex, tex->tiled_mapping_name, tex->sampler_state, TEXTARGET_TILE_MAPPING); } else { drw_shgroup_material_texture( -grp, tex, tex->sampler_name, tex->sampler_state, GL_TEXTURE_2D); +grp, tex, tex->sampler_name, tex->sampler_state, TEXTARGET_2D); } } else if (tex->colorband) { diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index b364bd0ef95..01af654b52f 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -58,21 +58,7 @@ float GPU_get_anisotropic(void); void GPU_paint_update_image( struct Image *ima, struct ImageUser *iuser, int x, int y, int w, int h); -void GPU_create_gl_tex(unsigned int *bind, - unsigned int *rect, - float *frect, - int rectw, - int recth, - int textarget, - bool mipmap, - bool half_float, - bool use_srgb, - struct Image *ima); -void GPU_create_gl_tex_compressed(unsigned int *bind, - int textarget, - struct Image *ima, - struct ImBuf *ibuf); -bool GPU_upload_dxt_texture(struct ImBuf *ibuf, bool use_srgb); +bool GPU_upload_dxt_texture(struct ImBuf *ibuf, bool use_srgb, uint *bindcode); void GPU_free_image(struct Image *ima); void GPU_free_images(struct Main *bmain); void GPU_free_images_anim(struct Main *bmain); diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 813ee71eb22..d7f5d6272f4 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -41,6 +41,15 @@ struct PreviewImage; struct GPUFrameBuffer; typedef struct GPUTexture GPUTexture; +/* Used to get the correct gpu texture from an Image datablock. */ +typedef enum eGPUTextureTarget { + TEXTARGET_2D = 0, + TEXTARGET_CUBE_MAP, + TEXTARGET_2D_ARRAY, + TEXTARGET_TILE_MAPPING, + TEXTARGET_COUNT, +} eGPUTextureTarget; + /* GPU Samplers state * - Specify the sampler state to bind a texture with. * - Internally used by textures. @@ -222,16 +231,16 @@ GPUTexture *GPU_texture_create_cube_array( GPUTexture *GPU_texture_create_from_vertbuf(struct GPUVertBuf *vert); GPUTexture *GPU_texture_create_buffer(eGPUTextureFormat data_type, const uint buffer); -GPUTexture *GPU_texture_from_bindcode(int textarget, int bindcode); +GPUTexture *GPU_texture_from_bindcode(eGPUTextureTarget target, int bindcode); GPUTexture *GPU_texture_from_blender(struct Image *ima, struct ImageUser *iuser, struct ImBuf *ibuf, - int textarget); +
[Bf-blender-cvs] [e94a4b140a8] greasepencil-object: GPencil: Cleanup code
Commit: e94a4b140a8d1de3c37a365f553762a64f0c2162 Author: Antonio Vazquez Date: Mon Jul 27 12:24:25 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rBe94a4b140a8d1de3c37a365f553762a64f0c2162 GPencil: Cleanup code === M source/blender/io/gpencil/intern/gpencil_io_svg.cc === diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index 06da41c0740..6a4baa05a72 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -149,24 +149,30 @@ void GpencilExporterSVG::export_style_list(void) bool is_fill = ((gp_style->flag & GP_MATERIAL_FILL_SHOW) && (gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH)); +int id = i + 1; + if (is_stroke) { - txt.append("\n\t.style_stroke_"); - txt.append(std::to_string(i + 1).c_str()); + char out[128]; linearrgb_to_srgb_v3_v3(col, gp_style->stroke_rgba); - txt.append("{"); - txt.append("stroke:" + rgb_to_hex(col) + ";"); - txt.append("fill:" + rgb_to_hex(col) + ";"); - txt.append("}"); + std::string stroke_hex = rgb_to_hex(col); + sprintf(out, + "\n\t.style_stroke_%d{stroke: %s; fill: %s;}", + id, + stroke_hex.c_str(), + stroke_hex.c_str()); + txt.append(out); } if (is_fill) { - txt.append("\n\t.style_fill_"); - txt.append(std::to_string(i + 1).c_str()); + char out[128]; linearrgb_to_srgb_v3_v3(col, gp_style->fill_rgba); - txt.append("{"); - txt.append("stroke:" + rgb_to_hex(col) + ";"); - txt.append("fill:" + rgb_to_hex(col) + ";"); - txt.append("}"); + std::string stroke_hex = rgb_to_hex(col); + sprintf(out, + "\n\t.style_fill_%d{stroke: %s; fill: %s;}", + id, + stroke_hex.c_str(), + stroke_hex.c_str()); + txt.append(out); } } txt.append("\n\t"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d9ab1961340] greasepencil-object: GPencil: Preparation to export point to SVG as circles
Commit: d9ab19613402e60426298f2ebba47ca33e742117 Author: Antonio Vazquez Date: Mon Jul 27 10:58:02 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rBd9ab19613402e60426298f2ebba47ca33e742117 GPencil: Preparation to export point to SVG as circles Still wip. === M source/blender/io/gpencil/intern/gpencil_io_base.cc M source/blender/io/gpencil/intern/gpencil_io_base.h M source/blender/io/gpencil/intern/gpencil_io_svg.cc M source/blender/io/gpencil/intern/gpencil_io_svg.h === diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc index e6a2c132120..528a5d16112 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc @@ -117,6 +117,7 @@ std::string GpencilExporter::rgb_to_hex(float color[3]) std::string GpencilExporter::to_lower_string(char *input_text) { ::std::string text = input_text; + /* First remove any point of the string. */ size_t found = text.find_first_of("."); while (found != std::string::npos) { text[found] = '_'; diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.h b/source/blender/io/gpencil/intern/gpencil_io_base.h index 48f419de1aa..28e0650f5e1 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.h +++ b/source/blender/io/gpencil/intern/gpencil_io_base.h @@ -53,6 +53,8 @@ class GpencilExporter { protected: GpencilExportParams params; char out_filename[FILE_MAX]; + /* Data for easy access. */ + struct bGPdata *gpd; }; } // namespace gpencil diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc index 10eb6521034..06da41c0740 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc @@ -69,6 +69,8 @@ GpencilExporterSVG::GpencilExporterSVG(const struct GpencilExportParams *params) this->params.filename = params->filename; this->params.mode = params->mode; + this->gpd = (bGPdata *)params->ob->data; + /* Prepare output filename with full path. */ set_out_filename(params->C, params->filename); } @@ -209,43 +211,86 @@ void GpencilExporterSVG::export_layers(void) BKE_gpencil_parent_matrix_get(depsgraph, ob, gpl, diff_mat); LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) { + if (gps->totpoints == 0) { +continue; + } + MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1); bool is_stroke = ((gp_style->flag & GP_MATERIAL_STROKE_SHOW) && (gp_style->stroke_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH)); bool is_fill = ((gp_style->flag & GP_MATERIAL_FILL_SHOW) && (gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH)); - /* Fill. */ - if (is_fill) { -export_stroke(gpl_node, gps, diff_mat, true); + if (gps->totpoints == 1) { +export_point(gpl_node, gpl, gps, diff_mat); } - - /* Stroke. */ - if (is_stroke) { -/* Create a duplicate to avoid any transformation. */ -bGPDstroke *gps_tmp = BKE_gpencil_stroke_duplicate(gps, true); -bGPDstroke *gps_perimeter = BKE_gpencil_stroke_perimeter_from_view( -rv3d, gpd, gpl, gps_tmp, 3, diff_mat); - -/* Reproject and sample stroke. */ -// ED_gpencil_project_stroke_to_view(params.C, gpl, gps_perimeter); -BKE_gpencil_stroke_sample(gps_perimeter, 0.03f, false); - -export_stroke(gpl_node, gps_perimeter, diff_mat, false); - -BKE_gpencil_free_stroke(gps_perimeter); -BKE_gpencil_free_stroke(gps_tmp); + else { +/* Fill. */ +if (is_fill) { + export_stroke(gpl_node, gps, diff_mat, true); +} + +/* Stroke. */ +if (is_stroke) { + /* Create a duplicate to avoid any transformation. */ + bGPDstroke *gps_tmp = BKE_gpencil_stroke_duplicate(gps, true); + bGPDstroke *gps_perimeter = BKE_gpencil_stroke_perimeter_from_view( + rv3d, gpd, gpl, gps_tmp, 3, diff_mat); + + /* Reproject and sample stroke. */ + // ED_gpencil_project_stroke_to_view(params.C, gpl, gps_perimeter); + BKE_gpencil_stroke_sample(gps_perimeter, 0.03f, false); + + export_stroke(gpl_node, gps_perimeter, diff_mat, false); + + BKE_gpencil_free_stroke(gps_perimeter); + BKE_gpencil_free_stroke(gps_tmp); +} } } } } +/** + * Export a point + * \param gpl_node: Node of the layer. + * \param gps: Stroke to export. + * \param diff_mat: Transformation matrix. + */ +void GpencilExporterSVG::export_point(pugi::xml_node gpl_node, + struct bGPDlayer *gpl, +
[Bf-blender-cvs] [78f29f6c0a1] soc-2020-io-performance: Fix build error due to forward enum declaration
Commit: 78f29f6c0a169c3cefd415fb8fb8e5a1d9d8bf60 Author: Ankit Meel Date: Mon Jul 27 13:38:08 2020 +0530 Branches: soc-2020-io-performance https://developer.blender.org/rB78f29f6c0a169c3cefd415fb8fb8e5a1d9d8bf60 Fix build error due to forward enum declaration In full build, the following error happens. So fix it by including the definition file before the forward declaration one. ``` In file included from source/blender/io/collada/SkinInfo.cpp:40: source/blender/blenkernel/BKE_object_deform.h:62:6: error: enumeration previously declared with nonfixed underlying type enum eVGroupSelect ^ In file included from source/blender/io/collada/SkinInfo.cpp:36: source/blender/makesdna/DNA_scene_types.h:2099:14: note: previous declaration is here typedef enum eVGroupSelect { ^ 1 error generated. ``` === M source/blender/blenkernel/BKE_object_deform.h M source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.cc === diff --git a/source/blender/blenkernel/BKE_object_deform.h b/source/blender/blenkernel/BKE_object_deform.h index 2d2f8fb3389..e4813aa2288 100644 --- a/source/blender/blenkernel/BKE_object_deform.h +++ b/source/blender/blenkernel/BKE_object_deform.h @@ -59,11 +59,7 @@ void BKE_object_defgroup_index_map_apply(struct MDeformVert *dvert, int map_len); /* Select helpers */ -enum eVGroupSelect -#ifdef __cplusplus - : int -#endif - ; +enum eVGroupSelect; bool *BKE_object_defgroup_subset_from_select_type(struct Object *ob, enum eVGroupSelect subset_type, int *r_defgroup_tot, diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.cc index 7bdfbc49654..e935da159b5 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.cc +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.cc @@ -21,6 +21,8 @@ * \ingroup obj */ +#include "DNA_scene_types.h" /* For eVGroupSelect. */ + #include "BKE_customdata.h" #include "BKE_object_deform.h" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a59bbede215] soc-2020-io-performance: Merge branch 'master' into soc-2020-io-performance
Commit: a59bbede2159342997e9a6137c34559c0fb1086e Author: Ankit Meel Date: Mon Jul 27 14:31:03 2020 +0530 Branches: soc-2020-io-performance https://developer.blender.org/rBa59bbede2159342997e9a6137c34559c0fb1086e Merge branch 'master' into soc-2020-io-performance === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [418753b6a65] master: GPU: fix build error due to wrong linkage specification
Commit: 418753b6a65e983aa45762531370f943e931341e Author: Jacques Lucke Date: Mon Jul 27 11:40:47 2020 +0200 Branches: master https://developer.blender.org/rB418753b6a65e983aa45762531370f943e931341e GPU: fix build error due to wrong linkage specification === M source/blender/gpu/GPU_platform.h === diff --git a/source/blender/gpu/GPU_platform.h b/source/blender/gpu/GPU_platform.h index d9b9ee2a308..104d5ef0ddc 100644 --- a/source/blender/gpu/GPU_platform.h +++ b/source/blender/gpu/GPU_platform.h @@ -27,10 +27,6 @@ #include "BLI_sys_types.h" #include "BLI_utildefines.h" -#ifdef __cplusplus -extern "C" { -#endif - /* GPU platform support */ /* GPU Types */ @@ -66,6 +62,10 @@ typedef enum eGPUSupportLevel { GPU_SUPPORT_LEVEL_UNSUPPORTED, } eGPUSupportLevel; +#ifdef __cplusplus +extern "C" { +#endif + bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver); eGPUSupportLevel GPU_platform_support_level(void); const char *GPU_platform_support_level_key(void); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [00fd20d7227] soc-2020-info-editor: Merge branch 'master' into soc-2020-info-editor
Commit: 00fd20d7227f36c29fd5ce4fdab19112483339f6 Author: Mateusz Grzeliński Date: Mon Jul 27 09:59:44 2020 +0200 Branches: soc-2020-info-editor https://developer.blender.org/rB00fd20d7227f36c29fd5ce4fdab19112483339f6 Merge branch 'master' into soc-2020-info-editor === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bfeb94ecccb] master: Cleanup: quiet warning
Commit: bfeb94ecccbf9222ef46294db88ca678e3c529fc Author: Jacques Lucke Date: Mon Jul 27 11:41:51 2020 +0200 Branches: master https://developer.blender.org/rBbfeb94ecccbf9222ef46294db88ca678e3c529fc Cleanup: quiet warning === M source/blender/blenkernel/intern/sequencer.c === diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 4b2d42c704e..b16fc08a4af 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -6054,9 +6054,9 @@ bool BKE_sequencer_render_loop_check(Sequence *seq_main, Sequence *seq) return true; } - if (seq_main->seq1 && BKE_sequencer_render_loop_check(seq_main->seq1, seq) || - seq_main->seq2 && BKE_sequencer_render_loop_check(seq_main->seq2, seq) || - seq_main->seq3 && BKE_sequencer_render_loop_check(seq_main->seq3, seq)) { + if ((seq_main->seq1 && BKE_sequencer_render_loop_check(seq_main->seq1, seq)) || + (seq_main->seq2 && BKE_sequencer_render_loop_check(seq_main->seq2, seq)) || + (seq_main->seq3 && BKE_sequencer_render_loop_check(seq_main->seq3, seq))) { return true; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0e478f2acc7] soc-2020-greasepencil-curve: Merge branch 'greasepencil-edit-curve' into soc-2020-greasepencil-curve
Commit: 0e478f2acc780df98b64cffd155ae7ae56c3d54a Author: Falk David Date: Mon Jul 27 00:23:56 2020 +0200 Branches: soc-2020-greasepencil-curve https://developer.blender.org/rB0e478f2acc780df98b64cffd155ae7ae56c3d54a Merge branch 'greasepencil-edit-curve' into soc-2020-greasepencil-curve === === diff --cc source/blender/blenkernel/intern/gpencil.c index 36e20d256ac,992efe4bdb5..e66e85ef1a7 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@@ -536,7 -536,7 +536,6 @@@ bGPdata *BKE_gpencil_data_addnew(Main * gpd->flag |= GP_DATA_VIEWALIGN; /* always enable object onion skin switch */ gpd->flag |= GP_DATA_SHOW_ONIONSKINS; - - /* GP object specific settings */ ARRAY_SET_ITEMS(gpd->line_color, 0.6f, 0.6f, 0.6f, 0.5f); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [aaa2da3e6de] lanpr-under-gp: Merge branch 'master' into lanpr-under-gp
Commit: aaa2da3e6deaeffb258d22abc0cfd833f502e55e Author: Antonio Vazquez Date: Mon Jul 27 10:50:24 2020 +0200 Branches: lanpr-under-gp https://developer.blender.org/rBaaa2da3e6deaeffb258d22abc0cfd833f502e55e Merge branch 'master' into lanpr-under-gp === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b2356b4c74d] greasepencil-object: Merge branch 'master' into greasepencil-object
Commit: b2356b4c74d33b2b7223895405fba03b2876fdfc Author: Antonio Vazquez Date: Mon Jul 27 10:50:08 2020 +0200 Branches: greasepencil-object https://developer.blender.org/rBb2356b4c74d33b2b7223895405fba03b2876fdfc Merge branch 'master' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e64504ec044] greasepencil-edit-curve: Merge branch 'master' into greasepencil-edit-curve
Commit: e64504ec0448d95e8c6657e0a3ac2b5394fcff79 Author: Antonio Vazquez Date: Mon Jul 27 10:49:51 2020 +0200 Branches: greasepencil-edit-curve https://developer.blender.org/rBe64504ec0448d95e8c6657e0a3ac2b5394fcff79 Merge branch 'master' into greasepencil-edit-curve === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [382b9007f8f] master: GPencil: New operator to Cleanup duplicated frames
Commit: 382b9007f8f3627bf27cf708b744e8da7f2c8a14 Author: Antonio Vazquez Date: Mon Jul 27 10:41:21 2020 +0200 Branches: master https://developer.blender.org/rB382b9007f8f3627bf27cf708b744e8da7f2c8a14 GPencil: New operator to Cleanup duplicated frames This operator cleanup any frame that is equal to the previous one. This is very handy when convert a mesh animation to Gpencil and the mesh is static for several frames. Differential Revision: https://developer.blender.org/D8149 === M release/scripts/startup/bl_ui/properties_grease_pencil_common.py M source/blender/editors/gpencil/gpencil_data.c M source/blender/editors/gpencil/gpencil_intern.h M source/blender/editors/gpencil/gpencil_ops.c === diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 4d6ddb55f24..f16528103ff 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -405,6 +405,7 @@ class GPENCIL_MT_cleanup(Menu): layout = self.layout layout.operator("gpencil.frame_clean_loose", text="Delete Loose Points") +layout.operator("gpencil.frame_clean_duplicate", text="Delete Duplicated Frames") if ob.mode != 'PAINT_GPENCIL': layout.operator("gpencil.stroke_merge_by_distance", text="Merge by Distance") diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 96b0296a7de..348fb614977 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -861,6 +861,154 @@ void GPENCIL_OT_frame_clean_loose(wmOperatorType *ot) INT_MAX); } +/* * Clean Duplicated Frames ** */ +static bool gpencil_frame_is_equal(bGPDframe *gpf_a, bGPDframe *gpf_b) +{ + if ((gpf_a == NULL) || (gpf_b == NULL)) { +return false; + } + /* If the number of strokes is different, cannot be equal. */ + int totstrokes_a = BLI_listbase_count(_a->strokes); + int totstrokes_b = BLI_listbase_count(_b->strokes); + if ((totstrokes_a == 0) || (totstrokes_b == 0) || (totstrokes_a != totstrokes_b)) { +return false; + } + /* Loop all strokes and check. */ + bGPDstroke *gps_a = gpf_a->strokes.first; + bGPDstroke *gps_b = gpf_b->strokes.first; + for (int i = 0; i < totstrokes_a; i++) { +/* If the number of points is different, cannot be equal. */ +if (gps_a->totpoints != gps_b->totpoints) { + return false; +} +/* Check other variables. */ +if (!equals_v4v4(gps_a->vert_color_fill, gps_b->vert_color_fill)) { + return false; +} +if (gps_a->thickness != gps_b->thickness) { + return false; +} +if (gps_a->mat_nr != gps_b->mat_nr) { + return false; +} +if (gps_a->caps[0] != gps_b->caps[0]) { + return false; +} +if (gps_a->caps[1] != gps_b->caps[1]) { + return false; +} +if (gps_a->hardeness != gps_b->hardeness) { + return false; +} +if (!equals_v2v2(gps_a->aspect_ratio, gps_b->aspect_ratio)) { + return false; +} +if (gps_a->uv_rotation != gps_b->uv_rotation) { + return false; +} +if (!equals_v2v2(gps_a->uv_translation, gps_b->uv_translation)) { + return false; +} +if (gps_a->uv_scale != gps_b->uv_scale) { + return false; +} + +/* Loop points and check if equals or not. */ +for (int p = 0; p < gps_a->totpoints; p++) { + bGPDspoint *pt_a = _a->points[p]; + bGPDspoint *pt_b = _b->points[p]; + if (!equals_v3v3(_a->x, _b->x)) { +return false; + } + if (pt_a->pressure != pt_b->pressure) { +return false; + } + if (pt_a->strength != pt_b->strength) { +return false; + } + if (pt_a->uv_fac != pt_b->uv_fac) { +return false; + } + if (pt_a->uv_rot != pt_b->uv_rot) { +return false; + } + if (!equals_v4v4(pt_a->vert_color, pt_b->vert_color)) { +return false; + } +} + +/* Look at next pair of strokes. */ +gps_a = gps_a->next; +gps_b = gps_b->next; + } + + return true; +} + +static int gpencil_frame_clean_duplicate_exec(bContext *C, wmOperator *op) +{ +#define SELECTED 1 + + bool changed = false; + Object *ob = CTX_data_active_object(C); + bGPdata *gpd = (bGPdata *)ob->data; + const int type = RNA_enum_get(op->ptr, "type"); + + LISTBASE_FOREACH (bGPDlayer *, gpl, >layers) { +/* Only editable and visible layers are considered. */ +if (BKE_gpencil_layer_is_editable(gpl) && (gpl->frames.first != NULL)) { + bGPDframe *gpf = gpl->frames.first; + + if ((type == SELECTED) && ((gpf->flag & GP_FRAME_SELECT) == 0)) { +continue; +
[Bf-blender-cvs] [f31fa3eb97b] master: Merge branch 'blender-v2.90-release'
Commit: f31fa3eb97b0815f423a685cbbd907bc3fff7a12 Author: Sebastián Barschkis Date: Mon Jul 27 10:32:38 2020 +0200 Branches: master https://developer.blender.org/rBf31fa3eb97b0815f423a685cbbd907bc3fff7a12 Merge branch 'blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ea4a00e93b5] blender-v2.90-release: Fluid: Fix warnings from max particle option
Commit: ea4a00e93b515ed30feaaee16c3272cffe0f0c9d Author: Sebastián Barschkis Date: Mon Jul 27 10:32:12 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rBea4a00e93b515ed30feaaee16c3272cffe0f0c9d Fluid: Fix warnings from max particle option -Wreorder was the issue. === M extern/mantaflow/preprocessed/particle.cpp === diff --git a/extern/mantaflow/preprocessed/particle.cpp b/extern/mantaflow/preprocessed/particle.cpp index 9561365af3d..8c26156358d 100644 --- a/extern/mantaflow/preprocessed/particle.cpp +++ b/extern/mantaflow/preprocessed/particle.cpp @@ -29,7 +29,7 @@ using namespace std; namespace Manta { ParticleBase::ParticleBase(FluidSolver *parent) -: PbClass(parent), mAllowCompress(true), mFreePdata(false), mMaxParticles(0) +: PbClass(parent), mMaxParticles(0), mAllowCompress(true), mFreePdata(false) { } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d906116eba7] blender-v2.90-release: Cleanup: comments.
Commit: d906116eba70e40900f53f5a53fcdfb4d4b7b834 Author: Bastien Montagne Date: Fri Jul 24 15:09:58 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rBd906116eba70e40900f53f5a53fcdfb4d4b7b834 Cleanup: comments. === M source/blender/blenkernel/intern/lib_override.c === diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 1e2c8f0286d..2989c910c45 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -394,7 +394,8 @@ static bool lib_override_hierarchy_recursive_tag(Main *bmain, ID *id, const uint } /** - * Tag all IDs in given \a bmain that use (depends on) given \a id_root ID. + * Tag all IDs in given \a bmain that are being used by given \a id_root ID or its dependencies, + * recursively. * * This will include all local IDs, and all IDs from the same library as the \a id_root. * ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [041904ceb89] blender-v2.90-release: Cleanup: Minor renaming.
Commit: 041904ceb8963dc276c61cce424bf38c99a9bb30 Author: Bastien Montagne Date: Fri Jul 24 11:10:26 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB041904ceb8963dc276c61cce424bf38c99a9bb30 Cleanup: Minor renaming. === M source/blender/blenkernel/intern/lib_override.c === diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 2a5782a5509..1e2c8f0286d 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1167,7 +1167,7 @@ void BKE_lib_override_library_main_operations_create(Main *bmain, const bool for static bool lib_override_library_id_reset_do(Main *bmain, ID *id_root) { - bool was_property_deleted = false; + bool was_op_deleted = false; LISTBASE_FOREACH_MUTABLE ( IDOverrideLibraryProperty *, op, _root->override_library->properties) { @@ -1208,18 +1208,18 @@ static bool lib_override_library_id_reset_do(Main *bmain, ID *id_root) if (do_op_delete) { BKE_lib_override_library_property_delete(id_root->override_library, op); - was_property_deleted = true; + was_op_deleted = true; } } - if (was_property_deleted) { + if (was_op_deleted) { DEG_id_tag_update_ex(bmain, id_root, ID_RECALC_COPY_ON_WRITE); IDOverrideLibraryRuntime *override_runtime = override_library_rna_path_runtime_ensure( id_root->override_library); override_runtime->tag |= IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RELOAD; } - return was_property_deleted; + return was_op_deleted; } /** Reset all overrides in given \a id_root, while preserving ID relations. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [93e6ed9b451] master: Merge branch 'blender-v2.90-release'
Commit: 93e6ed9b451de20bec9e65e9908cc07d8b25fd21 Author: Bastien Montagne Date: Mon Jul 27 10:26:00 2020 +0200 Branches: master https://developer.blender.org/rB93e6ed9b451de20bec9e65e9908cc07d8b25fd21 Merge branch 'blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [40a95246379] master: Merge branch 'blender-v2.90-release'
Commit: 40a9524637908ff80cf8a0d99853b2ee6636a5fe Author: Jacques Lucke Date: Mon Jul 27 10:24:53 2020 +0200 Branches: master https://developer.blender.org/rB40a9524637908ff80cf8a0d99853b2ee6636a5fe Merge branch 'blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [87fb12d16e4] blender-v2.90-release: Allocator: fix build error with -Werror=format-security
Commit: 87fb12d16e4fab82385538a2ad8865d3ef3dca7a Author: Jacques Lucke Date: Mon Jul 27 10:23:20 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB87fb12d16e4fab82385538a2ad8865d3ef3dca7a Allocator: fix build error with -Werror=format-security Doing it again here, because I fixed this only in master branch before.. === M intern/guardedalloc/intern/mallocn_lockfree_impl.c === diff --git a/intern/guardedalloc/intern/mallocn_lockfree_impl.c b/intern/guardedalloc/intern/mallocn_lockfree_impl.c index 282c852fedd..b71e2c963eb 100644 --- a/intern/guardedalloc/intern/mallocn_lockfree_impl.c +++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.c @@ -102,7 +102,7 @@ size_t MEM_lockfree_allocN_len(const void *vmemh) void MEM_lockfree_freeN(void *vmemh) { if (leak_detector_has_run) { -print_error(free_after_leak_detection_message); +print_error("%s\n", free_after_leak_detection_message); } MemHead *memh = MEMHEAD_FROM_PTR(vmemh); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [67d86f310c5] soc-2020-info-editor: Cleanup: memory does not need to be allocated
Commit: 67d86f310c580f19e2996a49fa2c8e02643ac171 Author: Mateusz Grzeliński Date: Mon Jul 27 09:59:02 2020 +0200 Branches: soc-2020-info-editor https://developer.blender.org/rB67d86f310c580f19e2996a49fa2c8e02643ac171 Cleanup: memory does not need to be allocated === M source/blender/editors/space_info/textview.c === diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index fb147ad7059..76bf1337826 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -449,11 +449,6 @@ int textview_draw(TextViewContext *tvc, BLI_assert(!BLI_listbase_is_empty(_lines)); if (do_draw) { -TextLine *text_line_iter = text_lines.first; -while (text_line_iter) { - text_line_iter->format = MEM_callocN(text_line_iter->len + 2, __func__); - text_line_iter = text_line_iter->next; -} data_flag = tvc->line_draw_data(tvc, text_lines.first, fg, bg, , icon_fg, icon_bg); assert(data_flag & TVC_LINE_FG_SIMPLE || data_flag & TVC_LINE_FG_COMPLEX); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [30aeba1356d] soc-2020-info-editor: Cleanup bring back assert
Commit: 30aeba1356d340cb78a774fec30ac825139bf84f Author: Mateusz Grzeliński Date: Mon Jul 27 09:58:22 2020 +0200 Branches: soc-2020-info-editor https://developer.blender.org/rB30aeba1356d340cb78a774fec30ac825139bf84f Cleanup bring back assert === M source/blender/editors/space_console/console_draw.c === diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index 3dbe245d333..1c2a2928e5a 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -138,16 +138,16 @@ static void console_textview_line_get(TextViewContext *tvc, ListBase *text_lines { const ConsoleLine *cl_current = tvc->iter; const ConsoleLine *cl_iter = tvc->iter; + BLI_assert(BLI_listbase_is_empty(text_lines)); do { TextLine *text_line = MEM_callocN(sizeof(*text_line), __func__); text_line->line = cl_iter->line; text_line->len = cl_iter->len; BLI_addhead(text_lines, text_line); +BLI_assert(cl_iter->line[cl_iter->len] == '\0' && + (cl_iter->len == 0 || cl_iter->line[cl_iter->len - 1] != '\0')); cl_iter = cl_iter->prev; } while (cl_iter && cl_iter->type == cl_current->type); - - // BLI_assert(cl_iter->line[cl_iter->len] == '\0' && - // (cl_iter->len == 0 || cl_iter->line[cl_iter->len - 1] != '\0')); } static void console_cursor_wrap_offset( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6d42ffe03c4] master: Merge remote-tracking branch 'origin/blender-v2.90-release'
Commit: 6d42ffe03c4a209bedee5cab5d5a3fb866d79236 Author: Sybren A. Stüvel Date: Mon Jul 27 09:06:00 2020 +0200 Branches: master https://developer.blender.org/rB6d42ffe03c4a209bedee5cab5d5a3fb866d79236 Merge remote-tracking branch 'origin/blender-v2.90-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9b867f2e90b] blender-v2.90-release: Fix T79121: Dependency cycle when driver points to prop with 'scale' in name
Commit: 9b867f2e90bd5ba9c2e37ed39cf8b1ad28e39b07 Author: Sybren A. Stüvel Date: Mon Jul 27 08:53:32 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB9b867f2e90bd5ba9c2e37ed39cf8b1ad28e39b07 Fix T79121: Dependency cycle when driver points to prop with 'scale' in name This makes `RNANodeQuery::construct_node_identifier()` more strict in its matching of certain property names. The downside of this approach is that it's not possible any more to use `"rotation"` and expect a match for `"rotation_euler"` and friends, so the list of strings to test against is now 3x as long. Reviewed By: sergey Maniphest Tasks: T79121 Differential Revision: https://developer.blender.org/D8375 === M source/blender/depsgraph/CMakeLists.txt M source/blender/depsgraph/intern/builder/deg_builder_rna.cc M source/blender/depsgraph/intern/builder/deg_builder_rna.h A source/blender/depsgraph/intern/builder/deg_builder_rna_test.cc === diff --git a/source/blender/depsgraph/CMakeLists.txt b/source/blender/depsgraph/CMakeLists.txt index 839a3712129..51fce738700 100644 --- a/source/blender/depsgraph/CMakeLists.txt +++ b/source/blender/depsgraph/CMakeLists.txt @@ -147,3 +147,14 @@ set(LIB ) blender_add_lib(bf_depsgraph "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") + +if(WITH_GTESTS) + set(TEST_SRC +intern/builder/deg_builder_rna_test.cc + ) + set(TEST_LIB +bf_depsgraph + ) + include(GTestTesting) + blender_add_test_lib(bf_depsgraph_tests "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB}") +endif() diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index 98ae653d294..e3b667427a2 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -149,6 +149,25 @@ Node *RNANodeQuery::find_node(const PointerRNA *ptr, node_identifier.operation_name_tag); } +bool RNANodeQuery::contains(const char *prop_identifier, const char *rna_path_component) +{ + const char *substr = strstr(prop_identifier, rna_path_component); + if (substr == nullptr) { +return false; + } + + // If substr != prop_identifier, it means that the substring is found further in prop_identifier, + // and that thus index -1 is a valid memory location. + const bool start_ok = substr == prop_identifier || substr[-1] == '.'; + if (!start_ok) { +return false; + } + + const size_t component_len = strlen(rna_path_component); + const bool end_ok = ELEM(substr[component_len], '\0', '.', '['); + return end_ok; +} + RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, const PropertyRNA *prop, RNAPointerSource source) @@ -283,12 +302,20 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, if (prop != nullptr) { const char *prop_identifier = RNA_property_identifier((PropertyRNA *)prop); /* TODO(sergey): How to optimize this? */ - if (strstr(prop_identifier, "location") || strstr(prop_identifier, "rotation") || - strstr(prop_identifier, "scale") || strstr(prop_identifier, "matrix_")) { + if (contains(prop_identifier, "location") || contains(prop_identifier, "matrix_basis") || + contains(prop_identifier, "matrix_channel") || + contains(prop_identifier, "matrix_inverse") || + contains(prop_identifier, "matrix_local") || + contains(prop_identifier, "matrix_parent_inverse") || + contains(prop_identifier, "matrix_world") || + contains(prop_identifier, "rotation_axis_angle") || + contains(prop_identifier, "rotation_euler") || + contains(prop_identifier, "rotation_mode") || + contains(prop_identifier, "rotation_quaternion") || contains(prop_identifier, "scale")) { node_identifier.type = NodeType::TRANSFORM; return node_identifier; } - else if (strstr(prop_identifier, "data")) { + else if (contains(prop_identifier, "data")) { /* We access object.data, most likely a geometry. * Might be a bone tho. */ node_identifier.type = NodeType::GEOMETRY; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.h b/source/blender/depsgraph/intern/builder/deg_builder_rna.h index 52d0e5f6b12..c48c6489c47 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.h @@ -93,6 +93,19 @@ class RNANodeQuery { /* Make sure ID data exists for the given ID, and returns it. */ RNANodeQueryIDData *ensure_id_data(const ID *id); + + /* Check whether
[Bf-blender-cvs] [3bcec7c1420] blender-v2.90-release: Cleanup: Alembic, fix maybe-uninitialized warning
Commit: 3bcec7c1420b5401dbe87286bc3be8c5063cf1f4 Author: Sybren A. Stüvel Date: Mon Jul 27 08:52:53 2020 +0200 Branches: blender-v2.90-release https://developer.blender.org/rB3bcec7c1420b5401dbe87286bc3be8c5063cf1f4 Cleanup: Alembic, fix maybe-uninitialized warning No functional changes. === M source/blender/io/alembic/exporter/abc_writer_curves.cc === diff --git a/source/blender/io/alembic/exporter/abc_writer_curves.cc b/source/blender/io/alembic/exporter/abc_writer_curves.cc index f2a46c5e4fe..6f185020b58 100644 --- a/source/blender/io/alembic/exporter/abc_writer_curves.cc +++ b/source/blender/io/alembic/exporter/abc_writer_curves.cc @@ -80,9 +80,9 @@ void ABCCurveWriter::do_write(HierarchyContext ) std::vector orders; Imath::V3f temp_vert; - Alembic::AbcGeom::BasisType curve_basis; - Alembic::AbcGeom::CurveType curve_type; - Alembic::AbcGeom::CurvePeriodicity periodicity; + Alembic::AbcGeom::BasisType curve_basis = Alembic::AbcGeom::kNoBasis; + Alembic::AbcGeom::CurveType curve_type = Alembic::AbcGeom::kVariableOrder; + Alembic::AbcGeom::CurvePeriodicity periodicity = Alembic::AbcGeom::kNonPeriodic; Nurb *nurbs = static_cast(curve->nurb.first); for (; nurbs; nurbs = nurbs->next) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs