[Bf-blender-cvs] [8b5ce6e843e] blender2.8: Transform: fix non-3D view editmode assert
Commit: 8b5ce6e843eae4d379403986472475732f94e758 Author: Campbell Barton Date: Fri Jun 8 06:31:40 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB8b5ce6e843eae4d379403986472475732f94e758 Transform: fix non-3D view editmode assert === M source/blender/editors/transform/transform_conversions.c === diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index d4a01214d29..0bc03880096 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -8448,6 +8448,7 @@ void createTransData(bContext *C, TransInfo *t) } else if (t->spacetype == SPACE_ACTION) { t->flag |= T_POINTS | T_2D_EDIT; + t->obedit_type = -1; createTransActionData(C, t); countAndCleanTransDataContainer(t); @@ -8460,17 +8461,23 @@ void createTransData(bContext *C, TransInfo *t) } else if (t->spacetype == SPACE_NLA) { t->flag |= T_POINTS | T_2D_EDIT; + t->obedit_type = -1; + createTransNlaData(C, t); countAndCleanTransDataContainer(t); } else if (t->spacetype == SPACE_SEQ) { t->flag |= T_POINTS | T_2D_EDIT; + t->obedit_type = -1; + t->num.flag |= NUM_NO_FRACTION; /* sequencer has no use for floating point transformations */ createTransSeqData(C, t); countAndCleanTransDataContainer(t); } else if (t->spacetype == SPACE_IPO) { t->flag |= T_POINTS | T_2D_EDIT; + t->obedit_type = -1; + createTransGraphEditData(C, t); countAndCleanTransDataContainer(t); @@ -8482,6 +8489,7 @@ void createTransData(bContext *C, TransInfo *t) } else if (t->spacetype == SPACE_NODE) { t->flag |= T_POINTS | T_2D_EDIT; + t->obedit_type = -1; createTransNodeData(C, t); countAndCleanTransDataContainer(t); @@ -8494,6 +8502,8 @@ void createTransData(bContext *C, TransInfo *t) } else if (t->spacetype == SPACE_CLIP) { t->flag |= T_POINTS | T_2D_EDIT; + t->obedit_type = -1; + if (t->options & CTX_MOVIECLIP) { createTransTrackingData(C, t); countAndCleanTransDataContainer(t); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bb0fae907f0] hair_guides_grooming: Use eval mesh for the scalp consistently, never directly access scalp_object->data.
Commit: bb0fae907f0617f667fbe1604be973a92b32e904 Author: Lukas Tönne Date: Thu Jun 7 20:02:54 2018 +0100 Branches: hair_guides_grooming https://developer.blender.org/rBbb0fae907f0617f667fbe1604be973a92b32e904 Use eval mesh for the scalp consistently, never directly access scalp_object->data. === M source/blender/blenkernel/BKE_groom.h M source/blender/blenkernel/BKE_hair.h M source/blender/blenkernel/intern/groom.c M source/blender/blenkernel/intern/hair.c M source/blender/draw/engines/eevee/eevee_materials.c M source/blender/draw/modes/object_mode.c M source/blender/editors/groom/editgroom.c M source/blender/editors/groom/editgroom_region.c M source/blender/editors/groom/groom_hair.c M source/blender/editors/include/ED_groom.h M source/blender/makesrna/intern/rna_groom.c === diff --git a/source/blender/blenkernel/BKE_groom.h b/source/blender/blenkernel/BKE_groom.h index ef9be249897..415c9feedab 100644 --- a/source/blender/blenkernel/BKE_groom.h +++ b/source/blender/blenkernel/BKE_groom.h @@ -60,32 +60,42 @@ struct BoundBox *BKE_groom_boundbox_get(struct Object *ob); /* === Curve cache === */ -void BKE_groom_curve_cache_update(struct Groom *groom, const struct Mesh *scalp); +void BKE_groom_curve_cache_update(const struct Depsgraph *depsgraph, struct Groom *groom); void BKE_groom_curve_cache_clear(struct Groom *groom); /* === Scalp regions === */ +struct Mesh* BKE_groom_get_scalp(const struct Depsgraph *depsgraph, struct Groom *groom); + +/* Set the region's facemap name. + * Returns false if no facemap of that name can be found in the scalp object. + */ +bool BKE_groom_set_region_scalp_facemap(struct Groom *groom, struct GroomRegion *region, const char *facemap_name); + /* Try to bind bundles to their scalp regions */ -void BKE_groom_bind_scalp_regions(struct Groom *groom, bool force_rebind); +void BKE_groom_bind_scalp_regions(const struct Depsgraph *depsgraph, struct Groom *groom, bool force_rebind); -bool BKE_groom_region_bind(struct Groom *groom, struct GroomRegion *region, bool force_rebind); +bool BKE_groom_region_bind(const struct Depsgraph *depsgraph, struct Groom *groom, struct GroomRegion *region, bool force_rebind); void BKE_groom_region_unbind(struct GroomRegion *region); +/* Calculates the scalp orientation at the root of the region */ +bool BKE_groom_calc_region_transform_on_scalp(const struct GroomRegion *region, const struct Mesh *scalp, float r_loc[3], float r_rot[3][3]); + /* === Constraints === */ /* Apply constraints on groom geometry */ -void BKE_groom_apply_constraints(struct Groom *groom, struct Mesh *scalp); +void BKE_groom_apply_constraints(const struct Depsgraph *depsgraph, struct Groom *groom); /* === Hair System === */ /* Create follicles on the scalp surface for hair fiber rendering */ -void BKE_groom_hair_distribute(struct Groom *groom, unsigned int seed, int hair_count); +void BKE_groom_hair_distribute(const struct Depsgraph *depsgraph, struct Groom *groom, unsigned int seed, int hair_count); /* Calculate guide curve shapes based on groom bundle deformation */ -void BKE_groom_hair_update_guide_curves(struct Groom *groom); +void BKE_groom_hair_update_guide_curves(const struct Depsgraph *depsgraph, struct Groom *groom); /* === Depsgraph evaluation === */ @@ -128,7 +138,4 @@ typedef struct GroomIterator iter.isectionvertex < (bundle)->numloopverts; \ ++iter.isectionvertex, ++iter.vertex) -/* === Utility functions === */ -struct Mesh* BKE_groom_get_scalp(struct Groom *groom); - #endif /* __BKE_GROOM_H__ */ diff --git a/source/blender/blenkernel/BKE_hair.h b/source/blender/blenkernel/BKE_hair.h index 1f74caa79e0..be27b02c8c8 100644 --- a/source/blender/blenkernel/BKE_hair.h +++ b/source/blender/blenkernel/BKE_hair.h @@ -117,7 +117,7 @@ void BKE_hair_generate_follicles_ex( int count, const float *loop_weights); -void BKE_hair_bind_follicles(struct HairSystem *hsys, struct Mesh *scalp); +void BKE_hair_bind_follicles(struct HairSystem *hsys, const struct Mesh *scalp); /* === Draw Settings === */ diff --git a/source/blender/blenkernel/intern/groom.c b/source/blender/blenkernel/intern/groom.c index 61060de42b9..0aec6fc0da0 100644 --- a/source/blender/blenkernel/intern/groom.c +++ b/source/blender/blenkernel/intern/groom.c @@ -295,26 +295,57 @@ void BKE_groom_boundbox_calc(Groom *groom) /* === Scalp regions === */ -void BKE_groom_bind_scalp_regions(Groom *groom, bool force_rebind) +Mesh* BKE_groom_get_scalp(const Depsgraph *depsgraph, Groom *groom) +{ + if (groom->scalp_object) + { + BLI_assert(groom->scalp_object->type == OB_MESH); + return (Mesh *)DEG_get_evaluated_id(depsgraph, groom->scalp_object->data); + }
[Bf-blender-cvs] [30cd35a37bc] blender2.8: Keymap: continued testing/development
Commit: 30cd35a37bcea919ec86b1477b51f6bfdb8dde5c Author: Campbell Barton Date: Thu Jun 7 20:46:12 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB30cd35a37bcea919ec86b1477b51f6bfdb8dde5c Keymap: continued testing/development After testing in the studio and extending the event system for drag events, we've agreed on adjustments to the new keymap, see: T55162 - Tab: Edit-mode toggle. - Tab + Cursor Drag: mode switching pie menu. - Accent/Grave: for 3D view pie menu. - F3: Search - 1..3, Shift-1..3: Edit mesh vertex/edge/face toggle. Other minor changes were made, however they aren't part of the design. - Ctrl-Shift-S: Image editor Save-As (was F3) - Ctrl-Alt-R: Repeat history (was F3) === M release/scripts/startup/bl_ui/space_view3d.py M source/blender/editors/mesh/mesh_ops.c M source/blender/editors/object/object_ops.c M source/blender/editors/screen/screen_ops.c M source/blender/editors/space_image/space_image.c M source/blender/editors/space_view3d/view3d_ops.c M source/blender/windowmanager/intern/wm_operators.c === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index c17b089e04c..a401328df68 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3394,6 +3394,28 @@ class VIEW3D_MT_edit_gpencil_interpolate(Menu): layout.operator("gpencil.interpolate_sequence", text="Sequence") +class VIEW3D_PIE_object_mode(Menu): +bl_label = "Mode" + +def draw(self, context): +layout = self.layout + +pie = layout.menu_pie() +pie.operator_enum("OBJECT_OT_mode_set", "mode") + + +class VIEW3D_PIE_view(Menu): +bl_label = "View" +bl_idname = "VIEW3D_PIE_view" + +def draw(self, context): +layout = self.layout + +pie = layout.menu_pie() +pie.operator_enum("VIEW3D_OT_viewnumpad", "type") +pie.operator("view3d.view_selected", text="View Selected", icon='ZOOM_SELECTED') + + # ** Panel ** @@ -4009,6 +4031,8 @@ classes = ( VIEW3D_MT_edit_armature_delete, VIEW3D_MT_edit_gpencil_transform, VIEW3D_MT_edit_gpencil_interpolate, +VIEW3D_PIE_object_mode, +VIEW3D_PIE_view, VIEW3D_PT_grease_pencil, VIEW3D_PT_grease_pencil_palettecolor, VIEW3D_PT_view3d_properties, diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index b3c507affb7..f5c5a85d5ca 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -335,6 +335,24 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "vertex_only", true); /* selecting */ + + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", ONEKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_VERTEX); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", TWOKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_EDGE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", THREEKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_FACE); + + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", ONEKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_VERTEX); + RNA_boolean_set(kmi->ptr, "use_extend", true); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", TWOKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_EDGE); + RNA_boolean_set(kmi->ptr, "use_extend", true); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", THREEKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_FACE); + RNA_boolean_set(kmi->ptr, "use_extend", true); + /* standard mouse selection goes via space_view3d */ kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", false); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 915395f22e6..af572824068 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -289,23 +289,11 @@ void ED_keymap_object(wmKeyConfig *keyconf) keymap = WM_keymap_find(keyconf, "Object Non-modal", 0, 0); /* modes */ - { - short key_mode_pair[][2] = { - {ONEKEY, OB_MODE_OBJECT}, - {TWOKEY, OB_MODE_EDIT}, - {THREEKEY, OB_MODE_POSE}, - {THREEKEY, OB_MODE_WEIGHT_PAINT}, - {FOURKEY, OB_MODE_VERTEX_PAINT}, - {FIVEKEY, OB_MODE_TEXTURE_PAINT}, - {SIXKEY,
[Bf-blender-cvs] [cfc4805455b] blender2.8: Merge branch 'master' into blender2.8
Commit: cfc4805455bc03f5f810d0d234880727284e93cf Author: Campbell Barton Date: Thu Jun 7 20:41:10 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBcfc4805455bc03f5f810d0d234880727284e93cf Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8f49299134b] master: WM: fix drag events applying after release
Commit: 8f49299134b504a59558aad8e66a81ae3c6c9748 Author: Campbell Barton Date: Thu Jun 7 20:37:28 2018 +0200 Branches: master https://developer.blender.org/rB8f49299134b504a59558aad8e66a81ae3c6c9748 WM: fix drag events applying after release === M source/blender/windowmanager/intern/wm_event_system.c === diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index f820a0a1b8d..5974d4fddee 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2252,9 +2252,14 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) /* eventstate stores if previous event was a KM_PRESS, in case that * wasn't handled, the KM_RELEASE will become a KM_CLICK */ - if (win && event->val == KM_PRESS) { - win->eventstate->check_click = true; - win->eventstate->check_drag = true; + if (win != NULL) { + if (event->val == KM_PRESS) { + win->eventstate->check_click = true; + win->eventstate->check_drag = true; + } + else if (event->val == KM_RELEASE) { + win->eventstate->check_drag = false; + } } if (win && win->eventstate->prevtype == event->type) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1962ae69b16] blender2.8: Rename GPU_material_create_uniform_buffer > GPU_material_uniform_buffer_create
Commit: 1962ae69b16196e211f083223802744782804f11 Author: Dalai Felinto Date: Thu Jun 7 19:40:47 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB1962ae69b16196e211f083223802744782804f11 Rename GPU_material_create_uniform_buffer > GPU_material_uniform_buffer_create === M source/blender/gpu/GPU_material.h M source/blender/gpu/intern/gpu_codegen.c M source/blender/gpu/intern/gpu_material.c === diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index cddcb3a546e..152597331fa 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -260,7 +260,7 @@ struct ListBase *GPU_material_get_inputs(GPUMaterial *material); GPUMaterialStatus GPU_material_status(GPUMaterial *mat); struct GPUUniformBuffer *GPU_material_get_uniform_buffer(GPUMaterial *material); -void GPU_material_create_uniform_buffer(GPUMaterial *material, struct ListBase *inputs); +void GPU_material_uniform_buffer_create(GPUMaterial *material, ListBase *inputs); void GPU_material_uniform_buffer_tag_dirty(struct ListBase *gpumaterials); void GPU_material_vertex_attributes(GPUMaterial *material, diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 76ecf411143..0dd9d1f0908 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -672,7 +672,7 @@ static int codegen_process_uniforms_functions(GPUMaterial *material, DynStr *ds, /* Handle the UBO block separately. */ if ((material != NULL) && !BLI_listbase_is_empty(_inputs)) { - GPU_material_create_uniform_buffer(material, _inputs); + GPU_material_uniform_buffer_create(material, _inputs); /* Inputs are sorted */ BLI_dynstr_appendf(ds, "\nlayout (std140) uniform %s {\n", GPU_UBO_BLOCK_NAME); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index aa58f4365de..d1681a16c48 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -209,7 +209,7 @@ GPUUniformBuffer *GPU_material_get_uniform_buffer(GPUMaterial *material) * Create dynamic UBO from parameters * \param ListBase of BLI_genericNodeN(GPUInput) */ -void GPU_material_create_uniform_buffer(GPUMaterial *material, ListBase *inputs) +void GPU_material_uniform_buffer_create(GPUMaterial *material, ListBase *inputs) { material->ubo = GPU_uniformbuffer_dynamic_create(inputs, NULL); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [56f2293a51d] blender2.8: GLSL: No need to extract the UBO dynamic inputs
Commit: 56f2293a51d8ec572325f2581c7decb3cf2f8419 Author: Dalai Felinto Date: Thu Jun 7 19:40:08 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB56f2293a51d8ec572325f2581c7decb3cf2f8419 GLSL: No need to extract the UBO dynamic inputs === M source/blender/gpu/intern/gpu_codegen.c === diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 91d0d9dbecc..76ecf411143 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1162,8 +1162,12 @@ void GPU_nodes_extract_dynamic_inputs(GPUShader *shader, ListBase *inputs, ListB if (input->bindtex) extract = 1; } - else if (input->dynamicvec) + else if (input->dynamictype == GPU_DYNAMIC_UBO) { + /* Don't extract UBOs */ + } + else if (input->dynamicvec) { extract = 1; + } if (extract) input->shaderloc = GPU_shader_get_uniform(shader, input->shadername); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [57da4548728] blender2.8: Uniform Buffer Object: No more dirty tagging calls/check
Commit: 57da4548728fe0573ab602a7a674ec9d72aa5560 Author: Dalai Felinto Date: Thu Jun 7 19:42:00 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB57da4548728fe0573ab602a7a674ec9d72aa5560 Uniform Buffer Object: No more dirty tagging calls/check === M source/blender/gpu/GPU_material.h M source/blender/gpu/GPU_uniformbuffer.h M source/blender/gpu/intern/gpu_material.c M source/blender/gpu/intern/gpu_uniformbuffer.c === diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 152597331fa..505665b6f1f 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -261,7 +261,6 @@ GPUMaterialStatus GPU_material_status(GPUMaterial *mat); struct GPUUniformBuffer *GPU_material_get_uniform_buffer(GPUMaterial *material); void GPU_material_uniform_buffer_create(GPUMaterial *material, ListBase *inputs); -void GPU_material_uniform_buffer_tag_dirty(struct ListBase *gpumaterials); void GPU_material_vertex_attributes(GPUMaterial *material, struct GPUVertexAttribs *attrib); diff --git a/source/blender/gpu/GPU_uniformbuffer.h b/source/blender/gpu/GPU_uniformbuffer.h index c2480f8ba03..4c5d52e5c4e 100644 --- a/source/blender/gpu/GPU_uniformbuffer.h +++ b/source/blender/gpu/GPU_uniformbuffer.h @@ -52,7 +52,6 @@ int GPU_uniformbuffer_bindpoint(GPUUniformBuffer *ubo); bool GPU_uniformbuffer_is_empty(GPUUniformBuffer *ubo); bool GPU_uniformbuffer_is_dirty(GPUUniformBuffer *ubo); -void GPU_uniformbuffer_tag_dirty(GPUUniformBuffer *ubo); #define GPU_UBO_BLOCK_NAME "nodeTree" diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index d1681a16c48..cb72c4c614f 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -214,16 +214,6 @@ void GPU_material_uniform_buffer_create(GPUMaterial *material, ListBase *inputs) material->ubo = GPU_uniformbuffer_dynamic_create(inputs, NULL); } -void GPU_material_uniform_buffer_tag_dirty(ListBase *gpumaterials) -{ - for (LinkData *link = gpumaterials->first; link; link = link->next) { - GPUMaterial *material = link->data; - if (material->ubo != NULL) { - GPU_uniformbuffer_tag_dirty(material->ubo); - } - } -} - /* Eevee Subsurface scattering. */ /* Based on Separable SSS. by Jorge Jimenez and Diego Gutierrez */ diff --git a/source/blender/gpu/intern/gpu_uniformbuffer.c b/source/blender/gpu/intern/gpu_uniformbuffer.c index afd43600d9b..a5cae1813c2 100644 --- a/source/blender/gpu/intern/gpu_uniformbuffer.c +++ b/source/blender/gpu/intern/gpu_uniformbuffer.c @@ -368,11 +368,4 @@ int GPU_uniformbuffer_bindpoint(GPUUniformBuffer *ubo) return ubo->bindpoint; } -void GPU_uniformbuffer_tag_dirty(GPUUniformBuffer *ubo_) -{ - BLI_assert(ubo_->type == GPU_UBO_DYNAMIC); - GPUUniformBufferDynamic *ubo = (GPUUniformBufferDynamic *)ubo_; - ubo->flag |= GPU_UBO_FLAG_DIRTY; -} - #undef MAX_UBO_GPU_TYPE ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [18e316bcb9f] blender2.8: Uniform Buffer Objects: Simplification refactor
Commit: 18e316bcb9f4aa7221f82a40fd3307cde7eaffbb Author: Dalai Felinto Date: Thu Jun 7 20:02:34 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB18e316bcb9f4aa7221f82a40fd3307cde7eaffbb Uniform Buffer Objects: Simplification refactor Since we are only creating this and never updating, there is no need for the original approach with the individual data to be updated. Note we only populate the GPU data when binding the UBO, so we can in the future easily create the UBOs in a separate thread than the main drawing one. Also at the moment animated materials are not working. To fix that we need to free/tag for free the GPUMaterials in BKE_material_eval. === M source/blender/gpu/GPU_uniformbuffer.h M source/blender/gpu/intern/gpu_uniformbuffer.c === diff --git a/source/blender/gpu/GPU_uniformbuffer.h b/source/blender/gpu/GPU_uniformbuffer.h index 4c5d52e5c4e..2f422fa1a92 100644 --- a/source/blender/gpu/GPU_uniformbuffer.h +++ b/source/blender/gpu/GPU_uniformbuffer.h @@ -35,7 +35,6 @@ struct ListBase; typedef struct GPUUniformBuffer GPUUniformBuffer; -typedef struct GPUUniformBufferDynamicItem GPUUniformBufferDynamicItem; GPUUniformBuffer *GPU_uniformbuffer_create(int size, const void *data, char err_out[256]); GPUUniformBuffer *GPU_uniformbuffer_dynamic_create(struct ListBase *inputs, char err_out[256]); diff --git a/source/blender/gpu/intern/gpu_uniformbuffer.c b/source/blender/gpu/intern/gpu_uniformbuffer.c index a5cae1813c2..1e39b2ea5b7 100644 --- a/source/blender/gpu/intern/gpu_uniformbuffer.c +++ b/source/blender/gpu/intern/gpu_uniformbuffer.c @@ -62,26 +62,14 @@ struct GPUUniformBuffer { typedef struct GPUUniformBufferDynamic { GPUUniformBuffer buffer; - ListBase items; /* GPUUniformBufferDynamicItem */ - void *data; + void *data; /* Continuous memory block to copy to GPU. */ char flag; } GPUUniformBufferDynamic; -struct GPUUniformBufferDynamicItem { - struct GPUUniformBufferDynamicItem *next, *prev; - GPUType gputype; - float *data; - int size; -}; - - /* Prototypes */ static GPUType get_padded_gpu_type(struct LinkData *link); static void gpu_uniformbuffer_inputs_sort(struct ListBase *inputs); -static GPUUniformBufferDynamicItem *gpu_uniformbuffer_populate( -GPUUniformBufferDynamic *ubo, const GPUType gputype, float *num); - /* Only support up to this type, if you want to extend it, make sure the * padding logic is correct for the new types. */ #define MAX_UBO_GPU_TYPE GPU_VEC4 @@ -159,34 +147,47 @@ GPUUniformBuffer *GPU_uniformbuffer_dynamic_create(ListBase *inputs, char err_ou gpu_uniformbuffer_inputs_sort(inputs); for (LinkData *link = inputs->first; link; link = link->next) { - GPUInput *input = link->data; - GPUType gputype = get_padded_gpu_type(link); - gpu_uniformbuffer_populate(ubo, gputype, input->dynamicvec); + const GPUType gputype = get_padded_gpu_type(link); + ubo->buffer.size += gputype * sizeof(float); } + /* Allocate the data. */ ubo->data = MEM_mallocN(ubo->buffer.size, __func__); - /* Initialize buffer data. */ - GPU_uniformbuffer_dynamic_update(>buffer); + /* Now that we know the total ubo size we can start populating it. */ + float *offset = ubo->data; + for (LinkData *link = inputs->first; link; link = link->next) { + GPUInput *input = link->data; + const GPUType gputype = get_padded_gpu_type(link); + memcpy(offset, input->dynamicvec, gputype * sizeof(float)); + offset += gputype; + } + + /* Note since we may create the UBOs in the CPU in a different thread than the main drawing one, +* we don't create the UBO in the GPU here. This will happen when we first bind the UBO. +*/ + return >buffer; } /** - * Free the data, and clean the items list. + * Free the data */ -static void gpu_uniformbuffer_dynamic_reset(GPUUniformBufferDynamic *ubo) +static void gpu_uniformbuffer_dynamic_free(GPUUniformBuffer *ubo_) { + BLI_assert(ubo_->type == GPU_UBO_DYNAMIC); + GPUUniformBufferDynamic *ubo = (GPUUniformBufferDynamic *)ubo_; + ubo->buffer.size = 0; if (ubo->data) { MEM_freeN(ubo->data); } - BLI_freelistN(>items); } void GPU_uniformbuffer_free(GPUUniformBuffer *ubo) { if (ubo->type == GPU_UBO_DYNAMIC) { - gpu_uniformbuffer_dynamic_reset((GPUUniformBufferDynamic *)ubo); + gpu_uniformbuffer_dynamic_free(ubo); } glDeleteBuffers(1, >bindcode); @@ -215,12 +216,6 @@ void GPU_uniformbuffer_dynamic_update(GPUUniformBuffer *ubo_)
[Bf-blender-cvs] [cfc1ddeff71] master: GHOST/X11: Xinput/XIM support caused double key-up
Commit: cfc1ddeff71570d702fc0c1c79d36249086849b9 Author: Campbell Barton Date: Thu Jun 7 20:32:51 2018 +0200 Branches: master https://developer.blender.org/rBcfc1ddeff71570d702fc0c1c79d36249086849b9 GHOST/X11: Xinput/XIM support caused double key-up All keyboard events were sending double key events (including modifiers) when xinput was enabled with gnome (causing much confusion!). I cant test if XIM works, but this isn't useful to send double events, so disabling for now. === M intern/ghost/intern/GHOST_SystemX11.cpp === diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 93a9f3589f4..62befc2f227 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -571,10 +571,8 @@ processEvents( } /* dispatch event to XIM server */ - if ((XFilterEvent(, (Window)NULL) == True) && (xevent.type != KeyRelease)) { - /* do nothing now, the event is consumed by XIM. -* however, KeyRelease event should be processed -* here, otherwise modifiers remain activated. */ + if ((XFilterEvent(, (Window)NULL) == True)) { + /* do nothing now, the event is consumed by XIM. */ continue; } #endif ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [de94b6baf6b] temp-keymap-changes: Correct piemenu name
Commit: de94b6baf6b5f3f4d1f77a1884bc341aa4641304 Author: Campbell Barton Date: Thu Jun 7 20:13:14 2018 +0200 Branches: temp-keymap-changes https://developer.blender.org/rBde94b6baf6b5f3f4d1f77a1884bc341aa4641304 Correct piemenu name === M release/scripts/startup/bl_ui/space_view3d.py === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 9be882ba387..80e4fb50c98 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3406,7 +3406,7 @@ class VIEW3D_PIE_object_mode(Menu): class VIEW3D_PIE_view(Menu): bl_label = "View" -bl_idname = "VIEW3D_PIE_view_of" +bl_idname = "VIEW3D_PIE_view" def draw(self, context): layout = self.layout ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4846f644a9a] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: 4846f644a9a29fa3be72278acef442a6b4d9d4c1 Author: Antonio Vazquez Date: Thu Jun 7 19:24:26 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB4846f644a9a29fa3be72278acef442a6b4d9d4c1 Merge branch 'blender2.8' 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] [e5bc37eb5ef] blender2.8: Don't tag UBO as dirty anymore otherwise it still crashes on render
Commit: e5bc37eb5eff9d98a9ed6861be344ee05e586173 Author: Dalai Felinto Date: Thu Jun 7 19:19:37 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBe5bc37eb5eff9d98a9ed6861be344ee05e586173 Don't tag UBO as dirty anymore otherwise it still crashes on render === M source/blender/blenkernel/intern/material.c M source/blender/blenkernel/intern/world.c === diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 109b436292e..373cb4e4f06 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1315,7 +1315,4 @@ void paste_matcopybuf(Main *bmain, Material *ma) void BKE_material_eval(struct Depsgraph *depsgraph, Material *material) { DEG_debug_print_eval(depsgraph, __func__, material->id.name, material); - if ((BLI_listbase_is_empty(>gpumaterial) == false)) { - GPU_material_uniform_buffer_tag_dirty(>gpumaterial); - } } diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 75965375cbd..1b06e7ed851 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -168,6 +168,5 @@ void BKE_world_eval(struct Depsgraph *depsgraph, World *world) DEG_debug_print_eval(depsgraph, __func__, world->id.name, world); if (!BLI_listbase_is_empty(>gpumaterial)) { world->update_flag = 1; - GPU_material_uniform_buffer_tag_dirty(>gpumaterial); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d17094b256a] blender2.8: BKE_world_eval: cleanup
Commit: d17094b256a3a5bcdb9ae5650c600aa5a7d2 Author: Dalai Felinto Date: Thu Jun 7 19:15:36 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBd17094b256a3a5bcdb9ae5650c600aa5a7d2 BKE_world_eval: cleanup === M source/blender/blenkernel/intern/world.c === diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 15bf01d2049..75965375cbd 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -53,6 +53,8 @@ #include "BKE_node.h" #include "BKE_world.h" +#include "DEG_depsgraph.h" + #include "GPU_material.h" /** Free (or release) any data used by this world (does not free the world itself). */ @@ -161,11 +163,9 @@ void BKE_world_make_local(Main *bmain, World *wrld, const bool lib_local) BKE_id_make_local_generic(bmain, >id, true, lib_local); } -void BKE_world_eval(struct Depsgraph *UNUSED(depsgraph), World *world) +void BKE_world_eval(struct Depsgraph *depsgraph, World *world) { - if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) { - printf("%s on %s (%p)\n", __func__, world->id.name, world); - } + DEG_debug_print_eval(depsgraph, __func__, world->id.name, world); if (!BLI_listbase_is_empty(>gpumaterial)) { world->update_flag = 1; GPU_material_uniform_buffer_tag_dirty(>gpumaterial); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3b5d9ce4411] greasepencil-object: Move Info panel to Bottom Bar Statistics
Commit: 3b5d9ce441128e6f0d4a29ae74e390f755526e24 Author: Antonio Vazquez Date: Thu Jun 7 19:15:12 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB3b5d9ce441128e6f0d4a29ae74e390f755526e24 Move Info panel to Bottom Bar Statistics Now the info appears in the same place that other object types. === M release/scripts/startup/bl_ui/properties_data_gpencil.py M source/blender/blenkernel/BKE_gpencil.h M source/blender/blenkernel/intern/gpencil.c M source/blender/editors/space_info/info_stats.c M source/blender/makesrna/intern/rna_gpencil.c === diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index f073cc64f97..407e0426a6a 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -202,32 +202,6 @@ class DATA_PT_gpencil_vertexpanel(DataButtonsPanel, Panel): layout.prop(context.tool_settings, "vertex_group_weight", text="Weight") -class DATA_PT_gpencil_infopanel(DataButtonsPanel, Panel): -bl_space_type = 'PROPERTIES' -bl_region_type = 'WINDOW' -bl_context = "data" -bl_label = "Information" -bl_options = {'DEFAULT_CLOSED'} - -def draw(self, context): -layout = self.layout -gpd = context.gpencil_data - -split = layout.split(percentage=0.5) - -col = split.column(align=True) -col.label("Layers:", icon="LAYER_ACTIVE") -col.label("Frames:", icon="LAYER_ACTIVE") -col.label("Strokes:", icon="LAYER_ACTIVE") -col.label("Points:", icon="LAYER_ACTIVE") - -col = split.column(align=True) -col.label(str(gpd.info_total_layers)) -col.label(str(gpd.info_total_frames)) -col.label(str(gpd.info_total_strokes)) -col.label(str(gpd.info_total_points)) - - class DATA_PT_gpencil_display(DataButtonsPanel, Panel): bl_label = "Viewport Display" bl_options = {'DEFAULT_CLOSED'} @@ -253,7 +227,6 @@ class DATA_PT_gpencil_display(DataButtonsPanel, Panel): sub.active = not gpd.show_constant_thickness sub.prop(gpd, "pixfactor", text="Thickness Scale") - if gpl: layout.prop(gpd, "show_stroke_direction", text="Show Stroke Directions") @@ -268,7 +241,6 @@ classes = ( DATA_PT_gpencil_parentpanel, DATA_PT_gpencil_vertexpanel, DATA_PT_gpencil_display, -DATA_PT_gpencil_infopanel, GPENCIL_UL_vgroups, ) diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h index 2569a5ecaa4..3311b117135 100644 --- a/source/blender/blenkernel/BKE_gpencil.h +++ b/source/blender/blenkernel/BKE_gpencil.h @@ -94,6 +94,12 @@ void BKE_gpencil_frame_delete_laststroke(struct bGPDlayer *gpl, struct bGPDframe void BKE_gpencil_material_index_remove(struct bGPdata *gpd, int index); void BKE_gpencil_material_remap(struct bGPdata *gpd, const unsigned int *remap, unsigned int remap_len); +/* statistics functions */ +int BKE_gpencil_stats_total_layers(struct bGPdata *gpd); +int BKE_gpencil_stats_total_frames(struct bGPdata *gpd); +int BKE_gpencil_stats_total_strokes(struct bGPdata *gpd); +int BKE_gpencil_stats_total_points(struct bGPdata *gpd); + /* Utilities for creating and populating GP strokes */ /* - Number of values defining each point in the built-in data * buffers for primitives (e.g. 2D Monkey) diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index a390e64531b..f196ad27613 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1606,3 +1606,46 @@ void BKE_gpencil_material_remap(struct bGPdata *gpd, const unsigned int *remap, #undef MAT_NR_REMAP } + +/* statistics functions */ +int BKE_gpencil_stats_total_layers(bGPdata *gpd) +{ + return BLI_listbase_count(>layers); +} + +int BKE_gpencil_stats_total_frames(bGPdata *gpd) +{ + int tot = 0; + for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { + tot += BLI_listbase_count(>frames); + } + + return tot; +} + +int BKE_gpencil_stats_total_strokes(bGPdata *gpd) +{ + int tot = 0; + for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { + for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) { + tot += BLI_listbase_count(>strokes); + } + } + + return tot; +} + +int BKE_gpencil_stats_total_points(bGPdata *gpd) +{ + int tot = 0; + for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { + for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) { + for (bGPDstroke *gps = gpf->strokes.first; gps; gps =
[Bf-blender-cvs] [85e28713825] blender2.8: No more need to tag sss as dirty for EEVEE
Commit: 85e28713825fc5d0d3cb6e060e2b851e67b918dd Author: Dalai Felinto Date: Thu Jun 7 19:13:06 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB85e28713825fc5d0d3cb6e060e2b851e67b918dd No more need to tag sss as dirty for EEVEE And for the records, this shoudn't have been added to the GPU_material_uniform_buffer_tag_dirty function since they are unrelated. === M source/blender/gpu/intern/gpu_material.c === diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 0404425ac3f..aa58f4365de 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -221,9 +221,6 @@ void GPU_material_uniform_buffer_tag_dirty(ListBase *gpumaterials) if (material->ubo != NULL) { GPU_uniformbuffer_tag_dirty(material->ubo); } - if (material->sss_profile != NULL) { - material->sss_dirty = true; - } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d32b59fc18f] blender2.8: Remove more printfs ....
Commit: d32b59fc18fc968062b69f1106784dd5fe88b2a2 Author: Clément Foucault Date: Thu Jun 7 19:06:50 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBd32b59fc18fc968062b69f1106784dd5fe88b2a2 Remove more printfs === M source/blender/draw/intern/draw_manager_shader.c === diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c index dd46248a781..0b6974b7b36 100644 --- a/source/blender/draw/intern/draw_manager_shader.c +++ b/source/blender/draw/intern/draw_manager_shader.c @@ -161,7 +161,6 @@ static void drw_deferred_shader_add(GPUMaterial *mat) /* Double checking that this GPUMaterial is not going to be * compiled by another thread. */ DRW_deferred_shader_remove(mat); - printf("%s GPUMaterial %p\n", __func__, mat); GPU_material_compile(mat); return; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [630019d5f87] blender2.8: Alembic export: use depsgraph to get evaluated mesh/object
Commit: 630019d5f87362f4d1e88df5e15f1400811d5331 Author: Sybren A. Stüvel Date: Thu Jun 7 18:49:56 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB630019d5f87362f4d1e88df5e15f1400811d5331 Alembic export: use depsgraph to get evaluated mesh/object === M source/blender/alembic/intern/abc_mesh.cc M source/blender/alembic/intern/abc_transform.cc === diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index e09852e328e..d56a05f65b7 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -52,6 +52,8 @@ extern "C" { #include "bmesh.h" #include "bmesh_tools.h" + +#include "DEG_depsgraph_query.h" } using Alembic::Abc::FloatArraySample; @@ -524,7 +526,9 @@ Mesh *AbcMeshWriter::getFinalMesh(bool _needsfree) m_subsurf_mod->mode |= eModifierMode_DisableTemporary; } - struct Mesh *mesh = mesh_get_eval_final(m_settings.depsgraph, m_settings.scene, m_object, CD_MASK_MESH); + Scene *scene = DEG_get_evaluated_scene(m_settings.depsgraph); + Object *ob_eval = DEG_get_evaluated_object(m_settings.depsgraph, m_object); + struct Mesh *mesh = mesh_get_eval_final(m_settings.depsgraph, scene, ob_eval, CD_MASK_MESH); r_needsfree = false; if (m_subsurf_mod) { diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc index abb9d840128..81ebfef3e11 100644 --- a/source/blender/alembic/intern/abc_transform.cc +++ b/source/blender/alembic/intern/abc_transform.cc @@ -32,6 +32,8 @@ extern "C" { #include "BLI_math.h" #include "BKE_object.h" + +#include "DEG_depsgraph_query.h" } using Alembic::AbcGeom::OObject; @@ -80,29 +82,31 @@ AbcTransformWriter::AbcTransformWriter(Object *ob, void AbcTransformWriter::do_write() { + Object *ob_eval = DEG_get_evaluated_object(m_settings.depsgraph, m_object); + if (m_first_frame) { m_visibility = Alembic::AbcGeom::CreateVisibilityProperty(m_xform, m_xform.getSchema().getTimeSampling()); } - m_visibility.set(!(m_object->restrictflag & OB_RESTRICT_VIEW)); + m_visibility.set(!(ob_eval->restrictflag & OB_RESTRICT_VIEW)); if (!m_first_frame && !m_is_animated) { return; } float yup_mat[4][4]; - create_transform_matrix(m_object, yup_mat, + create_transform_matrix(ob_eval, yup_mat, m_inherits_xform ? ABC_MATRIX_LOCAL : ABC_MATRIX_WORLD, m_proxy_from); /* Only apply rotation to root camera, parenting will propagate it. */ - if (m_object->type == OB_CAMERA && (!m_inherits_xform || !has_parent_camera(m_object))) { + if (ob_eval->type == OB_CAMERA && (!m_inherits_xform || !has_parent_camera(ob_eval))) { float rot_mat[4][4]; axis_angle_to_mat4_single(rot_mat, 'X', -M_PI_2); mul_m4_m4m4(yup_mat, yup_mat, rot_mat); } - if (!m_object->parent || !m_inherits_xform) { + if (!ob_eval->parent || !m_inherits_xform) { /* Only apply scaling to root objects, parenting will propagate it. */ float scale_mat[4][4]; scale_m4_fl(scale_mat, m_settings.global_scale); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [28817c82f13] blender2.8: Alembic export: no need to check particle's mesh_final on export
Commit: 28817c82f133b98d58dab06591347200da855817 Author: Sybren A. Stüvel Date: Thu Jun 7 18:35:07 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB28817c82f133b98d58dab06591347200da855817 Alembic export: no need to check particle's mesh_final on export Hair writing is still not working properly, though, but at least now samples are written at all. === M source/blender/alembic/intern/abc_hair.cc === diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc index b5adc4486a7..be7ad90dc31 100644 --- a/source/blender/alembic/intern/abc_hair.cc +++ b/source/blender/alembic/intern/abc_hair.cc @@ -72,13 +72,6 @@ void AbcHairWriter::do_write() if (!m_psys) { return; } - - ParticleSystemModifierData *psmd = psys_get_modifier(m_object, m_psys); - - if (!psmd->mesh_final) { - return; - } - Mesh *mesh = mesh_get_eval_final(m_settings.depsgraph, m_settings.scene, m_object, CD_MASK_MESH); BKE_mesh_tessface_ensure(mesh); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [20d3ce57d07] blender2.8: Alembic export: cleaned up multiply-passed depsgraph & scene
Commit: 20d3ce57d0730999373fcbb0b22696dbfdfa7326 Author: Sybren A. Stüvel Date: Thu Jun 7 17:54:36 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB20d3ce57d0730999373fcbb0b22696dbfdfa7326 Alembic export: cleaned up multiply-passed depsgraph & scene Those can now solely be found in the ExportSettings object. === M source/blender/alembic/intern/abc_camera.cc M source/blender/alembic/intern/abc_camera.h M source/blender/alembic/intern/abc_curves.cc M source/blender/alembic/intern/abc_curves.h M source/blender/alembic/intern/abc_exporter.cc M source/blender/alembic/intern/abc_exporter.h M source/blender/alembic/intern/abc_hair.cc M source/blender/alembic/intern/abc_hair.h M source/blender/alembic/intern/abc_mball.cc M source/blender/alembic/intern/abc_mball.h M source/blender/alembic/intern/abc_mesh.cc M source/blender/alembic/intern/abc_mesh.h M source/blender/alembic/intern/abc_nurbs.cc M source/blender/alembic/intern/abc_nurbs.h M source/blender/alembic/intern/abc_object.cc M source/blender/alembic/intern/abc_object.h M source/blender/alembic/intern/abc_points.cc M source/blender/alembic/intern/abc_points.h M source/blender/alembic/intern/abc_transform.cc M source/blender/alembic/intern/abc_transform.h M source/blender/alembic/intern/alembic_capi.cc === diff --git a/source/blender/alembic/intern/abc_camera.cc b/source/blender/alembic/intern/abc_camera.cc index 4c91b9a6252..457bbd2b3af 100644 --- a/source/blender/alembic/intern/abc_camera.cc +++ b/source/blender/alembic/intern/abc_camera.cc @@ -49,13 +49,11 @@ using Alembic::AbcGeom::kWrapExisting; /* ** */ -AbcCameraWriter::AbcCameraWriter(Depsgraph *depsgraph, - Scene *scene, - Object *ob, +AbcCameraWriter::AbcCameraWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, ExportSettings ) -: AbcObjectWriter(depsgraph, scene, ob, time_sampling, settings, parent) +: AbcObjectWriter(ob, time_sampling, settings, parent) { OCamera camera(parent->alembicXform(), m_name, m_time_sampling); m_camera_schema = camera.getSchema(); diff --git a/source/blender/alembic/intern/abc_camera.h b/source/blender/alembic/intern/abc_camera.h index a839ca947ca..dd5dc28d598 100644 --- a/source/blender/alembic/intern/abc_camera.h +++ b/source/blender/alembic/intern/abc_camera.h @@ -35,9 +35,7 @@ class AbcCameraWriter : public AbcObjectWriter { Alembic::AbcGeom::OFloatProperty m_eye_separation; public: - AbcCameraWriter(Depsgraph *depsgraph, - Scene *scene, - Object *ob, + AbcCameraWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, ExportSettings ); diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc index 9c64fd0481e..158c325e4aa 100644 --- a/source/blender/alembic/intern/abc_curves.cc +++ b/source/blender/alembic/intern/abc_curves.cc @@ -71,13 +71,11 @@ using Alembic::AbcGeom::OV2fGeomParam; /* ** */ -AbcCurveWriter::AbcCurveWriter(Depsgraph *depsgraph, - Scene *scene, - Object *ob, +AbcCurveWriter::AbcCurveWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, ExportSettings ) -: AbcObjectWriter(depsgraph, scene, ob, time_sampling, settings, parent) +: AbcObjectWriter(ob, time_sampling, settings, parent) { OCurves curves(parent->alembicXform(), m_name, m_time_sampling); m_schema = curves.getSchema(); diff --git a/source/blender/alembic/intern/abc_curves.h b/source/blender/alembic/intern/abc_curves.h index e2373381703..4fad27263ea 100644 --- a/source/blender/alembic/intern/abc_curves.h +++ b/source/blender/alembic/intern/abc_curves.h @@ -36,9 +36,7 @@ class AbcCurveWriter : public AbcObjectWriter { Alembic::AbcGeom::OCurvesSchema::Sample m_sample; public: - AbcCurveWriter(Depsgraph *depsgraph, - Scene *scene, - Object *ob, + AbcCurveWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, ExportSettings ); diff --git a/source/blender/alembic/intern/abc_exporter.cc
[Bf-blender-cvs] [9a873d0ab24] blender2.8: Alembic import: don't crash Blender when reading invalid samples
Commit: 9a873d0ab2448b0fd059e87f339db07dc648510f Author: Sybren A. Stüvel Date: Thu Jun 7 18:34:05 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB9a873d0ab2448b0fd059e87f339db07dc648510f Alembic import: don't crash Blender when reading invalid samples === M source/blender/alembic/intern/abc_curves.cc M source/blender/alembic/intern/abc_curves.h M source/blender/alembic/intern/abc_mesh.cc M source/blender/alembic/intern/abc_nurbs.cc M source/blender/alembic/intern/abc_points.cc === diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc index 158c325e4aa..e27403305da 100644 --- a/source/blender/alembic/intern/abc_curves.cc +++ b/source/blender/alembic/intern/abc_curves.cc @@ -256,9 +256,21 @@ void AbcCurveReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSele /* ** */ -void read_curve_sample(Curve *cu, const ICurvesSchema , const ISampleSelector _sel) +void AbcCurveReader::read_curve_sample(Curve *cu, const ICurvesSchema , const ISampleSelector _sel) { - ICurvesSchema::Sample smp = schema.getValue(sample_sel); + ICurvesSchema::Sample smp; + try { + smp = schema.getValue(sample_sel); + } + catch(Alembic::Util::Exception ) { + printf("Alembic: error reading curve sample for '%s/%s' at time %f: %s\n", + m_iobject.getFullName().c_str(), + schema.getName().c_str(), + sample_sel.getRequestedTime(), + ex.what()); + return; + } + const Int32ArraySamplePtr num_vertices = smp.getCurvesNumVertices(); const P3fArraySamplePtr positions = smp.getPositions(); const FloatArraySamplePtr weights = smp.getPositionWeights(); @@ -404,12 +416,25 @@ void read_curve_sample(Curve *cu, const ICurvesSchema , const ISampleSele * object directly and create a new Mesh from that. Also we might need to * create new or delete existing NURBS in the curve. */ -Mesh *AbcCurveReader::read_mesh(Mesh * /*existing_mesh*/, +Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh, const ISampleSelector _sel, int /*read_flag*/, -const char ** /*err_str*/) +const char **err_str) { - const ICurvesSchema::Sample sample = m_curves_schema.getValue(sample_sel); + ICurvesSchema::Sample sample; + + try { + sample = m_curves_schema.getValue(sample_sel); + } + catch(Alembic::Util::Exception ) { + *err_str = "Error reading curve sample; more detail on the console"; + printf("Alembic: error reading curve sample for '%s/%s' at time %f: %s\n", + m_iobject.getFullName().c_str(), + m_curves_schema.getName().c_str(), + sample_sel.getRequestedTime(), + ex.what()); + return existing_mesh; + } const P3fArraySamplePtr = sample.getPositions(); const Int32ArraySamplePtr num_vertices = sample.getCurvesNumVertices(); diff --git a/source/blender/alembic/intern/abc_curves.h b/source/blender/alembic/intern/abc_curves.h index 4fad27263ea..eb80553620d 100644 --- a/source/blender/alembic/intern/abc_curves.h +++ b/source/blender/alembic/intern/abc_curves.h @@ -62,12 +62,13 @@ public: const Alembic::Abc::ISampleSelector _sel, int read_flag, const char **err_str); + + void read_curve_sample(Curve *cu, + const Alembic::AbcGeom::ICurvesSchema , + const Alembic::Abc::ISampleSelector _selector); + }; /* ** */ -void read_curve_sample(Curve *cu, - const Alembic::AbcGeom::ICurvesSchema , - const Alembic::Abc::ISampleSelector _selector); - #endif /* __ABC_CURVES_H__ */ diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index a593bf21328..e09852e328e 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -1062,7 +1062,19 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh, int read_flag, const char **err_str) { - const IPolyMeshSchema::Sample sample = m_schema.getValue(sample_sel); + IPolyMeshSchema::Sample sample; + try { + sample = m_schema.getValue(sample_sel); + }
[Bf-blender-cvs] [5852c66125b] blender2.8: Alembic hair writer: avoid double-free
Commit: 5852c66125b706a7ab9e5e179dfa51d3bf94bbd2 Author: Sybren A. Stüvel Date: Thu Jun 7 17:55:13 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB5852c66125b706a7ab9e5e179dfa51d3bf94bbd2 Alembic hair writer: avoid double-free === M source/blender/alembic/intern/abc_hair.cc === diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc index b11a790a8bb..b5adc4486a7 100644 --- a/source/blender/alembic/intern/abc_hair.cc +++ b/source/blender/alembic/intern/abc_hair.cc @@ -97,8 +97,6 @@ void AbcHairWriter::do_write() } } - BKE_id_free(NULL, mesh); - Alembic::Abc::P3fArraySample iPos(verts); m_sample = OCurvesSchema::Sample(iPos, hvertices); m_sample.setBasis(Alembic::AbcGeom::kNoBasis); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ef7b7efd11a] blender2.8: Eevee: Fix hair not rendering.
Commit: ef7b7efd11a7a3112d3e26ced73b349bf9e52af3 Author: Clément Foucault Date: Thu Jun 7 18:58:06 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBef7b7efd11a7a3112d3e26ced73b349bf9e52af3 Eevee: Fix hair not rendering. === M source/blender/draw/engines/eevee/eevee_render.c M source/blender/draw/intern/draw_manager.c === diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index 6cb3fa259eb..76887145ad2 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -143,25 +143,26 @@ void EEVEE_render_cache( char info[42]; BLI_snprintf(info, sizeof(info), "Syncing %s", ob->id.name + 2); RE_engine_update_stats(engine, NULL, info); + bool cast_shadow = false; - if (DRW_check_object_visible_within_active_context(ob) == false) { - return; + if (ob->base_flag & BASE_VISIBLED) { + EEVEE_hair_cache_populate(vedata, sldata, ob, _shadow); } - if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) { - bool cast_shadow; - - EEVEE_materials_cache_populate(vedata, sldata, ob, _shadow); - - if (cast_shadow) { - EEVEE_lights_cache_shcaster_object_add(sldata, ob); + if (DRW_check_object_visible_within_active_context(ob)) { + if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) { + EEVEE_materials_cache_populate(vedata, sldata, ob, _shadow); + } + else if (ob->type == OB_LIGHTPROBE) { + EEVEE_lightprobes_cache_add(sldata, ob); + } + else if (ob->type == OB_LAMP) { + EEVEE_lights_cache_add(sldata, ob); } } - else if (ob->type == OB_LIGHTPROBE) { - EEVEE_lightprobes_cache_add(sldata, ob); - } - else if (ob->type == OB_LAMP) { - EEVEE_lights_cache_add(sldata, ob); + + if (cast_shadow) { + EEVEE_lights_cache_shcaster_object_add(sldata, ob); } } @@ -421,6 +422,9 @@ void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl /* Push instances attribs to the GPU. */ DRW_render_instance_buffer_finish(); + /* Need to be called after DRW_render_instance_buffer_finish() */ + DRW_hair_update(); + if ((view_layer->passflag & (SCE_PASS_SUBSURFACE_COLOR | SCE_PASS_SUBSURFACE_DIRECT | SCE_PASS_SUBSURFACE_INDIRECT)) != 0) diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index a9263abbfaa..75649f7eebb 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1553,8 +1553,6 @@ void DRW_render_object_iter( callback(vedata, ob, engine, depsgraph); } DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END - - DRW_hair_update(); } static struct DRWSelectBuffer { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6af169f5365] temp-keymap-changes: Test fix for drag after release
Commit: 6af169f5365357a2949cc694c300d756d07567db Author: Campbell Barton Date: Thu Jun 7 18:56:51 2018 +0200 Branches: temp-keymap-changes https://developer.blender.org/rB6af169f5365357a2949cc694c300d756d07567db Test fix for drag after release === M source/blender/windowmanager/intern/wm_event_system.c === diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 02c585fc677..87afd04c719 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2557,9 +2557,14 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) /* eventstate stores if previous event was a KM_PRESS, in case that * wasn't handled, the KM_RELEASE will become a KM_CLICK */ - if (win && event->val == KM_PRESS) { - win->eventstate->check_click = true; - win->eventstate->check_drag = true; + if (win) { + if (event->val == KM_PRESS) { + win->eventstate->check_click = true; + win->eventstate->check_drag = true; + } + else if (event->val == KM_RELEASE) { + win->eventstate->check_drag = false; + } } if (win && win->eventstate->prevtype == event->type) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9eb4a74e9f4] temp-keymap-changes: Move pie menus into the 3D view
Commit: 9eb4a74e9f4f955bb1d1cc6b9c31d75111fae775 Author: Campbell Barton Date: Thu Jun 7 18:48:20 2018 +0200 Branches: temp-keymap-changes https://developer.blender.org/rB9eb4a74e9f4f955bb1d1cc6b9c31d75111fae775 Move pie menus into the 3D view === M release/scripts/startup/bl_operators/wm.py M release/scripts/startup/bl_ui/space_view3d.py M source/blender/editors/mesh/mesh_ops.c M source/blender/editors/object/object_ops.c M source/blender/editors/space_view3d/view3d_ops.c === diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 6eba0b18382..faece08a039 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2403,43 +2403,6 @@ class WM_OT_toolbar(Operator): return {'FINISHED'} -class VIEW3D_PIE_object_mode_of(Menu): -bl_label = "Mode" - -def draw(self, context): -layout = self.layout - -pie = layout.menu_pie() -pie.operator_enum("OBJECT_OT_mode_set", "mode") - - -class VIEW3D_PIE_view_of(Menu): -bl_label = "View" -bl_idname = "VIEW3D_PIE_view_of" - -def draw(self, context): -layout = self.layout - -pie = layout.menu_pie() -pie.operator_enum("VIEW3D_OT_viewnumpad", "type") -pie.operator("view3d.view_selected", text="View Selected", icon='ZOOM_SELECTED') - - -class VIEW3D_PIE_view_more_of(Menu): -bl_label = "More" - -def draw(self, context): -layout = self.layout - -pie = layout.menu_pie() -pie.operator("VIEW3D_OT_view_persportho", text="Persp/Ortho", icon='RESTRICT_VIEW_OFF') -pie.operator("VIEW3D_OT_camera_to_view") -pie.operator("VIEW3D_OT_view_selected") -pie.operator("VIEW3D_OT_view_all") -pie.operator("VIEW3D_OT_localview") -pie.operator("SCREEN_OT_region_quadview") - - classes = ( BRUSH_OT_active_index_set, WM_OT_addon_disable, @@ -2496,8 +2459,4 @@ classes = ( WM_OT_url_open, WM_OT_tool_set_by_name, WM_OT_toolbar, - -VIEW3D_PIE_object_mode_of, -VIEW3D_PIE_view_of, -VIEW3D_PIE_view_more_of, ) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index c17b089e04c..9be882ba387 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3394,6 +3394,45 @@ class VIEW3D_MT_edit_gpencil_interpolate(Menu): layout.operator("gpencil.interpolate_sequence", text="Sequence") +class VIEW3D_PIE_object_mode(Menu): +bl_label = "Mode" + +def draw(self, context): +layout = self.layout + +pie = layout.menu_pie() +pie.operator_enum("OBJECT_OT_mode_set", "mode") + + +class VIEW3D_PIE_view(Menu): +bl_label = "View" +bl_idname = "VIEW3D_PIE_view_of" + +def draw(self, context): +layout = self.layout + +pie = layout.menu_pie() +pie.operator_enum("VIEW3D_OT_viewnumpad", "type") +pie.operator("view3d.view_selected", text="View Selected", icon='ZOOM_SELECTED') + + +class VIEW3D_PIE_view_more(Menu): +bl_label = "More" + +def draw(self, context): +layout = self.layout + +pie = layout.menu_pie() +pie.operator("VIEW3D_OT_view_persportho", text="Persp/Ortho", icon='RESTRICT_VIEW_OFF') +pie.operator("VIEW3D_OT_camera_to_view") +pie.operator("VIEW3D_OT_view_selected") +pie.operator("VIEW3D_OT_view_all") +pie.operator("VIEW3D_OT_localview") +pie.operator("SCREEN_OT_region_quadview") + + + + # ** Panel ** @@ -4009,6 +4048,8 @@ classes = ( VIEW3D_MT_edit_armature_delete, VIEW3D_MT_edit_gpencil_transform, VIEW3D_MT_edit_gpencil_interpolate, +VIEW3D_PIE_object_mode, +VIEW3D_PIE_view, VIEW3D_PT_grease_pencil, VIEW3D_PT_grease_pencil_palettecolor, VIEW3D_PT_view3d_properties, diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index e573aa38a60..f5c5a85d5ca 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -352,7 +352,6 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", THREEKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", SCE_SELECT_FACE); RNA_boolean_set(kmi->ptr, "use_extend", true); - /* standard mouse selection goes via space_view3d */ kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 168a0118f57..af572824068 100644 --- a/source/blender/editors/object/object_ops.c +++
[Bf-blender-cvs] [3b556a477d0] blender2.8: Merge branch 'master' into blender2.8
Commit: 3b556a477d0741eb26d10a2e91979353346011f7 Author: Bastien Montagne Date: Thu Jun 7 18:45:45 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB3b556a477d0741eb26d10a2e91979353346011f7 Merge branch 'master' into blender2.8 Conflicts: source/blender/editors/sculpt_paint/paint_vertex.c source/blender/editors/sculpt_paint/sculpt.c source/blender/editors/sculpt_paint/sculpt_undo.c === === diff --cc source/blender/editors/sculpt_paint/paint_vertex.c index 52c096b712e,7bbb4467f6f..dab207d7350 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@@ -974,7 -944,7 +974,7 @@@ static void vertex_paint_init_session(D if (ob->sculpt == NULL) { ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); - BKE_sculpt_update_mesh_elements(depsgraph, scene, scene->toolsettings->sculpt, ob, 0, false); - BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, false, false); ++ BKE_sculpt_update_mesh_elements(depsgraph, scene, scene->toolsettings->sculpt, ob, false, false); } } diff --cc source/blender/editors/sculpt_paint/sculpt.c index 985857d3f7a,40d11e0197b..ad8ed59ff5c --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@@ -5628,8 -5616,7 +5628,8 @@@ static void sculpt_init_session(Depsgra BKE_sculpt_toolsettings_data_ensure(scene); ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); - BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, false, false); + ob->sculpt->mode_type = OB_MODE_SCULPT; - BKE_sculpt_update_mesh_elements(depsgraph, scene, scene->toolsettings->sculpt, ob, 0, false); ++ BKE_sculpt_update_mesh_elements(depsgraph, scene, scene->toolsettings->sculpt, ob, false, false); } static int ed_object_sculptmode_flush_recalc_flag(Scene *scene, Object *ob, MultiresModifierData *mmd) diff --cc source/blender/editors/sculpt_paint/sculpt_undo.c index bc51606f3e5,bf5ddeb71ff..01b879a4c34 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@@ -158,7 -156,7 +158,7 @@@ static bool sculpt_undo_restore_coords( if (kb) { ob->shapenr = BLI_findindex(>block, kb) + 1; - BKE_sculpt_update_mesh_elements(depsgraph, scene, sd, ob, 0, false); - BKE_sculpt_update_mesh_elements(scene, sd, ob, false, false); ++ BKE_sculpt_update_mesh_elements(depsgraph, scene, sd, ob, false, false); WM_event_add_notifier(C, NC_OBJECT | ND_DATA, ob); } else { @@@ -493,12 -490,10 +493,12 @@@ static void sculpt_undo_restore_list(bC } } - BKE_sculpt_update_mesh_elements(scene, sd, ob, false, need_mask); + DEG_id_tag_update(>id, DEG_TAG_COPY_ON_WRITE); + - BKE_sculpt_update_mesh_elements(depsgraph, scene, sd, ob, 0, need_mask); ++ BKE_sculpt_update_mesh_elements(depsgraph, scene, sd, ob, false, need_mask); /* call _after_ sculpt_update_mesh_elements() which may update 'ob->derivedFinal' */ - dm = mesh_get_derived_final(scene, ob, 0); + dm = mesh_get_derived_final(depsgraph, scene, ob, 0); if (lb->first && sculpt_undo_bmesh_restore(C, lb->first, ob, ss)) return; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5593baea1bb] blender2.8: Remove printfs
Commit: 5593baea1bb51d7423b9413606efbdc6004093fd Author: Clément Foucault Date: Thu Jun 7 18:44:37 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB5593baea1bb51d7423b9413606efbdc6004093fd Remove printfs ... it's getting late here. === M source/blender/draw/intern/draw_cache_impl_particles.c === diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 1eea400b63d..380cb089628 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -182,7 +182,6 @@ static void particle_batch_cache_clear_hair(ParticleHairCache *hair_cache) GWN_VERTBUF_DISCARD_SAFE(hair_cache->final[i].proc_buf); DRW_TEXTURE_FREE_SAFE(hair_cache->final[i].proc_tex); for (int j = 0; j < MAX_THICKRES; ++j) { - printf("Free cache->final[%d].proc_hairs[%d]\n", i, j); GWN_BATCH_DISCARD_SAFE(hair_cache->final[i].proc_hairs[j]); } } @@ -976,7 +975,6 @@ static void particle_batch_cache_ensure_procedural_indices( } } - printf("Alloc cache->final[%d].proc_hairs[%d]\n", subdiv, thickness_res - 1); cache->final[subdiv].proc_hairs[thickness_res - 1] = GWN_batch_create_ex( prim_type, vbo, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a3773dcc4fa] blender2.8: Fix memleak with GPUhairs.
Commit: a3773dcc4fa0ab5dd268382019f5614948a623b9 Author: Clément Foucault Date: Thu Jun 7 18:43:10 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBa3773dcc4fa0ab5dd268382019f5614948a623b9 Fix memleak with GPUhairs. === M source/blender/draw/intern/draw_cache_impl_particles.c === diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 46469136243..1eea400b63d 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -181,7 +181,8 @@ static void particle_batch_cache_clear_hair(ParticleHairCache *hair_cache) for (int i = 0; i < MAX_HAIR_SUBDIV; ++i) { GWN_VERTBUF_DISCARD_SAFE(hair_cache->final[i].proc_buf); DRW_TEXTURE_FREE_SAFE(hair_cache->final[i].proc_tex); - for (int j = 0; j < MAX_THICKRES - 1; ++j) { + for (int j = 0; j < MAX_THICKRES; ++j) { + printf("Free cache->final[%d].proc_hairs[%d]\n", i, j); GWN_BATCH_DISCARD_SAFE(hair_cache->final[i].proc_hairs[j]); } } @@ -975,6 +976,7 @@ static void particle_batch_cache_ensure_procedural_indices( } } + printf("Alloc cache->final[%d].proc_hairs[%d]\n", subdiv, thickness_res - 1); cache->final[subdiv].proc_hairs[thickness_res - 1] = GWN_batch_create_ex( prim_type, vbo, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0859492c758] blender2.8: Fix crash cause by SSS referencing Material Nodetree data.
Commit: 0859492c758eaa6b8f35e77b95778266ce0f24cb Author: Clément Foucault Date: Thu Jun 7 18:43:43 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB0859492c758eaa6b8f35e77b95778266ce0f24cb Fix crash cause by SSS referencing Material Nodetree data. === M source/blender/gpu/GPU_material.h M source/blender/gpu/intern/gpu_material.c === diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index f780eda62fe..cddcb3a546e 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -238,7 +238,7 @@ GPUNodeLink *GPU_uniformbuffer_link_out( void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link); GPUBuiltin GPU_get_material_builtins(GPUMaterial *material); -void GPU_material_sss_profile_create(GPUMaterial *material, float *radii, short *falloff_type, float *sharpness); +void GPU_material_sss_profile_create(GPUMaterial *material, float radii[3], short *falloff_type, float *sharpness); struct GPUUniformBuffer *GPU_material_sss_profile_get( GPUMaterial *material, int sample_ct, struct GPUTexture **tex_profile); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 96c321f9107..0404425ac3f 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -127,10 +127,11 @@ struct GPUMaterial { /* Eevee SSS */ GPUUniformBuffer *sss_profile; /* UBO containing SSS profile. */ GPUTexture *sss_tex_profile; /* Texture containing SSS profile. */ - float *sss_radii; /* UBO containing SSS profile. */ + float sss_enabled; + float sss_radii[3]; int sss_samples; - short int *sss_falloff; - float *sss_sharpness; + short int sss_falloff; + float sss_sharpness; bool sss_dirty; }; @@ -328,7 +329,7 @@ static float eval_integral(float x0, float x1, short falloff_type, float sharpne #undef INTEGRAL_RESOLUTION static void compute_sss_kernel( -GPUSssKernelData *kd, float *radii, int sample_ct, int falloff_type, float sharpness) +GPUSssKernelData *kd, float radii[3], int sample_ct, int falloff_type, float sharpness) { float rad[3]; /* Minimum radius */ @@ -483,12 +484,13 @@ static void compute_sss_translucence_kernel( } #undef INTEGRAL_RESOLUTION -void GPU_material_sss_profile_create(GPUMaterial *material, float *radii, short *falloff_type, float *sharpness) +void GPU_material_sss_profile_create(GPUMaterial *material, float radii[3], short *falloff_type, float *sharpness) { - material->sss_radii = radii; - material->sss_falloff = falloff_type; - material->sss_sharpness = sharpness; + copy_v3_v3(material->sss_radii, radii); + material->sss_falloff = (falloff_type) ? *falloff_type : 0.0; + material->sss_sharpness = (sharpness) ? *sharpness : 0.0; material->sss_dirty = true; + material->sss_enabled = true; /* Update / Create UBO */ if (material->sss_profile == NULL) { @@ -498,25 +500,25 @@ void GPU_material_sss_profile_create(GPUMaterial *material, float *radii, short struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int sample_ct, GPUTexture **tex_profile) { - if (material->sss_radii == NULL) + if (!material->sss_enabled) return NULL; if (material->sss_dirty || (material->sss_samples != sample_ct)) { GPUSssKernelData kd; - float sharpness = (material->sss_sharpness != NULL) ? *material->sss_sharpness : 0.0f; + float sharpness = material->sss_sharpness; /* XXX Black magic but it seems to fit. Maybe because we integrate -1..1 */ sharpness *= 0.5f; - compute_sss_kernel(, material->sss_radii, sample_ct, *material->sss_falloff, sharpness); + compute_sss_kernel(, material->sss_radii, sample_ct, material->sss_falloff, sharpness); /* Update / Create UBO */ GPU_uniformbuffer_update(material->sss_profile, ); /* Update / Create Tex */ float *translucence_profile; - compute_sss_translucence_kernel(, 64, *material->sss_falloff, sharpness, _profile); + compute_sss_translucence_kernel(, 64, material->sss_falloff, sharpness, _profile); if (material->sss_tex_profile != NULL) { GPU_texture_free(material->sss_tex_profile); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [80dcb2ced8a] master: Cleanup: typo, and 0 -> false for booleans.
Commit: 80dcb2ced8a06caf6c47cb9c767214db33140fcb Author: Bastien Montagne Date: Thu Jun 7 18:35:37 2018 +0200 Branches: master https://developer.blender.org/rB80dcb2ced8a06caf6c47cb9c767214db33140fcb Cleanup: typo, and 0 -> false for booleans. === M source/blender/blenkernel/intern/paint.c M source/blender/editors/sculpt_paint/paint_vertex.c M source/blender/editors/sculpt_paint/sculpt.c M source/blender/editors/sculpt_paint/sculpt_undo.c === diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 144ec029db1..4ba9cbf7ea0 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -948,12 +948,12 @@ void BKE_sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, /* if pbvh is deformed, key block is already applied to it */ if (ss->kb) { - bool pbvh_deformd = BKE_pbvh_isDeformed(ss->pbvh); - if (!pbvh_deformd || ss->deform_cos == NULL) { + bool pbvh_deformed = BKE_pbvh_isDeformed(ss->pbvh); + if (!pbvh_deformed || ss->deform_cos == NULL) { float (*vertCos)[3] = BKE_keyblock_convert_to_vertcos(ob, ss->kb); if (vertCos) { - if (!pbvh_deformd) { + if (!pbvh_deformed) { /* apply shape keys coordinates to PBVH */ BKE_pbvh_apply_vertCos(ss->pbvh, vertCos); } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index a496c4cb01d..7bbb4467f6f 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -944,7 +944,7 @@ static void vertex_paint_init_session(Scene *scene, Object *ob) if (ob->sculpt == NULL) { ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); - BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, false); + BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, false, false); } } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index ca4ad39d14e..40d11e0197b 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5616,7 +5616,7 @@ static void sculpt_init_session(Scene *scene, Object *ob) BKE_sculpt_toolsettings_data_ensure(scene); ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); - BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, false); + BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, false, false); } static int ed_object_sculptmode_flush_recalc_flag(Scene *scene, Object *ob, MultiresModifierData *mmd) diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index cd03c3ec7e2..bf5ddeb71ff 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -156,7 +156,7 @@ static bool sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoN if (kb) { ob->shapenr = BLI_findindex(>block, kb) + 1; - BKE_sculpt_update_mesh_elements(scene, sd, ob, 0, false); + BKE_sculpt_update_mesh_elements(scene, sd, ob, false, false); WM_event_add_notifier(C, NC_OBJECT | ND_DATA, ob); } else { @@ -490,7 +490,7 @@ static void sculpt_undo_restore_list(bContext *C, ListBase *lb) } } - BKE_sculpt_update_mesh_elements(scene, sd, ob, 0, need_mask); + BKE_sculpt_update_mesh_elements(scene, sd, ob, false, need_mask); /* call _after_ sculpt_update_mesh_elements() which may update 'ob->derivedFinal' */ dm = mesh_get_derived_final(scene, ob, 0); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [15dd7bdf1ea] temp-keymap-changes: Correct enum
Commit: 15dd7bdf1ea4bfffacb3701a558df5aa1106bc69 Author: Campbell Barton Date: Thu Jun 7 18:31:47 2018 +0200 Branches: temp-keymap-changes https://developer.blender.org/rB15dd7bdf1ea4bfffacb3701a558df5aa1106bc69 Correct enum === M source/blender/editors/mesh/mesh_ops.c === diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index c0f133e9cfd..e573aa38a60 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -345,13 +345,14 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", ONEKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", SCE_SELECT_VERTEX); - RNA_boolean_set(kmi->ptr, "extend", true); + RNA_boolean_set(kmi->ptr, "use_extend", true); kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", TWOKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", SCE_SELECT_EDGE); - RNA_boolean_set(kmi->ptr, "extend", true); + RNA_boolean_set(kmi->ptr, "use_extend", true); kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", THREEKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", SCE_SELECT_FACE); - RNA_boolean_set(kmi->ptr, "extend", true); + RNA_boolean_set(kmi->ptr, "use_extend", true); + /* standard mouse selection goes via space_view3d */ kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e2edea18c94] temp-keymap-changes: Try using pie menu for mode switching
Commit: e2edea18c94976bbd72db5436547d1b1062437a8 Author: Campbell Barton Date: Thu Jun 7 18:23:46 2018 +0200 Branches: temp-keymap-changes https://developer.blender.org/rBe2edea18c94976bbd72db5436547d1b1062437a8 Try using pie menu for mode switching === M release/scripts/startup/bl_operators/wm.py M source/blender/editors/mesh/mesh_ops.c M source/blender/editors/object/object_ops.c M source/blender/editors/screen/screen_ops.c M source/blender/editors/space_image/space_image.c M source/blender/editors/space_view3d/view3d_ops.c M source/blender/windowmanager/intern/wm_operators.c === diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index e62a1f071a9..6eba0b18382 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -19,7 +19,10 @@ # import bpy -from bpy.types import Operator +from bpy.types import ( +Operator, +Menu, +) from bpy.props import ( BoolProperty, EnumProperty, @@ -2400,6 +2403,43 @@ class WM_OT_toolbar(Operator): return {'FINISHED'} +class VIEW3D_PIE_object_mode_of(Menu): +bl_label = "Mode" + +def draw(self, context): +layout = self.layout + +pie = layout.menu_pie() +pie.operator_enum("OBJECT_OT_mode_set", "mode") + + +class VIEW3D_PIE_view_of(Menu): +bl_label = "View" +bl_idname = "VIEW3D_PIE_view_of" + +def draw(self, context): +layout = self.layout + +pie = layout.menu_pie() +pie.operator_enum("VIEW3D_OT_viewnumpad", "type") +pie.operator("view3d.view_selected", text="View Selected", icon='ZOOM_SELECTED') + + +class VIEW3D_PIE_view_more_of(Menu): +bl_label = "More" + +def draw(self, context): +layout = self.layout + +pie = layout.menu_pie() +pie.operator("VIEW3D_OT_view_persportho", text="Persp/Ortho", icon='RESTRICT_VIEW_OFF') +pie.operator("VIEW3D_OT_camera_to_view") +pie.operator("VIEW3D_OT_view_selected") +pie.operator("VIEW3D_OT_view_all") +pie.operator("VIEW3D_OT_localview") +pie.operator("SCREEN_OT_region_quadview") + + classes = ( BRUSH_OT_active_index_set, WM_OT_addon_disable, @@ -2456,4 +2496,8 @@ classes = ( WM_OT_url_open, WM_OT_tool_set_by_name, WM_OT_toolbar, + +VIEW3D_PIE_object_mode_of, +VIEW3D_PIE_view_of, +VIEW3D_PIE_view_more_of, ) diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index b3c507affb7..c0f133e9cfd 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -335,6 +335,24 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "vertex_only", true); /* selecting */ + + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", ONEKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_VERTEX); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", TWOKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_EDGE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", THREEKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_FACE); + + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", ONEKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_VERTEX); + RNA_boolean_set(kmi->ptr, "extend", true); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", TWOKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_EDGE); + RNA_boolean_set(kmi->ptr, "extend", true); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", THREEKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "type", SCE_SELECT_FACE); + RNA_boolean_set(kmi->ptr, "extend", true); + /* standard mouse selection goes via space_view3d */ kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", false); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 915395f22e6..168a0118f57 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -289,23 +289,11 @@ void ED_keymap_object(wmKeyConfig *keyconf) keymap = WM_keymap_find(keyconf, "Object Non-modal", 0, 0); /* modes */ - { - short key_mode_pair[][2] = { - {ONEKEY, OB_MODE_OBJECT}, - {TWOKEY, OB_MODE_EDIT}, - {THREEKEY, OB_MODE_POSE}, - {THREEKEY, OB_MODE_WEIGHT_PAINT}, - {FOURKEY, OB_MODE_VERTEX_PAINT}, -
[Bf-blender-cvs] [f9ca750bdf5] blender2.8: Wireframe: Change / Optimize the limited wireframe visibility option.
Commit: f9ca750bdf5e071eb240b55ee1e701e04dd7423c Author: Clément Foucault Date: Thu Jun 7 16:55:41 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBf9ca750bdf5e071eb240b55ee1e701e04dd7423c Wireframe: Change / Optimize the limited wireframe visibility option. This make the limited wireframe not a performance problem anymore. However, this does change the number of edges displayed as the threshold is now computed per vertex instead of per edges. For this reason we extended (internaly) the range of the slider so that the users can hide more edge. === M source/blender/draw/intern/draw_cache.c M source/blender/draw/intern/draw_cache.h M source/blender/draw/intern/draw_cache_impl.h M source/blender/draw/intern/draw_cache_impl_mesh.c M source/blender/draw/modes/overlay_mode.c M source/blender/draw/modes/shaders/overlay_face_wireframe_frag.glsl M source/blender/draw/modes/shaders/overlay_face_wireframe_geom.glsl M source/blender/draw/modes/shaders/overlay_face_wireframe_vert.glsl === diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index d6cea03d573..14addfe9bcb 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -526,17 +526,6 @@ void DRW_cache_object_face_wireframe_get( } } -void DRW_cache_object_face_wireframe_pretty_get( -Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count) -{ - switch (ob->type) { - case OB_MESH: - DRW_mesh_batch_cache_get_pretty_wireframes_face_texbuf((Mesh *)ob->data, r_vert_tx, r_faceid_tx, r_tri_count); - - /* TODO, should match 'DRW_cache_object_surface_get' */ - } -} - Gwn_Batch *DRW_cache_object_loose_edges_get(struct Object *ob) { switch (ob->type) { diff --git a/source/blender/draw/intern/draw_cache.h b/source/blender/draw/intern/draw_cache.h index 705192653f5..7a1c14b5076 100644 --- a/source/blender/draw/intern/draw_cache.h +++ b/source/blender/draw/intern/draw_cache.h @@ -56,8 +56,6 @@ struct Gwn_Batch **DRW_cache_object_surface_material_get( char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count); void DRW_cache_object_face_wireframe_get( Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count); -void DRW_cache_object_face_wireframe_pretty_get( -Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count); /* Empties */ struct Gwn_Batch *DRW_cache_plain_axes_get(void); diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h index 2824021bb29..0f990c72d01 100644 --- a/source/blender/draw/intern/draw_cache_impl.h +++ b/source/blender/draw/intern/draw_cache_impl.h @@ -126,8 +126,6 @@ struct Gwn_Batch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me, /* Object mode Wireframe overlays */ void DRW_mesh_batch_cache_get_wireframes_face_texbuf( struct Mesh *me, struct GPUTexture **verts_data, struct GPUTexture **face_indices, int *tri_count); -void DRW_mesh_batch_cache_get_pretty_wireframes_face_texbuf( -struct Mesh *me, struct GPUTexture **verts_data, struct GPUTexture **face_indices, int *tri_count); void DRW_mesh_cache_sculpt_coords_ensure(struct Mesh *me); diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 53b3cadafe2..b6bd15ba2c2 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -1592,9 +1592,7 @@ typedef struct MeshBatchCache { Gwn_Batch *edge_detection; Gwn_VertBuf *edges_face_overlay; - Gwn_VertBuf *edges_face_overlay_adj; GPUTexture *edges_face_overlay_tx; - GPUTexture *edges_face_overlay_adj_tx; int edges_face_overlay_tri_count; /* Number of tri in edges_face_overlay(_adj)_tx */ /* Maybe have shaded_triangles_data split into pos_nor and uv_tangent @@ -1877,9 +1875,7 @@ static void mesh_batch_cache_clear(Mesh *me) GWN_BATCH_DISCARD_SAFE(cache->edge_detection); GWN_VERTBUF_DISCARD_SAFE(cache->edges_face_overlay); - GWN_VERTBUF_DISCARD_SAFE(cache->edges_face_overlay_adj); DRW_TEXTURE_FREE_SAFE(cache->edges_face_overlay_tx); - DRW_TEXTURE_FREE_SAFE(cache->edges_face_overlay_adj_tx); GWN_VERTBUF_DISCARD_SAFE(cache->shaded_triangles_data); if (cache->shaded_triangles_in_order) { @@ -3468,26 +3464,6 @@ static Gwn_VertBuf *mesh_batch_cache_create_edges_overlay_adj_texture_buf(MeshRe return vbo; } -static GPUTexture *mesh_batch_cache_get_edges_overlay_adj_texture_buf(MeshRenderData *rdata,
[Bf-blender-cvs] [00233f5f78e] blender2.8: Wireframe: Fix edges or non manifold meshes not showing.
Commit: 00233f5f78e6cb4b38fdb1d09d0f4b56dca8a306 Author: Clément Foucault Date: Thu Jun 7 18:01:29 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB00233f5f78e6cb4b38fdb1d09d0f4b56dca8a306 Wireframe: Fix edges or non manifold meshes not showing. This will show the associated edges to the vertices but that's the only workaround I can think of right now. === M source/blender/draw/intern/draw_cache_impl_mesh.c M source/blender/draw/modes/shaders/overlay_face_wireframe_geom.glsl M source/blender/draw/modes/shaders/overlay_face_wireframe_vert.glsl === diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index b6bd15ba2c2..c5d5eac51b7 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -3391,22 +3391,21 @@ static EdgeHash *create_looptri_edge_adjacency_hash(MeshRenderData *rdata) return eh; } -static Gwn_VertBuf *mesh_batch_cache_create_edges_overlay_adj_texture_buf(MeshRenderData *rdata, bool do_adjacency) +static Gwn_VertBuf *mesh_batch_cache_create_edges_overlay_texture_buf(MeshRenderData *rdata) { const int tri_len = mesh_render_data_looptri_len_get(rdata); Gwn_VertFormat format = {0}; - uint index_id = GWN_vertformat_attr_add(, "index", GWN_COMP_I32, 1, GWN_FETCH_INT); + uint index_id = GWN_vertformat_attr_add(, "index", GWN_COMP_U32, 1, GWN_FETCH_INT); Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(); - int vbo_len_capacity = tri_len * ((do_adjacency) ? 6 : 3); + int vbo_len_capacity = tri_len * 3; GWN_vertbuf_data_alloc(vbo, vbo_len_capacity); int vidx = 0; EdgeHash *eh = NULL; - if (do_adjacency) { - eh = create_looptri_edge_adjacency_hash(rdata); - } + eh = create_looptri_edge_adjacency_hash(rdata); + for (int i = 0; i < tri_len; i++) { bool edge_is_real[3] = {false, false, false}; @@ -3427,33 +3426,23 @@ static Gwn_VertBuf *mesh_batch_cache_create_edges_overlay_adj_texture_buf(MeshRe } for (int e = 0; e < 3; ++e) { - /* Save if there is an edge or not inside the sign bit. */ int v0 = mloop[mlt->tri[e]].v; - int value = (int)v0 + 1; /* Int 0 cannot be signed */ - value = (edge_is_real[e]) ? -value : value; - GWN_vertbuf_attr_set(vbo, index_id, vidx++, ); - - if (do_adjacency) { - int v1 = mloop[mlt->tri[(e + 1) % 3]].v; - int v2 = mloop[mlt->tri[(e + 2) % 3]].v; - EdgeAdjacentVerts *eav = BLI_edgehash_lookup(eh, v0, v1); - int adj_v; - if (eav->vert_index[0] != v2) { - adj_v = eav->vert_index[0]; - } - else if (eav->vert_index[1] != -1) { - adj_v = eav->vert_index[1]; - } - else { - adj_v = v2; /* Non-manifold edge */ - } - GWN_vertbuf_attr_set(vbo, index_id, vidx++, _v); + int v1 = mloop[mlt->tri[(e + 1) % 3]].v; + EdgeAdjacentVerts *eav = BLI_edgehash_lookup(eh, v0, v1); + uint value = (uint)v0; + /* Real edge */ + if (edge_is_real[e]) { + value |= (1 << 30); + } + /* Non-manifold edge */ + if (eav->vert_index[1] == -1) { + value |= (1 << 31); } + GWN_vertbuf_attr_set(vbo, index_id, vidx++, ); } } - if (do_adjacency) { - BLI_edgehash_free(eh, MEM_freeN); - } + + BLI_edgehash_free(eh, MEM_freeN); int vbo_len_used = vidx; @@ -3474,7 +3463,7 @@ static GPUTexture *mesh_batch_cache_get_edges_overlay_texture_buf(MeshRenderData return cache->edges_face_overlay_tx; } - Gwn_VertBuf *vbo = cache->edges_face_overlay = mesh_batch_cache_create_edges_overlay_adj_texture_buf(rdata, false); + Gwn_VertBuf *vbo = cache->edges_face_overlay = mesh_batch_cache_create_edges_overlay_texture_buf(rdata); /* Upload data early because we need to create the texture for it. */ GWN_vertbuf_use(vbo); diff --git
[Bf-blender-cvs] [9e1bdca3baa] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: 9e1bdca3baaab12092e07676c26e78b6b3372301 Author: Antonio Vazquez Date: Thu Jun 7 18:00:21 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB9e1bdca3baaab12092e07676c26e78b6b3372301 Merge branch 'blender2.8' 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] [2882430d37d] greasepencil-object: Reorganize Mix Color with Texture
Commit: 2882430d37d8a43330af08d2abdc1c0092e105b6 Author: Antonio Vazquez Date: Thu Jun 7 17:51:12 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB2882430d37d8a43330af08d2abdc1c0092e105b6 Reorganize Mix Color with Texture Now, the mis is only with texture to avoid duplicate texture parameters that made the panel difficult to understand. === M release/scripts/startup/bl_ui/properties_material_gpencil.py M source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl === diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py index 037646b09d9..7084dadef82 100644 --- a/release/scripts/startup/bl_ui/properties_material_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py @@ -188,7 +188,7 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): layout.use_property_split = True ma = context.object.active_material -if (ma is not None) and (ma.grease_pencil): +if ma is not None and ma.grease_pencil: gpcolor = ma.grease_pencil # color settings @@ -205,7 +205,7 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): if gpcolor.fill_style in ('GRADIENT', 'CHESSBOARD'): col.prop(gpcolor, "mix_color", text="Secondary Color") -if gpcolor.texture_mix is True or gpcolor.fill_style == 'GRADIENT': +if gpcolor.fill_style == 'GRADIENT': col.prop(gpcolor, "mix_factor", text="Mix Factor", slider=True) if gpcolor.fill_style in ('GRADIENT', 'CHESSBOARD'): @@ -223,10 +223,6 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): if gpcolor.fill_style == 'CHESSBOARD': col.prop(gpcolor, "pattern_boxsize", text="Box") -# Solid -if gpcolor.fill_style == 'SOLID': -col.prop(gpcolor, "texture_mix", text="Mix With Texture") - # Texture if gpcolor.fill_style == 'TEXTURE' or (gpcolor.texture_mix is True and gpcolor.fill_style == 'SOLID'): col.template_ID(gpcolor, "fill_image", open="image.open") @@ -242,6 +238,13 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): col.prop(gpcolor, "texture_opacity") col.prop(gpcolor, "texture_clamp", text="Clip Image") +if gpcolor.use_fill_pattern is False: +col.prop(gpcolor, "texture_mix", text="Mix With Color") + +if gpcolor.texture_mix is True: +col.prop(gpcolor, "fill_color", text="Mix Color") +col.prop(gpcolor, "mix_factor", text="Mix Factor", slider=True) + class MATERIAL_PT_gpencil_options(GPMaterialButtonsPanel, Panel): bl_label = "Options" diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl index 0eebd865bb7..da5cfdc457f 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl @@ -80,7 +80,7 @@ void main() /* solid fill */ if (fill_type == SOLID) { - fragColor = (texture_mix == 1) ? mix(finalColor, text_color, mix_factor) : finalColor; + fragColor = finalColor; } else { vec2 center = vec2(0.5, 0.5) + gradient_shift; @@ -118,7 +118,7 @@ void main() } /* texture */ if (fill_type == TEXTURE) { - fragColor = text_color; + fragColor = (texture_mix == 1) ? mix(text_color, finalColor, mix_factor) : text_color; } /* pattern */ if (fill_type == PATTERN) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e5615c78356] greasepencil-object: UI: Include Stroke and Fill as subpanels of Surface Panel.
Commit: e5615c783563981a3db25a86c0f886418c3832c0 Author: Antonio Vazquez Date: Thu Jun 7 17:39:21 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBe5615c783563981a3db25a86c0f886418c3832c0 UI: Include Stroke and Fill as subpanels of Surface Panel. === M release/scripts/startup/bl_ui/properties_material_gpencil.py === diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py index 0f5c44ae51e..037646b09d9 100644 --- a/release/scripts/startup/bl_ui/properties_material_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py @@ -137,9 +137,18 @@ class MATERIAL_PT_gpencil_slots(Panel): split.template_ID(space, "pin_id") split.separator() +class MATERIAL_PT_gpencil_surface(GPMaterialButtonsPanel, Panel): +bl_label = "Surface" + +@staticmethod +def draw(self, context): +layout = self.layout +layout.use_property_split = True + class MATERIAL_PT_gpencil_strokecolor(GPMaterialButtonsPanel, Panel): bl_label = "Stroke" +bl_parent_id = 'MATERIAL_PT_gpencil_surface' @staticmethod def draw(self, context): @@ -171,6 +180,7 @@ class MATERIAL_PT_gpencil_strokecolor(GPMaterialButtonsPanel, Panel): class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): bl_label = "Fill" +bl_parent_id = 'MATERIAL_PT_gpencil_surface' @staticmethod def draw(self, context): @@ -251,6 +261,7 @@ class MATERIAL_PT_gpencil_options(GPMaterialButtonsPanel, Panel): classes = ( GPENCIL_UL_matslots, MATERIAL_PT_gpencil_slots, +MATERIAL_PT_gpencil_surface, MATERIAL_PT_gpencil_strokecolor, MATERIAL_PT_gpencil_fillcolor, MATERIAL_PT_gpencil_options, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1f388a21885] greasepencil-object: UI: Move Pass Index to separate Panel
Commit: 1f388a218856a95c55b5c45659914db36bc74c76 Author: Antonio Vazquez Date: Thu Jun 7 17:23:03 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB1f388a218856a95c55b5c45659914db36bc74c76 UI: Move Pass Index to separate Panel === M release/scripts/startup/bl_ui/properties_material_gpencil.py === diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py index d6a286bda57..0f5c44ae51e 100644 --- a/release/scripts/startup/bl_ui/properties_material_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py @@ -168,9 +168,6 @@ class MATERIAL_PT_gpencil_strokecolor(GPMaterialButtonsPanel, Panel): if gpcolor.stroke_style == 'SOLID' or gpcolor.use_stroke_pattern is True: col.prop(gpcolor, "color", text="Color") -# Options -col.prop(gpcolor, "pass_index") - class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): bl_label = "Fill" @@ -236,11 +233,27 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): col.prop(gpcolor, "texture_clamp", text="Clip Image") +class MATERIAL_PT_gpencil_options(GPMaterialButtonsPanel, Panel): +bl_label = "Options" +bl_options = {'DEFAULT_CLOSED'} + +@staticmethod +def draw(self, context): +layout = self.layout +layout.use_property_split = True + +ma = context.object.active_material +if ma is not None and ma.grease_pencil is not None: +gpcolor = ma.grease_pencil +layout.prop(gpcolor, "pass_index") + + classes = ( GPENCIL_UL_matslots, MATERIAL_PT_gpencil_slots, MATERIAL_PT_gpencil_strokecolor, MATERIAL_PT_gpencil_fillcolor, +MATERIAL_PT_gpencil_options, ) if __name__ == "__main__": # only for live edit. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [75bff3c0137] soc-2018-cycles-volumes: Threshold sparse grid with volume mesh isovalue and optimize tile copying during grid generation.
Commit: 75bff3c0137e18a00bc9318549e6c3da8b7ae5ac Author: Geraldine Chua Date: Thu Jun 7 23:14:33 2018 +0800 Branches: soc-2018-cycles-volumes https://developer.blender.org/rB75bff3c0137e18a00bc9318549e6c3da8b7ae5ac Threshold sparse grid with volume mesh isovalue and optimize tile copying during grid generation. === M intern/cycles/blender/blender_mesh.cpp M intern/cycles/render/image.cpp M intern/cycles/render/image.h M intern/cycles/render/nodes.cpp M intern/cycles/util/util_sparse_grid.h === diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 8bf3f66dff6..f70e859ba8a 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -354,6 +354,7 @@ static void create_mesh_volume_attribute(BL::Object& b_ob, EXTENSION_CLIP, use_alpha, make_sparse, + mesh->volume_isovalue, metadata); } diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp index bef1419d178..61394700886 100644 --- a/intern/cycles/render/image.cpp +++ b/intern/cycles/render/image.cpp @@ -262,6 +262,7 @@ int ImageManager::add_image(const string& filename, ExtensionType extension, bool use_alpha, bool make_sparse, +float isovalue, ImageMetaData& metadata) { Image *img; @@ -340,6 +341,7 @@ int ImageManager::add_image(const string& filename, img->users = 1; img->use_alpha = use_alpha; img->make_sparse = make_sparse; + img->isovalue = isovalue; img->mem = NULL; images[type][slot] = img; @@ -743,6 +745,7 @@ bool ImageManager::file_make_image_sparse(Device *device, tex_img->data_width, tex_img->data_height, tex_img->data_depth, +img->isovalue, _grid, ); diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h index 7ef9cfb5ba5..7f4810968b2 100644 --- a/intern/cycles/render/image.h +++ b/intern/cycles/render/image.h @@ -57,6 +57,7 @@ public: ExtensionType extension, bool use_alpha, bool make_sparse, + float isovalue, ImageMetaData& metadata); void remove_image(int flat_slot); void remove_image(const string& filename, @@ -117,6 +118,7 @@ public: bool need_load; bool animated; bool make_sparse; + float isovalue; float frame; InterpolationType interpolation; ExtensionType extension; diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 71b1d42b25e..09201421813 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -308,6 +308,7 @@ void ImageTextureNode::compile(SVMCompiler& compiler) extension, use_alpha, false, + 0.0f, metadata); is_float = metadata.is_float; is_linear = metadata.is_linear; @@ -374,6 +375,7 @@ void ImageTextureNode::compile(OSLCompiler& compiler) extension, use_alpha, false, + 0.0f, metadata); } is_float = metadata.is_float; @@ -505,6 +507,7 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler) EXTENSION_REPEAT, use_alpha, false, + 0.0f, metadata); is_float = metadata.is_float; is_linear = metadata.is_linear; @@ -562,6 +565,7 @@ void EnvironmentTextureNode::compile(OSLCompiler& compiler) EXTENSION_REPEAT,
[Bf-blender-cvs] [998d1b091a9] soc-2018-cycles-volumes: Added sparse grid lookup to mesh volume generator.
Commit: 998d1b091a90454cdc65ed8ea8101f28984298e4 Author: Geraldine Chua Date: Wed Jun 6 23:51:56 2018 +0800 Branches: soc-2018-cycles-volumes https://developer.blender.org/rB998d1b091a90454cdc65ed8ea8101f28984298e4 Added sparse grid lookup to mesh volume generator. Also made some minor operator additions/changes. === M intern/cycles/render/mesh_volume.cpp M intern/cycles/util/util_math_float4.h M intern/cycles/util/util_math_int4.h M intern/cycles/util/util_sparse_grid.h === diff --git a/intern/cycles/render/mesh_volume.cpp b/intern/cycles/render/mesh_volume.cpp index d1c49b456ff..8a55b89abcc 100644 --- a/intern/cycles/render/mesh_volume.cpp +++ b/intern/cycles/render/mesh_volume.cpp @@ -21,27 +21,11 @@ #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_progress.h" +#include "util/util_sparse_grid.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN -static size_t compute_voxel_index(const int3 , size_t x, size_t y, size_t z) -{ - if(x == -1 || x >= resolution.x) { - return -1; - } - - if(y == -1 || y >= resolution.y) { - return -1; - } - - if(z == -1 || z >= resolution.z) { - return -1; - } - - return x + y*resolution.x + z*resolution.x*resolution.y; -} - struct QuadData { int v0, v1, v2, v3; @@ -200,7 +184,7 @@ void VolumeMeshBuilder::add_node(int x, int y, int z) assert((index_x >= 0) && (index_y >= 0) && (index_z >= 0)); - const size_t index = compute_voxel_index(res, index_x, index_y, index_z); + const size_t index = compute_index(index_x, index_y, index_z, res); /* We already have a node here. */ if(grid[index] == 1) { @@ -253,7 +237,7 @@ void VolumeMeshBuilder::generate_vertices_and_quads( for(int z = 0; z < res.z; ++z) { for(int y = 0; y < res.y; ++y) { for(int x = 0; x < res.x; ++x) { - size_t voxel_index = compute_voxel_index(res, x, y, z); + size_t voxel_index = compute_index(x, y, z, res); if(grid[voxel_index] == 0) { continue; } @@ -281,32 +265,32 @@ void VolumeMeshBuilder::generate_vertices_and_quads( * an inactive node. */ - voxel_index = compute_voxel_index(res, x - 1, y, z); + voxel_index = compute_index(x - 1, y, z, res); if(voxel_index == -1 || grid[voxel_index] == 0) { create_quad(corners, vertices_is, quads, QUAD_X_MIN); } - voxel_index = compute_voxel_index(res, x + 1, y, z); + voxel_index = compute_index(x + 1, y, z, res); if(voxel_index == -1 || grid[voxel_index] == 0) { create_quad(corners, vertices_is, quads, QUAD_X_MAX); } - voxel_index = compute_voxel_index(res, x, y - 1, z); + voxel_index = compute_index(x, y - 1, z, res); if(voxel_index == -1 || grid[voxel_index] == 0) { create_quad(corners, vertices_is, quads, QUAD_Y_MIN); } - voxel_index = compute_voxel_index(res, x, y + 1, z); + voxel_index = compute_index(x, y + 1, z, res); if(voxel_index == -1 || grid[voxel_index] == 0) { create_quad(corners, vertices_is, quads, QUAD_Y_MAX); } - voxel_index = compute_voxel_index(res, x, y, z - 1); + voxel_index = compute_index(x, y, z - 1, res); if(voxel_index == -1 || grid[voxel_index] == 0) { create_quad(corners, vertices_is, quads, QUAD_Z_MIN); } - voxel_index = compute_voxel_index(res, x, y, z + 1); + voxel_index = compute_index(x, y, z + 1, res); if(voxel_index == -1 || grid[voxel_index] == 0) { create_quad(corners, vertices_is, quads, QUAD_Z_MAX); } @@ -394,7 +378,8 @@ void VolumeMeshBuilder::convert_quads_to_tris(const vector , /*
[Bf-blender-cvs] [fd64e214cbc] soc-2018-cycles-volumes: Remove SparseTile; support CPU tricubic interp.
Commit: fd64e214cbceefd09c863e6ee0c3aac1db2428b0 Author: Geraldine Chua Date: Thu Jun 7 17:03:24 2018 +0800 Branches: soc-2018-cycles-volumes https://developer.blender.org/rBfd64e214cbceefd09c863e6ee0c3aac1db2428b0 Remove SparseTile; support CPU tricubic interp. Sparse grids now use their normal types instead of a specific struct. Also added support for tricubic interpolation of sparse grids for CPU rendering. === M intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h M intern/cycles/render/image.cpp M intern/cycles/render/mesh_volume.cpp M intern/cycles/util/util_sparse_grid.h === diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h index 3435bcab70a..93aa6117f58 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h @@ -75,6 +75,21 @@ template struct TextureInterpolator { return read(data[y * width + x]); } + static ccl_always_inline float4 read(const T *data, const int *offsets, +int x, int y, int z, +int tiw, int tih, int tid) + { + int index = compute_index(offsets, x, y, z, tiw, tih, tid); + return index < 0 ? make_float4(0.0f) : read(data[index]); + } + + static ccl_always_inline float4 read(const T *data, const int *offsets, +int idx, int width, int height, int depth) + { + int index = compute_index(offsets, idx, width, height, depth); + return index < 0 ? make_float4(0.0f) : read(data[index]); + } + static ccl_always_inline int wrap_periodic(int x, int width) { x %= width; @@ -281,18 +296,14 @@ template struct TextureInterpolator { return make_float4(0.0f); } + const T *data = (const T*)info.data; const int *ofs = (const int*)info.offsets; + if(ofs) { - const SparseTile *data = (const SparseTile*)info.data; - return read(get_value(data, ofs, ix, iy, iz, -compute_tile_resolution(width), - compute_tile_resolution(height), - compute_tile_resolution(depth))); - } - else { - const T *data = (const T*)info.data; - return read(data[compute_index(ix, iy, iz, width, height, depth)]); + return read(data, ofs, ix, iy, iz, get_tile_res(width), + get_tile_res(height), get_tile_res(depth)); } + return read(data[compute_index(ix, iy, iz, width, height, depth)]); } static ccl_always_inline float4 interp_3d_linear(const TextureInfo& info, @@ -340,29 +351,26 @@ template struct TextureInterpolator { } float4 r; + const T *data = (const T*)info.data; const int *ofs = (const int*)info.offsets; if(ofs) { - const SparseTile *data = (const SparseTile*)info.data; - int tiw = compute_tile_resolution(width); - int tih = compute_tile_resolution(height); - int tid = compute_tile_resolution(depth); + int tiw = get_tile_res(width), tih = get_tile_res(height), tid = get_tile_res(depth); /* Initial check if either voxel is in an active tile. */ if(!tile_is_active(ofs, ix, iy, iz, tiw, tih, tid) && !tile_is_active(ofs, nix, niy, niz, tiw, tih, tid)) { return make_float4(0.0f); } - r = (1.0f - tz)*(1.0f - ty)*(1.0f - tx) * read(get_value(data, ofs, ix, iy, iz, tiw, tih, tid)); - r += (1.0f - tz)*(1.0f - ty)*tx * read(get_value(data, ofs, nix, iy, iz, tiw, tih, tid)); - r += (1.0f - tz)*ty*(1.0f - tx) * read(get_value(data, ofs, ix, niy, iz, tiw, tih, tid)); - r += (1.0f - tz)*ty*tx * read(get_value(data, ofs, nix, niy, iz, tiw, tih, tid)); - r += tz*(1.0f - ty)*(1.0f - tx) * read(get_value(data, ofs, ix, iy, niz, tiw, tih, tid)); - r += tz*(1.0f - ty)*tx * read(get_value(data, ofs, nix, iy, niz, tiw, tih, tid)); -
[Bf-blender-cvs] [e1db45c41a9] soc-2018-cycles-volumes: Updates to tiling function.
Commit: e1db45c41a9acb9dadbb40183e1037d441a15035 Author: Geraldine Chua Date: Tue Jun 5 21:35:24 2018 +0800 Branches: soc-2018-cycles-volumes https://developer.blender.org/rBe1db45c41a9acb9dadbb40183e1037d441a15035 Updates to tiling function. 1. Supports all data types (or at least the ones enumerated in ImageDataType). 2. Will tile all volume attributes. 3. Changed method of activating tiling to a bool member of Image. === M intern/cycles/blender/blender_mesh.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h M intern/cycles/render/image.cpp M intern/cycles/render/image.h M intern/cycles/render/nodes.cpp M intern/cycles/util/CMakeLists.txt M intern/cycles/util/util_image_impl.h D intern/cycles/util/util_sparse_grid.cpp M intern/cycles/util/util_sparse_grid.h M intern/cycles/util/util_texture.h === diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 7d6ca18b074..8bf3f66dff6 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -342,6 +342,7 @@ static void create_mesh_volume_attribute(BL::Object& b_ob, ImageMetaData metadata; bool animated = false; bool use_alpha = true; + bool make_sparse = true; volume_data->manager = image_manager; volume_data->slot = image_manager->add_image( @@ -352,6 +353,7 @@ static void create_mesh_volume_attribute(BL::Object& b_ob, INTERPOLATION_LINEAR, EXTENSION_CLIP, use_alpha, + make_sparse, metadata); } diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 649d6edc679..00d23b9095e 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -1051,7 +1051,6 @@ void BlenderSession::builtin_image_info(const string _name, BL::SmokeDomainSettings b_domain = object_smoke_domain_find(b_ob); metadata.is_float = true; - metadata.is_volume = false; metadata.depth = 1; metadata.channels = 1; @@ -1061,19 +1060,14 @@ void BlenderSession::builtin_image_info(const string _name, if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_DENSITY) || builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_FLAME) || builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_HEAT) || - builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_TEMPERATURE)) { + builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_TEMPERATURE)) metadata.channels = 1; - } - else if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_COLOR)) { + else if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_COLOR)) metadata.channels = 4; - metadata.is_volume = true; - } - else if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY)) { + else if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY)) metadata.channels = 3; - } - else { + else return; - } int3 resolution = get_int3(b_domain.domain_resolution()); int amplify = (b_domain.use_high_resolution())? b_domain.amplify() + 1: 1; diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h index 3c18b08d5b8..3435bcab70a 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h @@ -21,8 +21,7 @@ CCL_NAMESPACE_BEGIN -template -struct TextureInterpolator { +template struct TextureInterpolator { #define SET_CUBIC_SPLINE_WEIGHTS(u, t) \ { \ u[0] = (((-1.0f/6.0f)* t + 0.5f) * t - 0.5f) * t + (1.0f/6.0f); \ @@ -282,10 +281,13 @@ struct TextureInterpolator { return make_float4(0.0f); } - if(is_tile) { - const SparseTile *data = (const SparseTile*)info.data; - const int *ofs = (const int*)info.offsets; - return read(get_value(data, ofs, ix, iy, iz, width, height, depth)); + const int *ofs = (const int*)info.offsets; + if(ofs) { + const SparseTile *data = (const SparseTile*)info.data; + return read(get_value(data, ofs, ix, iy, iz, +
[Bf-blender-cvs] [ae177e799c1] soc-2018-cycles-volumes: Created init functions for uchar4 and half4.
Commit: ae177e799c121f4135d2f32aa0c23cf36992afaf Author: Geraldine Chua Date: Tue Jun 5 21:32:24 2018 +0800 Branches: soc-2018-cycles-volumes https://developer.blender.org/rBae177e799c121f4135d2f32aa0c23cf36992afaf Created init functions for uchar4 and half4. === M intern/cycles/util/util_half.h M intern/cycles/util/util_types_uchar4.h M intern/cycles/util/util_types_uchar4_impl.h === diff --git a/intern/cycles/util/util_half.h b/intern/cycles/util/util_half.h index 612228dd1c1..b21c773a773 100644 --- a/intern/cycles/util/util_half.h +++ b/intern/cycles/util/util_half.h @@ -32,12 +32,12 @@ CCL_NAMESPACE_BEGIN #define float4_store_half(h, f, scale) vstore_half4(f * (scale), 0, h); -#else +#else /* __KERNEL_OPENCL__ */ /* CUDA has its own half data type, no need to define then */ #ifndef __KERNEL_CUDA__ typedef unsigned short half; -#endif +#endif /* __KERNEL_CUDA__ */ struct half4 { half x, y, z, w; }; @@ -51,7 +51,7 @@ ccl_device_inline void float4_store_half(half *h, float4 f, float scale) h[3] = __float2half(f.w * scale); } -#else +#else /* __KERNEL_CUDA__ */ ccl_device_inline void float4_store_half(half *h, float4 f, float scale) { @@ -71,23 +71,23 @@ ccl_device_inline void float4_store_half(half *h, float4 f, float scale) h[i] = (rshift & 0x7FFF); } -#else +#else /*__KERNEL_SSE2__ */ /* same as above with SSE */ ssef fscale = load4f(f) * scale; ssef x = min(max(fscale, 0.0f), 65504.0f); #ifdef __KERNEL_AVX2__ ssei rpack = _mm_cvtps_ph(x, 0); -#else +#else /* __KERNEL_AVX2__ */ ssei absolute = cast(x) & 0x7FFF; ssei Z = absolute + 0xC800; ssei result = andnot(absolute < 0x3880, Z); ssei rshift = (result >> 13) & 0x7FFF; ssei rpack = _mm_packs_epi32(rshift, rshift); -#endif +#endif /* __KERNEL_AVX2__ */ _mm_storel_pi((__m64*)h, _mm_castsi128_ps(rpack)); -#endif +#endif /*__KERNEL_SSE2__ */ } ccl_device_inline float half_to_float(half h) @@ -133,11 +133,22 @@ ccl_device_inline half float_to_half(float f) return (value_bits | sign_bit); } -#endif +ccl_device_inline half4 make_half4(half h) +{ + half4 a = {h, h, h, h}; + return a; +} -#endif +ccl_device_inline half4 make_half4(half x, half y, half z, half w) +{ + half4 a = {x, y, z, w}; + return a; +} + +#endif /* __KERNEL_CUDA__ */ + +#endif /* __KERNEL_OPENCL__ */ CCL_NAMESPACE_END #endif /* __UTIL_HALF_H__ */ - diff --git a/intern/cycles/util/util_types_uchar4.h b/intern/cycles/util/util_types_uchar4.h index 3802cebbfb9..d9d7cc6f35e 100644 --- a/intern/cycles/util/util_types_uchar4.h +++ b/intern/cycles/util/util_types_uchar4.h @@ -31,6 +31,7 @@ struct uchar4 { __forceinline uchar& operator[](int i); }; +ccl_device_inline uchar4 make_uchar4(uchar u); ccl_device_inline uchar4 make_uchar4(uchar x, uchar y, uchar z, uchar w); #endif /* __KERNEL_GPU__ */ diff --git a/intern/cycles/util/util_types_uchar4_impl.h b/intern/cycles/util/util_types_uchar4_impl.h index 03039f60c54..0594ca4fc43 100644 --- a/intern/cycles/util/util_types_uchar4_impl.h +++ b/intern/cycles/util/util_types_uchar4_impl.h @@ -38,6 +38,12 @@ uchar& uchar4::operator[](int i) return *( + i); } +ccl_device_inline uchar4 make_uchar4(uchar u) +{ + uchar4 a = {u, u, u, u}; + return a; +} + ccl_device_inline uchar4 make_uchar4(uchar x, uchar y, uchar z, uchar w) { uchar4 a = {x, y, z, w}; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [38232871791] blender2.8: Merge branch 'master' into blender2.8
Commit: 38232871791e88eb8294441c013171113cb61012 Author: Campbell Barton Date: Thu Jun 7 17:08:55 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB38232871791e88eb8294441c013171113cb61012 Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d274c64d22d] master: WM: add support for drag events
Commit: d274c64d22da51473839d87618ba0dc0a0f1fa42 Author: Campbell Barton Date: Thu Jun 7 17:05:49 2018 +0200 Branches: master https://developer.blender.org/rBd274c64d22da51473839d87618ba0dc0a0f1fa42 WM: add support for drag events This allows for a single key to be mapped to both release and drag, useful for pie menus to share a key with a different action. === M source/blender/editors/interface/interface_region_menu_pie.c M source/blender/makesrna/intern/rna_wm.c M source/blender/windowmanager/WM_types.h M source/blender/windowmanager/intern/wm_event_system.c === diff --git a/source/blender/editors/interface/interface_region_menu_pie.c b/source/blender/editors/interface/interface_region_menu_pie.c index 37a603d967f..41001d65d82 100644 --- a/source/blender/editors/interface/interface_region_menu_pie.c +++ b/source/blender/editors/interface/interface_region_menu_pie.c @@ -150,8 +150,16 @@ uiPieMenu *UI_pie_menu_begin(struct bContext *C, const char *title, int icon, co } pie->layout = UI_block_layout(pie->block_radial, UI_LAYOUT_VERTICAL, UI_LAYOUT_PIEMENU, 0, 0, 200, 0, 0, style); - pie->mx = event->x; - pie->my = event->y; + + /* Open from where we started dragging. */ + if (event->val == KM_CLICK_DRAG) { + pie->mx = event->prevclickx; + pie->my = event->prevclicky; + } + else { + pie->mx = event->x; + pie->my = event->y; + } /* create title button */ if (title[0]) { diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index b71eca3d850..71e3a0493a3 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -51,6 +51,7 @@ static const EnumPropertyItem event_keymouse_value_items[] = { {KM_RELEASE, "RELEASE", 0, "Release", ""}, {KM_CLICK, "CLICK", 0, "Click", ""}, {KM_DBL_CLICK, "DOUBLE_CLICK", 0, "Double Click", ""}, + {KM_CLICK_DRAG, "CLICK_DRAG", 0, "Click Drag", ""}, {0, NULL, 0, NULL, NULL} }; @@ -389,6 +390,7 @@ const EnumPropertyItem rna_enum_event_value_items[] = { {KM_RELEASE, "RELEASE", 0, "Release", ""}, {KM_CLICK, "CLICK", 0, "Click", ""}, {KM_DBL_CLICK, "DOUBLE_CLICK", 0, "Double Click", ""}, + {KM_CLICK_DRAG, "CLICK_DRAG", 0, "Click Drag", ""}, {EVT_GESTURE_N, "NORTH", 0, "North", ""}, {EVT_GESTURE_NE, "NORTH_EAST", 0, "North-East", ""}, {EVT_GESTURE_E, "EAST", 0, "East", ""}, diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 298c5184ced..8c53f5389e3 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -188,6 +188,7 @@ enum { #define KM_RELEASE 2 #define KM_CLICK 3 #define KM_DBL_CLICK 4 +#define KM_CLICK_DRAG 5 /* ** UI Handler * */ @@ -462,6 +463,7 @@ typedef struct wmEvent { /* set in case a KM_PRESS went by unhandled */ char check_click; + char check_drag; char is_motion_absolute; /* keymap item, set by handler (weak?) */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 83bad28ce02..f820a0a1b8d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2221,8 +2221,30 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) if (CTX_wm_window(C) == NULL) return action; - if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE, EVENT_NONE) && !ISTIMER(event->type)) { + if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) { + if (event->check_drag) { + wmWindow *win = CTX_wm_window(C); + if ((abs(event->x - win->eventstate->prevclickx)) >= U.tweak_threshold || + (abs(event->y - win->eventstate->prevclicky)) >= U.tweak_threshold) + { + short val = event->val; + short type = event->type; + event->val = KM_CLICK_DRAG; + event->type = win->eventstate->type; + + CLOG_INFO(WM_LOG_HANDLERS, 1, "handling PRESS_DRAG"); + + action |= wm_handlers_do_intern(C, event, handlers); + event->val = val; + event->type = type; + + win->eventstate->check_click = 0; + win->eventstate->check_drag = 0; + } + }
[Bf-blender-cvs] [8dc33a81b09] blender2.8: Merge branch 'master' into blender2.8
Commit: 8dc33a81b09a403e57f7830d993d4484f6d85c40 Author: Campbell Barton Date: Thu Jun 7 16:53:31 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB8dc33a81b09a403e57f7830d993d4484f6d85c40 Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [df4525d1d9d] master: Fix key repeat events resetting the click timer
Commit: df4525d1d9d5250b8d0bdc6370f2736c2607b044 Author: Campbell Barton Date: Thu Jun 7 16:51:03 2018 +0200 Branches: master https://developer.blender.org/rBdf4525d1d9d5250b8d0bdc6370f2736c2607b044 Fix key repeat events resetting the click timer === M source/blender/windowmanager/intern/wm_event_system.c === diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 7c81f836bc1..83bad28ce02 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -3523,9 +3523,12 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U /* double click test - only for press */ if (event.val == KM_PRESS) { - evt->prevclicktime = PIL_check_seconds_timer(); - evt->prevclickx = event.x; - evt->prevclicky = event.y; + /* Don't reset timer & location when holding the key generates repeat events. */ + if ((evt->prevtype != event.type) || (evt->prevval != KM_PRESS)) { + evt->prevclicktime = PIL_check_seconds_timer(); + evt->prevclickx = event.x; + evt->prevclicky = event.y; + } } wm_event_add(win, ); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [816d9beec2a] greasepencil-object: UI: More changes in Viewport Display Panel
Commit: 816d9beec2a046051cbfafbc5fd0143bbd55fee0 Author: Antonio Vazquez Date: Thu Jun 7 16:47:03 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB816d9beec2a046051cbfafbc5fd0143bbd55fee0 UI: More changes in Viewport Display Panel === M release/scripts/startup/bl_ui/properties_data_gpencil.py === diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index 01ec61eeb38..f073cc64f97 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -243,6 +243,7 @@ class DATA_PT_gpencil_display(DataButtonsPanel, Panel): layout.prop(gpd, "xray_mode", text="Depth Ordering") layout.prop(gpd, "show_edit_lines", text="Show Edit Lines") +layout.prop(gpd, "show_multiedit_line_only", text="Display Only Edit Line In Multiframe") layout.prop(gpd, "edit_line_color", text="Edit Line Color") layout.prop(ob, "empty_draw_size", text="Marker Size") @@ -252,12 +253,9 @@ class DATA_PT_gpencil_display(DataButtonsPanel, Panel): sub.active = not gpd.show_constant_thickness sub.prop(gpd, "pixfactor", text="Thickness Scale") -col = layout.column() -col.prop(gpd, "show_multiedit_line_only", text="Show Only Lines in Multiedit") if gpl: -col = layout.column(align=True) -col.prop(gpd, "show_stroke_direction", text="Show Stroke Directions") +layout.prop(gpd, "show_stroke_direction", text="Show Stroke Directions") ### ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f0815b1322d] blender2.8: Merge branch 'master' into blender2.8
Commit: f0815b1322dc4f04dd949fd92049a99479e5f61d Author: Campbell Barton Date: Thu Jun 7 16:45:10 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBf0815b1322dc4f04dd949fd92049a99479e5f61d Merge branch 'master' into blender2.8 === === diff --cc source/blender/windowmanager/WM_api.h index 21e050e8e14,75b2cfffd03..267aa448dc3 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@@ -142,7 -104,10 +142,7 @@@ enum struct wmWindow *WM_window_open(struct bContext *C, const struct rcti *rect); struct wmWindow *WM_window_open_temp(struct bContext *C, int x, int y, int sizex, int sizey, int type); void WM_window_set_dpi(wmWindow *win); - + - /* returns true if draw method is triple buffer */ -bool WM_is_draw_triple(struct wmWindow *win); - bool WM_stereo3d_enabled(struct wmWindow *win, bool only_fullscreen_test); diff --cc source/blender/windowmanager/WM_types.h index 81018348ca0,298c5184ced..856694276a9 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@@ -211,14 -199,15 +211,14 @@@ typedef enum eOperatorPropTags typedef struct wmNotifier { struct wmNotifier *next, *prev; - + struct wmWindowManager *wm; struct wmWindow *window; - + - int swinid; /* can't rely on this, notifiers can be added without context, swinid of 0 */ unsigned int category, data, subtype, action; - + void *reference; - + } wmNotifier; diff --cc source/blender/windowmanager/intern/wm.c index 9100e47d820,98d9edb9f94..6a42bf26a97 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@@ -372,10 -359,10 +372,10 @@@ void WM_keymap_init(bContext *C wm->addonconf = WM_keyconfig_new(wm, "Blender Addon"); if (!wm->userconf) wm->userconf = WM_keyconfig_new(wm, "Blender User"); - + /* initialize only after python init is done, for keymaps that * use python operators */ - if (CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) { + if (CTX_py_init_get(C) && (wm->initialized & WM_KEYMAP_IS_INITIALIZED) == 0) { /* create default key config, only initialize once, * it's persistent across sessions */ if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) { @@@ -487,10 -467,11 +487,10 @@@ void wm_close_and_free(bContext *C, wmW wm_autosave_timer_ended(wm); while ((win = BLI_pophead(>windows))) { - win->screen = NULL; /* prevent draw clear to use screen */ - wm_draw_window_clear(win); + WM_window_set_active_workspace(win, NULL); /* prevent draw clear to use screen */ wm_window_free(C, wm, win); } - + while ((op = BLI_pophead(>operators))) { WM_operator_free(op); } diff --cc source/blender/windowmanager/intern/wm_cursors.c index 67b04662154,6aef38a320b..f13dac9cb4c --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@@ -41,8 -41,7 +41,8 @@@ #include "BLI_sys_types.h" #include "DNA_listBase.h" - #include "DNA_userdef_types.h" + #include "DNA_userdef_types.h" +#include "DNA_workspace_types.h" #include "BKE_context.h" #include "BKE_global.h" diff --cc source/blender/windowmanager/intern/wm_dragdrop.c index 319ce99f700,7a5e3e90166..16ed51cbd80 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@@ -365,10 -361,10 +365,10 @@@ void wm_drags_draw(bContext *C, wmWindo drag_rect_minmax(rect, x, y, x + w, y + iconsize); } else { - glColor4ub(255, 255, 255, 255); - UI_fontstyle_draw_simple(fstyle, x, y, wm_drag_name(drag)); + const unsigned char col[] = {255, 255, 255, 255}; + UI_fontstyle_draw_simple(fstyle, x, y, wm_drag_name(drag), col); } - + /* operator name with roundbox */ if (drag->opname[0]) { if (drag->imb) { diff --cc source/blender/windowmanager/intern/wm_draw.c index 3ce64926a95,b9f44a00df7..df958f35e91 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@@ -801,12 -967,16 +801,12 @@@ void wm_draw_update(bContext *C continue; } #endif - if (win->drawmethod != U.wmdrawmethod) { - wm_draw_window_clear(win); -
[Bf-blender-cvs] [863e395ad8b] master: Cleanup: trailing space for windowmanager
Commit: 863e395ad8bc0c921a9c836018e2c17262340f46 Author: Campbell Barton Date: Thu Jun 7 16:43:52 2018 +0200 Branches: master https://developer.blender.org/rB863e395ad8bc0c921a9c836018e2c17262340f46 Cleanup: trailing space for windowmanager === M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/WM_keymap.h M source/blender/windowmanager/WM_types.h M source/blender/windowmanager/intern/wm.c M source/blender/windowmanager/intern/wm_cursors.c M source/blender/windowmanager/intern/wm_dragdrop.c M source/blender/windowmanager/intern/wm_draw.c M source/blender/windowmanager/intern/wm_event_system.c M source/blender/windowmanager/intern/wm_files.c M source/blender/windowmanager/intern/wm_files_link.c M source/blender/windowmanager/intern/wm_gesture.c M source/blender/windowmanager/intern/wm_init_exit.c M source/blender/windowmanager/intern/wm_jobs.c M source/blender/windowmanager/intern/wm_keymap.c M source/blender/windowmanager/intern/wm_operators.c M source/blender/windowmanager/intern/wm_playanim.c M source/blender/windowmanager/intern/wm_subwindow.c M source/blender/windowmanager/intern/wm_window.c M source/blender/windowmanager/wm.h M source/blender/windowmanager/wm_cursors.h M source/blender/windowmanager/wm_event_types.h === diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 7ebd7bb3204..75b2cfffd03 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -104,7 +104,7 @@ enum { struct wmWindow*WM_window_open(struct bContext *C, const struct rcti *rect); struct wmWindow *WM_window_open_temp(struct bContext *C, int x, int y, int sizex, int sizey, int type); void WM_window_set_dpi(wmWindow *win); - + /* returns true if draw method is triple buffer */ bool WM_is_draw_triple(struct wmWindow *win); diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h index ef431049bb1..c95284143b4 100644 --- a/source/blender/windowmanager/WM_keymap.h +++ b/source/blender/windowmanager/WM_keymap.h @@ -58,9 +58,9 @@ voidWM_keyconfig_update_operatortype(void); void WM_keymap_init (struct bContext *C); void WM_keymap_free (struct wmKeyMap *keymap); -wmKeyMapItem *WM_keymap_verify_item(struct wmKeyMap *keymap, const char *idname, int type, +wmKeyMapItem *WM_keymap_verify_item(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); -wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, int type, +wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); @@ -77,7 +77,7 @@ wmKeyMap *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap); wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, const char *opname); boolWM_keymap_remove(struct wmKeyConfig *keyconfig, struct wmKeyMap *keymap); bool WM_keymap_poll(struct bContext *C, struct wmKeyMap *keymap); - + wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id); intWM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index b7ad7b622e2..298c5184ced 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -199,15 +199,15 @@ enum { typedef struct wmNotifier { struct wmNotifier *next, *prev; - + struct wmWindowManager *wm; struct wmWindow *window; - + int swinid; /* can't rely on this, notifiers can be added without context, swinid of 0 */ unsigned int category, data, subtype, action; - + void *reference; - + } wmNotifier; @@ -322,7 +322,7 @@ typedef struct wmNotifier { /* NC_TEXT Text */ #define ND_CURSOR (50<<16) #define ND_DISPLAY (51<<16) - + /* NC_ANIMATION Animato */ #define ND_KEYFRAME(70<<16) #define ND_KEYFRAME_PROP (71<<16) @@ -420,7 +420,7 @@ typedef struct wmGesture { uint is_active : 1; /* Use for gestures that support both immediate or delayed activation. */ uint wait_for_input : 1; -
[Bf-blender-cvs] [68a9bb0268a] greasepencil-object: UI: Replace label to "Stroke Thickness"
Commit: 68a9bb0268a2cd77ca1b4f4e7a310d3d44b2a132 Author: Antonio Vazquez Date: Thu Jun 7 16:43:49 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB68a9bb0268a2cd77ca1b4f4e7a310d3d44b2a132 UI: Replace label to "Stroke Thickness" === M release/scripts/startup/bl_ui/properties_data_gpencil.py === diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index f8326ae531c..01ec61eeb38 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -99,7 +99,7 @@ class DATA_PT_gpencil_layer_optionpanel(LayerDataButtonsPanel, Panel): # Offsets - Thickness col = layout.row(align=True) -col.prop(gpl, "line_change", text="Thickness") +col.prop(gpl, "line_change", text="Stroke Thickness") layout.prop(gpl, "use_stroke_location", text="Draw On Stroke Location") ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [aafeefe9270] greasepencil-object: UI: Rename label "Use in Render" to "View In Render"
Commit: aafeefe9270b128413c85c6ab49a89e1614b1d38 Author: Antonio Vazquez Date: Thu Jun 7 16:42:13 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBaafeefe9270b128413c85c6ab49a89e1614b1d38 UI: Rename label "Use in Render" to "View In Render" === M release/scripts/startup/bl_ui/properties_grease_pencil_common.py === 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 7fc91c46053..3e313b5ffad 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -965,7 +965,7 @@ class GreasePencilOnionPanel: row.prop(gp, "ghost_after_range", text="Frames After") layout.prop(gp, "use_ghost_custom_colors", text="Use Custom Color") -layout.prop(gp, "use_ghosts_always", text="Use In Render") +layout.prop(gp, "use_ghosts_always", text="View In Render") # - fade and loop row = layout.row() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fcc5d7c29e0] blender2.8: Draw: Fix crash when tryign to get procedural textures with modifier disabled
Commit: fcc5d7c29e02eae1429009cc02eb9c75d159f245 Author: Sergey Sharybin Date: Thu Jun 7 16:38:52 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBfcc5d7c29e02eae1429009cc02eb9c75d159f245 Draw: Fix crash when tryign to get procedural textures with modifier disabled Maybe disabled modifier check should be done higher in the call hierarchy. === M source/blender/draw/intern/draw_cache_impl_particles.c === diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 1348968bad7..46469136243 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -779,7 +779,7 @@ static void particle_batch_cache_ensure_procedural_strand_data( ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md; - if (psmd != NULL) { + if (psmd != NULL && psmd->mesh_final != NULL) { if (CustomData_has_layer(>mesh_final->ldata, CD_MLOOPUV)) { cache->num_uv_layers = CustomData_number_of_layers(>mesh_final->ldata, CD_MLOOPUV); active_uv = CustomData_get_active_layer(>mesh_final->ldata, CD_MLOOPUV); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bd2c4ba6982] greasepencil-object: Disable Onion Skinning for old Drawing methods
Commit: bd2c4ba6982439b3bed3be858f8b014e265f2858 Author: Antonio Vazquez Date: Thu Jun 7 16:25:35 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBbd2c4ba6982439b3bed3be858f8b014e265f2858 Disable Onion Skinning for old Drawing methods This code will be used for annotations and is not requiered. === M source/blender/editors/gpencil/drawgpencil.c === diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 075451de30b..b8fbdc45018 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -1354,6 +1354,7 @@ static void gp_draw_strokes_edit( /* - General Drawing -- */ +#if 0 /* GPXX: This must be disabled for annotations */ /* draw onion-skinning for a layer */ static void gp_draw_onionskins(tGPDdraw *tgpw) { @@ -1451,7 +1452,7 @@ static void gp_draw_onionskins(tGPDdraw *tgpw) /* don't draw - disabled */ } } - +#endif /* draw interpolate strokes (used only while operator is running) */ void ED_gp_draw_interpolation(const bContext *C, tGPDinterpolate *tgpi, const int type) { @@ -1640,6 +1641,7 @@ static void gp_draw_data_layers(RegionView3D *rv3d, * - The per-layer "always show" flag however overrides the playback/render restriction, * allowing artists to selectively turn onionskins on/off during playback */ +#if 0 /* GPXX: This must be disabled for annotations */ if ((gpl->onion_flag & GP_LAYER_ONIONSKIN) && ((dflag & GP_DRAWDATA_NO_ONIONS) == 0 || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS))) { @@ -1648,7 +1650,7 @@ static void gp_draw_data_layers(RegionView3D *rv3d, */ gp_draw_onionskins(); } - +#endif /* draw the strokes already in active frame */ gp_draw_strokes(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [61b69af84fe] greasepencil-object: Remove unused Layer Onion Skinning fields
Commit: 61b69af84febd126f4219a7f18c5116b3c3b741d Author: Antonio Vazquez Date: Thu Jun 7 16:39:59 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB61b69af84febd126f4219a7f18c5116b3c3b741d Remove unused Layer Onion Skinning fields These fileds are not used because the Layer override was removed in a previous commit. === M source/blender/blenkernel/intern/gpencil.c M source/blender/makesdna/DNA_gpencil_types.h M source/blender/makesrna/intern/rna_gpencil.c === diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 5c63eb1e6d1..a390e64531b 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -418,14 +418,6 @@ bGPDlayer *BKE_gpencil_layer_addnew(bGPdata *gpd, const char *name, bool setacti /* onion-skinning settings */ gpl->onion_flag |= GP_LAYER_ONIONSKIN; - gpl->onion_flag |= (GP_LAYER_GHOST_PREVCOL | GP_LAYER_GHOST_NEXTCOL); - gpl->onion_flag |= GP_LAYER_ONION_FADE; - gpl->onion_factor = 0.5f; - gpl->gstep = 1; - gpl->gstep_next = 1; - - ARRAY_SET_ITEMS(gpl->gcolor_prev, 0.145098f, 0.419608f, 0.137255f); /* green */ - ARRAY_SET_ITEMS(gpl->gcolor_next, 0.125490f, 0.082353f, 0.529412f); /* blue */ /* auto-name */ BLI_strncpy(gpl->info, name, sizeof(gpl->info)); diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 5999b112579..2372d4f2e70 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -244,28 +244,21 @@ typedef struct bGPDlayer { short flag; /* settings for layer */ short thickness;/* current thickness to apply to strokes */ - short gstep;/* Ghosts Before: max number of ghost frames to show between active frame and the one before it (0 = only the ghost itself) */ - short gstep_next; /* Ghosts After: max number of ghost frames to show after active frame and the following it(0 = only the ghost itself) */ - - float gcolor_prev[3]; /* optional color for ghosts before the active frame */ - float gcolor_next[3]; /* optional color for ghosts after the active frame */ - float color[4]; /* Color for strokes in layers (replaced by palettecolor). Only used for ruler (which uses GPencil internally) */ float fill[4]; /* Fill color for strokes in layers. Not used and replaced by palettecolor fill */ char info[128]; /* optional reference info about this layer (i.e. "director's comments, 12/3") * this is used for the name of the layer too and kept unique. */ + char pad_1[4]; struct Object *parent; /* parent object */ float inverse[4][4];/* inverse matrix (only used if parented) */ char parsubstr[64]; /* String describing subobject info, MAX_ID_NAME-2 */ short partype; - short onion_mode; /* onion skinning mode (eGP_OnionModes) */ + short onion_flag;/* Per-layer onion-skinning flags (eGPDlayer_OnionFlag) */ float tintcolor[4]; /* Color used to tint layer, alpha value is used as factor */ float opacity; /* Opacity of the layer */ - int onion_flag; /* Per-layer onion-skinning flags, to overide datablock settings (eGPDlayer_OnionFlag) */ - float onion_factor; /* onion alpha factor change */ bGPDlayer_runtime runtime; } bGPDlayer; @@ -298,14 +291,6 @@ typedef enum eGPDlayer_Flag { typedef enum eGPDlayer_OnionFlag { /* do onion skinning */ GP_LAYER_ONIONSKIN = (1 << 0), - /* use custom color for ghosts before current frame */ - GP_LAYER_GHOST_PREVCOL = (1 << 1), - /* use custom color for ghosts after current frame */ - GP_LAYER_GHOST_NEXTCOL = (1 << 2), - /* always show onion skins (i.e. even during renders/animation playback) */ - GP_LAYER_GHOST_ALWAYS = (1 << 3), - /* use fade color in onion skin */ - GP_LAYER_ONION_FADE = (1 << 4), } eGPDlayer_OnionFlag; /* * */ diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 7c4cc9c2bc8..41dba57cc0e 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -1057,51 +1057,6 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame"); RNA_def_property_update(prop,
[Bf-blender-cvs] [dbc0ea9aff3] greasepencil-object: Disable debug lines to avoid compiler error
Commit: dbc0ea9aff355969b5947e5bbb33d28d788a12e1 Author: Antonio Vazquez Date: Thu Jun 7 16:20:51 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBdbc0ea9aff355969b5947e5bbb33d28d788a12e1 Disable debug lines to avoid compiler error === M source/blender/editors/animation/anim_deps.c === diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index ca30fbced8d..898c8b6464a 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -436,11 +436,12 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data) } } else if (ale->update) { +#if 0 if (G.debug & G_DEBUG) { printf("%s: Unhandled animchannel updates (%d) for type=%d (%p)\n", __func__, ale->update, ale->type, ale->data); } - +#endif /* Prevent crashes in cases where it can't be handled */ ale->update = 0; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [64e0ab6a00c] blender2.8: Merge branch 'master' into blender2.8
Commit: 64e0ab6a00c46faa424f689fd029fa42d418e287 Author: Campbell Barton Date: Thu Jun 7 16:32:40 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB64e0ab6a00c46faa424f689fd029fa42d418e287 Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [86aaa3efba7] blender2.8: Fix T55126: COW problem: there is an active object even if unselectable
Commit: 86aaa3efba7c129378649394da8a5134076eddfe Author: Sergey Sharybin Date: Thu Jun 7 16:30:19 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB86aaa3efba7c129378649394da8a5134076eddfe Fix T55126: COW problem: there is an active object even if unselectable === M source/blender/blenkernel/intern/layer.c M source/blender/blenkernel/intern/object_update.c === diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 16e349465f6..c7bb24cdcee 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -1264,6 +1264,16 @@ void BKE_layer_eval_view_layer( /* Store base in the array. */ view_layer->object_bases_array[base_index++] = base; } + if (view_layer == DEG_get_evaluated_view_layer(depsgraph)) { + ViewLayer *view_layer_orig = DEG_get_input_view_layer(depsgraph); + Base *base_orig = view_layer_orig->object_bases.first; + const Base *base_eval = view_layer->object_bases.first; + while (base_orig != NULL) { + base_orig->flag = base_eval->flag; + base_orig = base_orig->next; + base_eval = base_eval->next; + } + } } void BKE_layer_eval_view_layer_indexed( diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 852d8197a6c..3b684ebfd94 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -145,6 +145,7 @@ void BKE_object_eval_done(Depsgraph *depsgraph, Object *ob) Object *ob_orig = DEG_get_original_object(ob); copy_m4_m4(ob_orig->obmat, ob->obmat); ob_orig->transflag = ob->transflag; + ob_orig->flag = ob->flag; } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e19686a35a7] master: WM: check for release instead of not pressed
Commit: e19686a35a7e12204117f871a04e6f6b5a71cc2b Author: Campbell Barton Date: Thu Jun 7 16:19:59 2018 +0200 Branches: master https://developer.blender.org/rBe19686a35a7e12204117f871a04e6f6b5a71cc2b WM: check for release instead of not pressed Makes reasoning about events more predictable. === M source/blender/editors/interface/interface_handlers.c === diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 590b34dfc21..3abaa1d88eb 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1364,7 +1364,7 @@ static int ui_handler_region_drag_toggle(bContext *C, const wmEvent *event, void switch (event->type) { case LEFTMOUSE: { - if (event->val != KM_PRESS) { + if (event->val == KM_RELEASE) { done = true; } break; @@ -3776,7 +3776,7 @@ static int ui_do_but_BUT( } } else if (data->state == BUTTON_STATE_WAIT_RELEASE) { - if (event->type == LEFTMOUSE && event->val != KM_PRESS) { + if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { if (!(but->flag & UI_SELECT)) data->cancel = true; button_activate_state(C, but, BUTTON_STATE_EXIT); @@ -4400,7 +4400,7 @@ static int ui_do_but_NUM( button_activate_state(C, but, BUTTON_STATE_EXIT); } } - else if (event->type == LEFTMOUSE && event->val != KM_PRESS) { + else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { if (data->dragchange) { #ifdef USE_DRAG_MULTINUM /* if we started multibutton but didnt drag, then edit */ @@ -4711,7 +4711,7 @@ static int ui_do_but_SLI( button_activate_state(C, but, BUTTON_STATE_EXIT); } } - else if (event->type == LEFTMOUSE && event->val != KM_PRESS) { + else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { if (data->dragchange) { #ifdef USE_DRAG_MULTINUM /* if we started multibutton but didnt drag, then edit */ @@ -4864,7 +4864,7 @@ static int ui_do_but_SCROLL( button_activate_state(C, but, BUTTON_STATE_EXIT); } } - else if (event->type == LEFTMOUSE && event->val != KM_PRESS) { + else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { button_activate_state(C, but, BUTTON_STATE_EXIT); } else if (event->type == MOUSEMOVE) { @@ -4916,7 +4916,7 @@ static int ui_do_but_GRIP( button_activate_state(C, but, BUTTON_STATE_EXIT); } } - else if (event->type == LEFTMOUSE && event->val != KM_PRESS) { + else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { button_activate_state(C, but, BUTTON_STATE_EXIT); } else if (event->type == MOUSEMOVE) { @@ -5301,7 +5301,7 @@ static int ui_do_but_UNITVEC( ui_numedit_apply(C, block, but, data); } } - else if (event->type == LEFTMOUSE && event->val != KM_PRESS) { + else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { button_activate_state(C, but, BUTTON_STATE_EXIT); } @@ -5635,7 +5635,7 @@ static int ui_do_but_HSVCUBE( ui_numedit_apply(C, block, but, data); } } - else if (event->type == LEFTMOUSE && event->val != KM_PRESS) { + else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { button_activate_state(C, but, BUTTON_STATE_EXIT); } @@ -5913,7 +5913,7 @@ static int ui_do_but_HSVCIRCLE( } } } - else if (event->type == LEFTMOUSE && event->val != KM_PRESS) { + else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { button_activate_state(C, but, BUTTON_STATE_EXIT); } return WM_UI_HANDLER_BREAK; @@ -6003,7 +6003,7 @@ static int ui_do_but_COLORBAND(
[Bf-blender-cvs] [819ad49d293] blender2.8: Cleanup: typo.
Commit: 819ad49d29368371118b9708baff391f39bde715 Author: Bastien Montagne Date: Thu Jun 7 16:02:55 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB819ad49d29368371118b9708baff391f39bde715 Cleanup: typo. === M source/blender/makesdna/DNA_object_types.h === diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 152b4b346e9..f37bccbfe4e 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -147,7 +147,7 @@ typedef struct ObjectDisplay { typedef struct Object_Runtime { /* Original mesh pointer, before object->data was changed to point * to mesh_eval. -* Is assigned by dependency craph's copy-on-write evaluation. +* Is assigned by dependency graph's copy-on-write evaluation. */ struct Mesh *mesh_orig; /* Mesh structure created during object evaluation. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1e4722eeabc] blender2.8: Merge branch 'master' into blender2.8
Commit: 1e4722eeabcc9c53616ab42b45e8a93206d46b73 Author: Bastien Montagne Date: Thu Jun 7 15:41:57 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB1e4722eeabcc9c53616ab42b45e8a93206d46b73 Merge branch 'master' into blender2.8 Conflicts: source/blender/editors/transform/transform_generics.c === === diff --cc source/blender/editors/transform/transform_generics.c index fac0661004f,fec98c77c19..d3fcd5e5911 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@@ -359,9 -348,9 +359,10 @@@ static void recalcData_actedit(TransInf /* initialize relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ + ac.bmain = CTX_data_main(t->context); ac.scene = t->scene; - ac.obact = OBACT; + ac.view_layer = t->view_layer; + ac.obact = OBACT(view_layer); ac.sa = t->sa; ac.ar = t->ar; ac.sl = (t->sa) ? t->sa->spacedata.first : NULL; @@@ -409,9 -398,9 +410,10 @@@ static void recalcData_graphedit(TransI /* initialize relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ + ac.bmain = CTX_data_main(t->context); - scene = ac.scene = t->scene; - ac.obact = OBACT; + ac.scene = t->scene; + ac.view_layer = t->view_layer; + ac.obact = OBACT(view_layer); ac.sa = t->sa; ac.ar = t->ar; ac.sl = (t->sa) ? t->sa->spacedata.first : NULL; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8a2db3ed21c] master: Fix crash due to missing init of new bAnimContext bmain member in transform code.
Commit: 8a2db3ed21c0eff7ee293c6a24c614283a8ed73f Author: Bastien Montagne Date: Thu Jun 7 15:38:31 2018 +0200 Branches: master https://developer.blender.org/rB8a2db3ed21c0eff7ee293c6a24c614283a8ed73f Fix crash due to missing init of new bAnimContext bmain member in transform code. >From own previous G.main-busting commit. === M source/blender/editors/transform/transform_generics.c === diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index ca41a319b1d..fec98c77c19 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -348,6 +348,7 @@ static void recalcData_actedit(TransInfo *t) /* initialize relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ + ac.bmain = CTX_data_main(t->context); ac.scene = t->scene; ac.obact = OBACT; ac.sa = t->sa; @@ -397,6 +398,7 @@ static void recalcData_graphedit(TransInfo *t) /* initialize relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ + ac.bmain = CTX_data_main(t->context); scene = ac.scene = t->scene; ac.obact = OBACT; ac.sa = t->sa; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d9d3e7778c9] blender2.8: Fix sculpt mode undo (COW update needed)
Commit: d9d3e7778c9d0cb495620e1f5b483038f0193d09 Author: Campbell Barton Date: Thu Jun 7 15:15:54 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBd9d3e7778c9d0cb495620e1f5b483038f0193d09 Fix sculpt mode undo (COW update needed) === M source/blender/editors/sculpt_paint/sculpt_undo.c === diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 75bfa4fe344..bc51606f3e5 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -493,6 +493,8 @@ static void sculpt_undo_restore_list(bContext *C, ListBase *lb) } } + DEG_id_tag_update(>id, DEG_TAG_COPY_ON_WRITE); + BKE_sculpt_update_mesh_elements(depsgraph, scene, sd, ob, 0, need_mask); /* call _after_ sculpt_update_mesh_elements() which may update 'ob->derivedFinal' */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [42990349c6b] soc-2018-npr: Fixed include file error (caused by merge?)
Commit: 42990349c6b6f33af3cb85ab08645ae52f91c94b Author: Nick Wu Date: Thu Jun 7 21:11:05 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rB42990349c6b6f33af3cb85ab08645ae52f91c94b Fixed include file error (caused by merge?) === M source/blender/draw/intern/draw_manager.c === diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 969bae8f248..10959d90c33 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -78,7 +78,7 @@ #include "draw_mode_engines.h" #include "engines/clay/clay_engine.h" #include "engines/eevee/eevee_engine.h" -#include "engines/lanpr/NUL_TNS.h" +#include "engines/lanpr/lanpr_all.h" #include "engines/basic/basic_engine.h" #include "engines/workbench/workbench_engine.h" #include "engines/external/external_engine.h" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a3f520170c9] blender2.8: Merge branch 'master' into blender2.8
Commit: a3f520170c9b43b195da085d20ca09866d8b2554 Author: Campbell Barton Date: Thu Jun 7 14:58:57 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBa3f520170c9b43b195da085d20ca09866d8b2554 Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [62429406391] master: Fix double free in dyntopo-sculpt mode undo
Commit: 624294063910ad3c6459702a7e6aac592db3a720 Author: Campbell Barton Date: Thu Jun 7 14:54:09 2018 +0200 Branches: master https://developer.blender.org/rB624294063910ad3c6459702a7e6aac592db3a720 Fix double free in dyntopo-sculpt mode undo === M source/blender/bmesh/intern/bmesh_log.c === diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c index 4e6fff03411..30ab0dd9459 100644 --- a/source/blender/bmesh/intern/bmesh_log.c +++ b/source/blender/bmesh/intern/bmesh_log.c @@ -654,17 +654,21 @@ void BM_log_mesh_elems_reorder(BMesh *bm, BMLog *log) */ BMLogEntry *BM_log_entry_add(BMLog *log) { - BMLogEntry *entry, *next; - + /* WARNING: this is now handled by the UndoSystem: BKE_UNDOSYS_TYPE_SCULPT +* freeing here causes unnecesssary complications. */ + BMLogEntry *entry; +#if 0 /* Delete any entries after the current one */ entry = log->current_entry; if (entry) { + BMLogEntry *next; for (entry = entry->next; entry; entry = next) { next = entry->next; bm_log_entry_free(entry); BLI_freelinkN(>entries, entry); } } +#endif /* Create and append the new entry */ entry = bm_log_entry_create(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a16d835f7ba] blender2.8: Wireframe: Frustum cull them.
Commit: a16d835f7ba05ce53ba798c7db0c01abb2f12032 Author: Clément Foucault Date: Thu Jun 7 14:49:54 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBa16d835f7ba05ce53ba798c7db0c01abb2f12032 Wireframe: Frustum cull them. === M source/blender/draw/intern/DRW_render.h M source/blender/draw/intern/draw_manager_data.c M source/blender/draw/modes/overlay_mode.c === diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 9f1bfa6ee33..b74e6ba9204 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -349,6 +349,7 @@ void DRW_shgroup_call_range_add( void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, unsigned int point_count, float (*obmat)[4]); void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, unsigned int line_count, float (*obmat)[4]); void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup, unsigned int tria_count, float (*obmat)[4]); +void DRW_shgroup_call_object_procedural_triangles_culled_add(DRWShadingGroup *shgroup, uint tria_count, struct Object *ob); void DRW_shgroup_call_object_add_ex(DRWShadingGroup *shgroup, struct Gwn_Batch *geom, struct Object *ob, bool bypass_culling); #define DRW_shgroup_call_object_add(shgroup, geom, ob) DRW_shgroup_call_object_add_ex(shgroup, geom, ob, false) #define DRW_shgroup_call_object_add_no_cull(shgroup, geom, ob) DRW_shgroup_call_object_add_ex(shgroup, geom, ob, true) diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index dab3336b3ed..09890107fa3 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -391,12 +391,17 @@ void DRW_shgroup_call_range_add(DRWShadingGroup *shgroup, Gwn_Batch *geom, float } static void drw_shgroup_call_procedural_add_ex( -DRWShadingGroup *shgroup, Gwn_PrimType prim_type, uint vert_count, float (*obmat)[4]) +DRWShadingGroup *shgroup, Gwn_PrimType prim_type, uint vert_count, float (*obmat)[4], Object *ob) { BLI_assert(ELEM(shgroup->type, DRW_SHG_NORMAL, DRW_SHG_FEEDBACK_TRANSFORM)); DRWCall *call = BLI_mempool_alloc(DST.vmempool->calls); - call->state = drw_call_state_create(shgroup, obmat, NULL); + if (ob) { + call->state = drw_call_state_object(shgroup, ob->obmat, ob); + } + else { + call->state = drw_call_state_create(shgroup, obmat, NULL); + } call->type = DRW_CALL_PROCEDURAL; call->procedural.prim_type = prim_type; call->procedural.vert_count = vert_count; @@ -409,17 +414,24 @@ static void drw_shgroup_call_procedural_add_ex( void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point_count, float (*obmat)[4]) { - drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_POINTS, point_count, obmat); + drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_POINTS, point_count, obmat, NULL); } void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, uint line_count, float (*obmat)[4]) { - drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_LINES, line_count * 2, obmat); + drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_LINES, line_count * 2, obmat, NULL); } void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup, uint tria_count, float (*obmat)[4]) { - drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_TRIS, tria_count * 3, obmat); + drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_TRIS, tria_count * 3, obmat, NULL); +} + +/* TODO (fclem): this is a sign that the api is starting to be limiting. + * Maybe add special function that general purpose for special cases. */ +void DRW_shgroup_call_object_procedural_triangles_culled_add(DRWShadingGroup *shgroup, uint tria_count, Object *ob) +{ + drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_TRIS, tria_count * 3, NULL, ob); } /* These calls can be culled and are optimized for redraw */ diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c index 107d6347c76..721f659f253 100644 --- a/source/blender/draw/modes/overlay_mode.c +++ b/source/blender/draw/modes/overlay_mode.c @@ -202,7 +202,7 @@ static void overlay_cache_populate(void *vedata, Object *ob) DRW_shgroup_uniform_texture(shgrp, "faceIds", faceids); DRW_shgroup_uniform_vec3(shgrp, "wireColor", ts.colorWire, 1); DRW_shgroup_uniform_vec3(shgrp, "rimColor", rim_col, 1); - DRW_shgroup_call_procedural_triangles_add(shgrp, tri_count, ob->obmat); +
[Bf-blender-cvs] [8366c3ecd8e] blender2.8: Depsgraph: Ensure collections are up to date after modifications
Commit: 8366c3ecd8ea70edab27b17e31df21302c9c366f Author: Sergey Sharybin Date: Thu Jun 7 14:39:58 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB8366c3ecd8ea70edab27b17e31df21302c9c366f Depsgraph: Ensure collections are up to date after modifications Before that copied collection in copy-on-write were running out of sync with original ones. This was causing crash with the following scenario: - Delete some objects from scene - Add particle system to an object - Change particle mode to Hair Thanks Dalai for debug session! Pair programming ftw! === M source/blender/blenkernel/intern/collection.c === diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index aa16c899612..ab0ec8b0491 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -59,7 +59,7 @@ static bool collection_child_add(Collection *parent, Collection *collection, int flag, const bool add_us); static bool collection_child_remove(Collection *parent, Collection *collection); -static bool collection_object_add(Collection *collection, Object *ob, int flag, const bool add_us); +static bool collection_object_add(Main *bmain, Collection *collection, Object *ob, int flag, const bool add_us); static bool collection_object_remove(Main *bmain, Collection *collection, Object *ob, const bool free_us); static CollectionChild *collection_find_child(Collection *parent, Collection *collection); @@ -163,7 +163,7 @@ bool BKE_collection_delete(Main *bmain, Collection *collection, bool hierarchy) /* Link child object into parent collections. */ for (CollectionParent *cparent = collection->parents.first; cparent; cparent = cparent->next) { Collection *parent = cparent->collection; - collection_object_add(parent, cob->ob, 0, true); + collection_object_add(bmain, parent, cob->ob, 0, true); } /* Remove child object. */ @@ -190,7 +190,7 @@ bool BKE_collection_delete(Main *bmain, Collection *collection, bool hierarchy) * \param flag Copying options (see BKE_library.h's LIB_ID_COPY_... flags for more). */ void BKE_collection_copy_data( -Main *UNUSED(bmain), Collection *collection_dst, const Collection *collection_src, const int flag) +Main *bmain, Collection *collection_dst, const Collection *collection_src, const int flag) { /* Do not copy collection's preview (same behavior as for objects). */ if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0 && false) { /* XXX TODO temp hack */ @@ -211,7 +211,7 @@ void BKE_collection_copy_data( collection_child_add(collection_dst, child->collection, flag, false); } for (CollectionObject *cob = collection_src->gobject.first; cob; cob = cob->next) { - collection_object_add(collection_dst, cob->ob, flag, false); + collection_object_add(bmain, collection_dst, cob->ob, flag, false); } } @@ -505,7 +505,7 @@ Collection *BKE_collection_object_find(Main *bmain, Collection *collection, Obje /** Collection Objects */ -static bool collection_object_add(Collection *collection, Object *ob, int flag, const bool add_us) +static bool collection_object_add(Main *bmain, Collection *collection, Object *ob, int flag, const bool add_us) { if (ob->dup_group) { /* Cyclic dependency check. */ @@ -528,6 +528,10 @@ static bool collection_object_add(Collection *collection, Object *ob, int flag, id_us_plus(>id); } + if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) { + DEG_id_tag_update_ex(bmain, >id, DEG_TAG_COPY_ON_WRITE); + } + return true; } @@ -548,6 +552,8 @@ static bool collection_object_remove(Main *bmain, Collection *collection, Object id_us_min(>id); } + DEG_id_tag_update_ex(bmain, >id, DEG_TAG_COPY_ON_WRITE); + return true; } @@ -560,7 +566,7 @@ bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob) return false; } - if (!collection_object_add(collection, ob, 0, true)) { + if (!collection_object_add(bmain, collection, ob, 0, true)) { return false; } @@ -580,7 +586,7 @@ void BKE_collection_object_add_from(Main *bmain, Scene *scene, Object *ob_src, O FOREACH_SCENE_COLLECTION_BEGIN(scene, collection) { if (BKE_collection_has_object(collection, ob_src)) { - collection_object_add(collection, ob_dst, 0, true); + collection_object_add(bmain,
[Bf-blender-cvs] [30ec94561c4] blender2.8: Depsgraph: Use more proper relations for scene relation
Commit: 30ec94561c4ef4f2a4686e1ea217cfc8e3ea85f1 Author: Sergey Sharybin Date: Thu Jun 7 12:57:09 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB30ec94561c4ef4f2a4686e1ea217cfc8e3ea85f1 Depsgraph: Use more proper relations for scene relation === M source/blender/depsgraph/intern/builder/deg_builder_relations.cc === diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 8510687ebab..0dffe60e9d9 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1726,9 +1726,8 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object) * evaluated prior to Scene's CoW is ready. */ OperationKey scene_key(_->id, - DEG_NODE_TYPE_PARAMETERS, - DEG_OPCODE_PLACEHOLDER, - "Scene Eval"); + DEG_NODE_TYPE_LAYER_COLLECTIONS, + DEG_OPCODE_VIEW_LAYER_EVAL); DepsRelation *rel = add_relation(scene_key, obdata_ubereval_key, "CoW Relation"); rel->flag |= DEPSREL_FLAG_NO_FLUSH; /* Modifiers */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [89a843b7dc3] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: 89a843b7dc329bd688e3d558c4b53c0816bb0a6f Author: Antonio Vazquez Date: Thu Jun 7 14:39:29 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB89a843b7dc329bd688e3d558c4b53c0816bb0a6f Merge branch 'blender2.8' into greasepencil-object Conflicts: source/blender/depsgraph/intern/builder/deg_builder_relations.cc === === diff --cc source/blender/depsgraph/intern/builder/deg_builder_relations.cc index da7fe0060ab,8510687ebab..8623ff42a5a --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@@ -1846,16 -1849,16 +1846,16 @@@ void DepsgraphRelationBuilder::build_ob } /* Link object data evaluation node to exit operation. */ OperationKey obdata_geom_eval_key(obdata, -DEG_NODE_TYPE_GEOMETRY, -DEG_OPCODE_PLACEHOLDER, -"Geometry Eval"); + DEG_NODE_TYPE_GEOMETRY, + DEG_OPCODE_PLACEHOLDER, + "Geometry Eval"); OperationKey obdata_geom_done_key(obdata, -DEG_NODE_TYPE_GEOMETRY, -DEG_OPCODE_PLACEHOLDER, -"Eval Done"); + DEG_NODE_TYPE_GEOMETRY, + DEG_OPCODE_PLACEHOLDER, + "Eval Done"); add_relation(obdata_geom_eval_key, - obdata_geom_done_key, - "ObData Geom Eval Done"); +obdata_geom_done_key, +"ObData Geom Eval Done"); /* Type-specific links. */ const ID_Type id_type = GS(obdata->name); switch (id_type) { diff --cc source/blender/editors/animation/anim_channels_defines.c index 24c0fcd4710,e4213a8d907..610713af70e --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@@ -64,8 -64,8 +64,9 @@@ #include "BKE_animsys.h" #include "BKE_curve.h" +#include "BKE_gpencil.h" #include "BKE_key.h" + #include "BKE_main.h" #include "BKE_nla.h" #include "BKE_context.h" diff --cc source/blender/editors/animation/anim_deps.c index a613de148ec,adb5a10c19d..ca30fbced8d --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@@ -432,18 -432,9 +432,18 @@@ void ANIM_animdata_update(bAnimContext else if (ale->datatype == ALE_NLASTRIP) { if (ale->update & ANIM_UPDATE_DEPS) { ale->update &= ~ANIM_UPDATE_DEPS; - ANIM_list_elem_update(ac->scene, ale); + ANIM_list_elem_update(ac->bmain, ac->scene, ale); } } + else if (ale->update) { + if (G.debug & G_DEBUG) { + printf("%s: Unhandled animchannel updates (%d) for type=%d (%p)\n", + __func__, ale->update, ale->type, ale->data); + } + + /* Prevent crashes in cases where it can't be handled */ + ale->update = 0; + } BLI_assert(ale->update == 0); } diff --cc source/blender/modifiers/intern/MOD_meshsequencecache.c index 5c3df796765,5ebf67b8d5f..3a13185003b --- a/source/blender/modifiers/intern/MOD_meshsequencecache.c +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c @@@ -197,13 -202,9 +202,13 @@@ ModifierTypeInfo modifierType_MeshSeque /* deformMatrices */NULL, /* deformVertsEM */ NULL, /* deformMatricesEM */ NULL, - /* applyModifier */ NULL, + /* applyModifier */ applyModifier, /* applyModifierEM */ NULL, + /* gp_deformStroke */ NULL, + /* gp_generateStrokes */ NULL, + /* gp_bakeModifier */ NULL, + /* initData */ initData, /* requiredDataMask */ NULL, /* freeData */ freeData, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [38cb2515dfd] soc-2018-npr: Fix snake mode reload.
Commit: 38cb2515dfd5a886130304340e728735e28cd5a0 Author: Nick Wu Date: Thu Jun 7 19:49:39 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rB38cb2515dfd5a886130304340e728735e28cd5a0 Fix snake mode reload. === M source/blender/draw/engines/lanpr/lanpr_engine.c M source/blender/draw/engines/lanpr/shaders/lanpr_line_connection.geometry === diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c b/source/blender/draw/engines/lanpr/lanpr_engine.c index 5c5f934b7f6..1aa0d56b7b6 100644 --- a/source/blender/draw/engines/lanpr/lanpr_engine.c +++ b/source/blender/draw/engines/lanpr/lanpr_engine.c @@ -321,7 +321,7 @@ static void lanpr_cache_finish(void *vedata){ DRW_shgroup_call_add(pd->dpix_preview_shgrp,bi->dpix_preview_batch,0); } - if(lanpr->reloaded){ + if(lanpr->reloaded && lanpr->master_mode == LANPR_MASTER_MODE_DPIX){ GPU_texture_update(txl->dpix_in_pl,pd->atlas_pl); GPU_texture_update(txl->dpix_in_pr,pd->atlas_pr); GPU_texture_update(txl->dpix_in_nl,pd->atlas_nl); diff --git a/source/blender/draw/engines/lanpr/shaders/lanpr_line_connection.geometry b/source/blender/draw/engines/lanpr/shaders/lanpr_line_connection.geometry index d58d6aee819..f30451715db 100644 --- a/source/blender/draw/engines/lanpr/shaders/lanpr_line_connection.geometry +++ b/source/blender/draw/engines/lanpr/shaders/lanpr_line_connection.geometry @@ -1,5 +1,5 @@ layout (lines_adjacency) in; -layout (triangle_strip, max_vertices = 6) out; +layout (triangle_strip, max_vertices = 1) out; in vec2 gOffset[]; @@ -88,7 +88,7 @@ void main() { EmitVertex(); gl_Position = c; EmitVertex(); - EndPrimitive(); + //EndPrimitive(); gl_Position = c; EmitVertex(); @@ -96,5 +96,5 @@ void main() { EmitVertex(); gl_Position = b; EmitVertex(); -EndPrimitive(); +//EndPrimitive(); } \ No newline at end of file ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [30947f22084] soc-2018-npr: Now use one-time scene loading. Line/Polygon smooth added.
Commit: 30947f220847f1047bad9961ee70b11a96f31a14 Author: Nick Wu Date: Thu Jun 7 18:56:17 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rB30947f220847f1047bad9961ee70b11a96f31a14 Now use one-time scene loading. Line/Polygon smooth added. === M source/blender/draw/engines/lanpr/lanpr_all.h M source/blender/draw/engines/lanpr/lanpr_dpix.c M source/blender/draw/engines/lanpr/lanpr_engine.c M source/blender/draw/engines/lanpr/lanpr_snake.c === diff --git a/source/blender/draw/engines/lanpr/lanpr_all.h b/source/blender/draw/engines/lanpr/lanpr_all.h index 2a05dcfdac5..8e7acae20c6 100644 --- a/source/blender/draw/engines/lanpr/lanpr_all.h +++ b/source/blender/draw/engines/lanpr/lanpr_all.h @@ -145,6 +145,7 @@ typedef struct LANPR_PrivateData { BLI_mempool* mp_sample; BLI_mempool* mp_line_strip; BLI_mempool* mp_line_strip_point; + BLI_mempool* mp_batch_list; ListBase pending_samples; ListBase erased_samples; @@ -174,12 +175,21 @@ typedef struct LANPR_PrivateData { Gwn_VertFormat snake_gwn_format; Gwn_Batch* snake_batch; + ListBase dpix_batch_list; + } LANPR_PrivateData; typedef struct LANPR_StorageList { LANPR_PrivateData *g_data; } LANPR_StorageList; +typedef struct LANPR_BatchItem { + Link Item; + Gwn_Batch* dpix_transform_batch; + Gwn_Batch* dpix_preview_batch; + Object* ob; +} LANPR_BatchItem; + typedef struct LANPR_Data { void *engine_type; LANPR_FramebufferList *fbl; @@ -291,7 +301,7 @@ int lanpr_feed_atlas_data_obj(void* vedata, float* AtlasPointsL, float* AtlasPointsR, float* AtlasFaceNormalL, float* AtlasFaceNormalR, Object* ob, int BeginIndex); -void lanpr_feed_atlas_trigger_preview_obj(void* vedata, Object* ob, int BeginIndex); +int lanpr_feed_atlas_trigger_preview_obj(void* vedata, Object* ob, int BeginIndex); void lanpr_dpix_draw_scene(LANPR_TextureList* txl, LANPR_FramebufferList * fbl, LANPR_PassList *psl, LANPR_PrivateData *pd, SceneLANPR *lanpr); diff --git a/source/blender/draw/engines/lanpr/lanpr_dpix.c b/source/blender/draw/engines/lanpr/lanpr_dpix.c index 6fabd972249..2eae86b3242 100644 --- a/source/blender/draw/engines/lanpr/lanpr_dpix.c +++ b/source/blender/draw/engines/lanpr/lanpr_dpix.c @@ -45,7 +45,7 @@ void lanpr_init_atlas_inputs(void *ved){ Object *camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; SceneLANPR* lanpr=_ctx->scene->lanpr; - if(lanpr->reloaded){ + if(lanpr->reloaded || !txl->dpix_in_pl){ DRW_texture_ensure_2D(>dpix_in_pl, TNS_DPIX_TEXTURE_SIZE, TNS_DPIX_TEXTURE_SIZE, GPU_RGBA32F, 0); DRW_texture_ensure_2D(>dpix_in_pr, TNS_DPIX_TEXTURE_SIZE, TNS_DPIX_TEXTURE_SIZE, GPU_RGBA32F, 0); DRW_texture_ensure_2D(>dpix_in_nl, TNS_DPIX_TEXTURE_SIZE, TNS_DPIX_TEXTURE_SIZE, GPU_RGBA32F, 0); @@ -192,6 +192,8 @@ int lanpr_feed_atlas_data_obj(void* vedata, } } + + BM_mesh_free(bm); return BeginIndex + edge_count; } @@ -205,11 +207,11 @@ void lanpr_dpix_index_to_coord_absolute(int index, float* x,float* y){ (*y) = (float)(index / TNS_DPIX_TEXTURE_SIZE)+0.5; } -void lanpr_feed_atlas_trigger_preview_obj(void* vedata, Object* ob, int BeginIndex) { +int lanpr_feed_atlas_trigger_preview_obj(void* vedata, Object* ob, int BeginIndex) { LANPR_StorageList *stl = ((LANPR_Data *)vedata)->stl; LANPR_PrivateData* pd = stl->g_data; Mesh* me = ob->data; - if (ob->type != OB_MESH) return; + if (ob->type != OB_MESH) return BeginIndex; int edge_count = me->totedge; int i; float co[2]; @@ -238,10 +240,16 @@ void lanpr_feed_atlas_trigger_preview_obj(void* vedata, Object* ob, int BeginInd GWN_vertbuf_attr_set(vbo2, attr_id2.pos, i, co); } - Gwn_Batch* gb = GWN_batch_create_ex(GWN_PRIM_POINTS, vbo, 0, GWN_USAGE_STREAM); -Gwn_Batch* gb2 = GWN_batch_create_ex(GWN_PRIM_POINTS, vbo2, 0, GWN_USAGE_STREAM); -DRW_shgroup_call_add(pd->dpix_transform_shgrp,gb,ob->obmat); - DRW_shgroup_call_add(pd->dpix_preview_shgrp,gb2,0); + Gwn_Batch* gb = GWN_batch_create_ex(GWN_PRIM_POINTS, vbo, 0, GWN_USAGE_STATIC|GWN_BATCH_OWNS_VBO); +Gwn_Batch* gb2 = GWN_batch_create_ex(GWN_PRIM_POINTS, vbo2, 0, GWN_USAGE_STATIC|GWN_BATCH_OWNS_VBO); + + LANPR_BatchItem *bi = BLI_mempool_alloc(pd->mp_batch_list); + BLI_addtail(>dpix_batch_list,bi); + bi->dpix_transform_batch = gb; + bi->dpix_preview_batch = gb2; + bi->ob = ob; + + return BeginIndex + edge_count; } @@ -269,14 +277,22 @@ void lanpr_dpix_draw_scene(LANPR_TextureList*
[Bf-blender-cvs] [da8d33e2e36] blender2.8: Merge branch 'master' into blender2.8
Commit: da8d33e2e36ed8a5322921617de1452011e0ec9c Author: Campbell Barton Date: Thu Jun 7 13:41:32 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBda8d33e2e36ed8a5322921617de1452011e0ec9c Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5330f1c5d13] master: Fix sculpt assert on initialization
Commit: 5330f1c5d1365574636bcf9a602afffcf9bf4def Author: Campbell Barton Date: Thu Jun 7 13:38:46 2018 +0200 Branches: master https://developer.blender.org/rB5330f1c5d1365574636bcf9a602afffcf9bf4def Fix sculpt assert on initialization === M source/blender/blenkernel/intern/undo_system.c === diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index 7eaf42591f0..a8f895853ed 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -375,7 +375,7 @@ UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack, bContext *C, c us->type = ut; ustack->step_init = us; ut->step_encode_init(C, us); - undosys_stack_validate(ustack, true); + undosys_stack_validate(ustack, false); return us; } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c63f8042220] blender2.8: Armature: Fix flickering outline on planar custom bones.
Commit: c63f804222050c189082daf4c02a513876f69b00 Author: Clément Foucault Date: Thu Jun 7 13:38:10 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBc63f804222050c189082daf4c02a513876f69b00 Armature: Fix flickering outline on planar custom bones. === M source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl === diff --git a/source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl b/source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl index 11924b19cf8..4d6f3e94693 100644 --- a/source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl +++ b/source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl @@ -69,7 +69,7 @@ void main(void) return; /* Don't outline if concave edge. */ - if (dot(n0, v13) > 0.0) + if (dot(n0, v13) > 0.0001) return; vec2 thick = vColSize[0].w * (lineThickness / viewportSize); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [508e34d0bf6] blender2.8: Merge branch 'master' into blender2.8
Commit: 508e34d0bf68c837c3b0ece72faaab809df52506 Author: Bastien Montagne Date: Thu Jun 7 13:04:16 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB508e34d0bf68c837c3b0ece72faaab809df52506 Merge branch 'master' into blender2.8 Conflicts: source/blender/editors/animation/anim_deps.c source/blender/editors/animation/keyframing.c source/blender/editors/animation/keyingsets.c source/blender/editors/armature/pose_edit.c source/blender/editors/armature/pose_transform.c source/blender/editors/gpencil/gpencil_convert.c source/blender/editors/include/ED_anim_api.h source/blender/editors/include/ED_keyframing.h source/blender/editors/interface/interface_anim.c source/blender/editors/space_action/action_edit.c source/blender/editors/space_graph/graph_edit.c source/blender/editors/space_outliner/outliner_draw.c source/blender/editors/transform/transform_conversions.c source/blender/makesrna/intern/rna_armature.c source/blender/makesrna/intern/rna_pose.c source/blender/python/intern/bpy_rna_anim.c source/blenderplayer/bad_level_call_stubs/stubs.c source/gameengine/Converter/KX_BlenderSceneConverter.cpp === === diff --cc source/blender/editors/animation/anim_deps.c index cfdbe87c8a1,c71acd714d3..adb5a10c19d --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@@ -46,10 -46,11 +46,10 @@@ #include "BKE_animsys.h" #include "BKE_action.h" + #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_fcurve.h" #include "BKE_gpencil.h" - #include "BKE_context.h" - #include "BKE_global.h" + #include "BKE_main.h" #include "BKE_node.h" #include "BKE_sequencer.h" diff --cc source/blender/editors/animation/keyframing.c index e6f2f087ede,6386ad09e80..6f2360767c0 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@@ -53,22 -53,20 +53,23 @@@ #include "DNA_object_types.h" #include "DNA_rigidbody_types.h" - #include "BKE_animsys.h" #include "BKE_action.h" + #include "BKE_animsys.h" #include "BKE_armature.h" + #include "BKE_context.h" -#include "BKE_depsgraph.h" #include "BKE_fcurve.h" - #include "BKE_idcode.h" - #include "BKE_nla.h" #include "BKE_global.h" - #include "BKE_context.h" - #include "BKE_report.h" + #include "BKE_idcode.h" #include "BKE_key.h" + #include "BKE_main.h" #include "BKE_material.h" + #include "BKE_nla.h" + #include "BKE_report.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" +#include "DEG_depsgraph_query.h" + #include "ED_anim_api.h" #include "ED_keyframing.h" #include "ED_keyframes_edit.h" @@@ -158,11 -156,9 +159,11 @@@ bAction *verify_adt_action(Main *bmain /* tag depsgraph to be rebuilt to include time dependency */ /* XXX: we probably should have bmain passed down, but that involves altering too many API's */ - DEG_relations_tag_update(G.main); - DAG_relations_tag_update(bmain); ++ DEG_relations_tag_update(bmain); } + DEG_id_tag_update(>action->id, DEG_TAG_COPY_ON_WRITE); + /* return the action */ return adt->action; } @@@ -1021,7 -1007,9 +1022,9 @@@ bool insert_keyframe_direct(Depsgraph * * *index of -1 keys all array indices */ - short insert_keyframe(Depsgraph *depsgraph, ReportList *reports, ID *id, bAction *act, const char group[], const char rna_path[], int array_index, float cfra, eBezTriple_KeyframeType keytype, eInsertKeyFlags flag) + short insert_keyframe( -Main *bmain, ReportList *reports, ID *id, bAction *act, ++Main *bmain, Depsgraph *depsgraph, ReportList *reports, ID *id, bAction *act, + const char group[], const char rna_path[], int array_index, float cfra, eBezTriple_KeyframeType keytype, eInsertKeyFlags flag) { PointerRNA id_ptr, ptr; PropertyRNA *prop = NULL; @@@ -1772,7 -1760,7 +1775,8 @@@ void ANIM_OT_keyframe_delete_v3d(wmOper static int insert_key_button_exec(bContext *C, wmOperator *op) { + Depsgraph *depsgraph = CTX_data_depsgraph(C); + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ToolSettings *ts = scene->toolsettings; PointerRNA ptr = {{NULL}}; @@@ -1856,7 -1821,7 +1860,7 @@@ index = -1; } - success = insert_keyframe(depsgraph, op->reports, ptr.id.data, NULL, group, path, index, cfra, ts->keyframe_type, flag); - success = insert_keyframe(bmain, op->reports, ptr.id.data, NULL, NULL, path, index, cfra, ts->keyframe_type, flag); ++
[Bf-blender-cvs] [4e014727f6e] blender2.8: Armature: Fix missing loose edges on custom bone shapes.
Commit: 4e014727f6ed1652fd922ba25ec00b0f9df694f9 Author: Clément Foucault Date: Thu Jun 7 12:58:14 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB4e014727f6ed1652fd922ba25ec00b0f9df694f9 Armature: Fix missing loose edges on custom bone shapes. === M source/blender/draw/intern/draw_armature.c === diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index ed9bb6f8ca9..a736f0a31fb 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -319,21 +319,32 @@ static void drw_shgroup_bone_custom_solid( Object *custom) { /* grr, not re-using instances! */ - struct Gwn_Batch *geom = DRW_cache_object_surface_get(custom); - if (geom) { - DRWShadingGroup *shgrp_geom_solid = shgroup_instance_bone_shape_solid(g_data.passes.bone_solid, geom); - float final_bonemat[4][4]; + struct Gwn_Batch *surf = DRW_cache_object_surface_get(custom); + struct Gwn_Batch *edges = DRW_cache_object_edge_detection_get(custom, NULL); + struct Gwn_Batch *ledges = DRW_cache_object_loose_edges_get(custom); + float final_bonemat[4][4]; + + if (surf || edges || ledges) { mul_m4_m4m4(final_bonemat, g_data.ob->obmat, bone_mat); + } + + if (surf) { + DRWShadingGroup *shgrp_geom_solid = shgroup_instance_bone_shape_solid(g_data.passes.bone_solid, surf); DRW_shgroup_call_dynamic_add(shgrp_geom_solid, final_bonemat, bone_color, hint_color); } - geom = DRW_cache_object_edge_detection_get(custom, NULL); - if (geom && outline_color[3] > 0.0f) { - DRWShadingGroup *shgrp_geom_wire = shgroup_instance_bone_shape_outline(g_data.passes.bone_outline, geom); - float final_bonemat[4][4]; - mul_m4_m4m4(final_bonemat, g_data.ob->obmat, bone_mat); + if (edges && outline_color[3] > 0.0f) { + DRWShadingGroup *shgrp_geom_wire = shgroup_instance_bone_shape_outline(g_data.passes.bone_outline, edges); DRW_shgroup_call_dynamic_add(shgrp_geom_wire, final_bonemat, outline_color); } + + if (ledges) { + DRWShadingGroup *shgrp_geom_ledges = shgroup_instance_wire(g_data.passes.bone_wire, ledges); + float final_color[4]; + copy_v3_v3(final_color, outline_color); + final_color[3] = 1.0f; /* hack */ + DRW_shgroup_call_dynamic_add(shgrp_geom_ledges, final_bonemat, final_color); + } } static void drw_shgroup_bone_custom_wire( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3126f85d264] blender2.8: Fix T55062: Depsgraph: Crash with COW with EEVEE viewport
Commit: 3126f85d26448d7e8698724a563e0f5a08f4f34f Author: Dalai Felinto Date: Thu Jun 7 12:47:16 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB3126f85d26448d7e8698724a563e0f5a08f4f34f Fix T55062: Depsgraph: Crash with COW with EEVEE viewport We now remove the shader for every update. So at the moment the whole point of UBO (Uniform Buffer Objects) is that they are more efficient than individual uniforms. Next steps is a harmless refactor to stopping UBO from referring to original data in the UBO, and simply copying it. It would also be interesting to make the final shader more granular as far as the library and required functions are concerned. Even if this doesn't impact performance, it should give us smaller easy to debug shaders (a simple shader now has > 5k lines!). If performance for animated values is measureable slower after this commit we can port the shader creation CPU side to the depsgraph - localizing the tree, hashing, lookup, ... Additionally we can stick to update the UBO when the material changes but not its topology. This is very trick because of localized trees. So we will only re-visit this if profiling hints at any benefit from it. === M source/blender/makesrna/intern/rna_nodetree.c === diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 9cb5b2d40d2..4f928a9a831 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2307,31 +2307,13 @@ static void rna_NodeSocketStandard_vector_range(PointerRNA *ptr, float *min, flo *softmax = dval->max; } -static void rna_NodeSocket_value_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - bNodeTree *ntree = (bNodeTree *)ptr->id.data; - bNodeSocket *sock = ptr->data; - - if (ntree->type == NTREE_SHADER) { - DEG_id_tag_update_ex(bmain, >id, DEG_TAG_SHADING_UPDATE); - WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL); - - if (sock->type == SOCK_STRING) { - rna_NodeSocket_update(bmain, scene, ptr); - } - } - else { - rna_NodeSocket_update(bmain, scene, ptr); - } -} - /* using a context update function here, to avoid searching the node if possible */ static void rna_NodeSocketStandard_value_update(struct bContext *C, PointerRNA *ptr) { bNode *node; /* default update */ - rna_NodeSocket_value_update(CTX_data_main(C), CTX_data_scene(C), ptr); + rna_NodeSocket_update(CTX_data_main(C), CTX_data_scene(C), ptr); /* try to use node from context, faster */ node = CTX_data_pointer_get(C, "node").data; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b3a7a75a266] master: Cleanup: remove moar G.main usages.
Commit: b3a7a75a266de6765d8c04953c0dabce3c30c359 Author: Bastien Montagne Date: Thu Jun 7 12:47:00 2018 +0200 Branches: master https://developer.blender.org/rBb3a7a75a266de6765d8c04953c0dabce3c30c359 Cleanup: remove moar G.main usages. Notes: * Really need to address RNA setters case, end up adding way too much G.main here these days... :/ * Added Main pointer into bAnimContext, helps a lot in anim code ;) === M source/blender/collada/AnimationImporter.cpp M source/blender/collada/AnimationImporter.h M source/blender/collada/DocumentImporter.cpp M source/blender/editors/animation/anim_channels_defines.c M source/blender/editors/animation/anim_deps.c M source/blender/editors/animation/anim_filter.c M source/blender/editors/animation/keyframes_general.c M source/blender/editors/animation/keyframing.c M source/blender/editors/animation/keyingsets.c M source/blender/editors/armature/armature_naming.c M source/blender/editors/armature/armature_relations.c M source/blender/editors/armature/pose_edit.c M source/blender/editors/armature/pose_lib.c M source/blender/editors/armature/pose_transform.c M source/blender/editors/gpencil/gpencil_convert.c M source/blender/editors/include/ED_anim_api.h M source/blender/editors/include/ED_armature.h M source/blender/editors/include/ED_keyframing.h M source/blender/editors/interface/interface_anim.c M source/blender/editors/object/object_constraint.c M source/blender/editors/object/object_relations.c M source/blender/editors/space_action/action_edit.c M source/blender/editors/space_graph/graph_edit.c M source/blender/editors/space_outliner/outliner_draw.c M source/blender/editors/transform/transform_conversions.c M source/blender/editors/transform/transform_generics.c M source/blender/makesrna/intern/rna_armature.c M source/blender/makesrna/intern/rna_pose.c M source/blender/python/intern/bpy_rna_anim.c M source/blenderplayer/bad_level_call_stubs/stubs.c M source/gameengine/Converter/KX_BlenderSceneConverter.cpp === diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 31dbef998d9..13bd5c16053 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -180,11 +180,11 @@ void AnimationImporter::fcurve_is_used(FCurve *fcu) } -void AnimationImporter::add_fcurves_to_object(Object *ob, std::vector& curves, char *rna_path, int array_index, Animation *animated) +void AnimationImporter::add_fcurves_to_object(Main *bmain, Object *ob, std::vector& curves, char *rna_path, int array_index, Animation *animated) { bAction *act; - if (!ob->adt || !ob->adt->action) act = verify_adt_action((ID *)>id, 1); + if (!ob->adt || !ob->adt->action) act = verify_adt_action(bmain, (ID *)>id, 1); else act = ob->adt->action; std::vector::iterator it; @@ -725,7 +725,7 @@ void AnimationImporter::Assign_lens_animations(const COLLADAFW::UniqueId& listid } } -void AnimationImporter::apply_matrix_curves(Object *ob, std::vector& animcurves, COLLADAFW::Node *root, COLLADAFW::Node *node, +void AnimationImporter::apply_matrix_curves(Main *bmain, Object *ob, std::vector& animcurves, COLLADAFW::Node *root, COLLADAFW::Node *node, COLLADAFW::Transformation *tm) { bool is_joint = node->getType() == COLLADAFW::Node::JOINT; @@ -840,7 +840,7 @@ void AnimationImporter::apply_matrix_curves(Object *ob, std::vector& a add_bezt(newcu[i], fra, scale[i - 7]); } } - verify_adt_action((ID *)>id, 1); + verify_adt_action(bmain, (ID *)>id, 1); ListBase *curves = >adt->action->curves; @@ -897,18 +897,18 @@ static const double get_aspect_ratio(const COLLADAFW::Camera *camera) return aspect; } -static ListBase _animation_curves(Material *ma) +static ListBase _animation_curves(Main *bmain, Material *ma) { bAction *act; if (!ma->adt || !ma->adt->action) - act = verify_adt_action((ID *)>id, 1); + act = verify_adt_action(bmain, (ID *)>id, 1); else act = ma->adt->action; return act->curves; } -void AnimationImporter::translate_Animations(COLLADAFW::Node *node, +void AnimationImporter::translate_Animations(Main *bmain, COLLADAFW::Node *node, std::map& root_map, std::multimap& object_map, std::map FW_object_map, @@ -941,7 +941,7 @@ void
[Bf-blender-cvs] [d1474371fac] blender2.8: Fixed deadlock on viewlayer update when there are drivers
Commit: d1474371facd1dd975603954c310547c9d618fc0 Author: Sybren A. Stüvel Date: Thu Jun 7 12:37:48 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBd1474371facd1dd975603954c310547c9d618fc0 Fixed deadlock on viewlayer update when there are drivers When calling the bpy.ops.poselib.apply_pose() operator from Python, Blender would deadlock when the rig has drivers. Similar BPy_{BEGIN,END}_ALLOW_THREADS calls were already in place in the rna_Scene_update_tagged() function. === M source/blender/makesrna/intern/rna_layer.c === diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index 1d8c7c1f248..060b075cb29 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -49,6 +49,10 @@ #ifdef RNA_RUNTIME +#ifdef WITH_PYTHON +# include "BPY_extern.h" +#endif + #include "DNA_group_types.h" #include "DNA_object_types.h" @@ -165,9 +169,18 @@ static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, Po static void rna_ViewLayer_update_tagged(ID *id_ptr, ViewLayer *view_layer, Main *bmain) { +#ifdef WITH_PYTHON + /* Allow drivers to be evaluated */ + BPy_BEGIN_ALLOW_THREADS; +#endif + Scene *scene = (Scene *)id_ptr; Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); BKE_scene_graph_update_tagged(depsgraph, bmain); + +#ifdef WITH_PYTHON + BPy_END_ALLOW_THREADS; +#endif } static void rna_ObjectBase_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a867e63dd68] blender2.8: Rename "Viewport Display SSAO" sub-panel name to Screen Space Ambient Occlusion
Commit: a867e63dd68401b912afb99727bc52712d473fe9 Author: Pablo Vazquez Date: Thu Jun 7 12:08:32 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBa867e63dd68401b912afb99727bc52712d473fe9 Rename "Viewport Display SSAO" sub-panel name to Screen Space Ambient Occlusion Since it is already a sub-panel of Viewport Display anyway === M release/scripts/startup/bl_ui/properties_scene.py === diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 33e89014538..4c5b1a86235 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -477,7 +477,7 @@ class SCENE_PT_viewport_display(SceneButtonsPanel, Panel): class SCENE_PT_viewport_display_ssao(SceneButtonsPanel, Panel): -bl_label = "Viewport Display SSAO" +bl_label = "Screen Space Ambient Occlusion" bl_parent_id = "SCENE_PT_viewport_display" @classmethod ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cdbda1c3d80] blender2.8: GPUPass: Refactor gpupass caching system to allow fast gpumaterial creation.
Commit: cdbda1c3d8017b994366b101b34c79a5df58902f Author: Clément Foucault Date: Thu Jun 7 11:58:15 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBcdbda1c3d8017b994366b101b34c79a5df58902f GPUPass: Refactor gpupass caching system to allow fast gpumaterial creation. This is part of the work needed to refactor the material parameters update. Now the gpupass cache is polled before adding the gpumaterial to the deferred compilation queue. We store gpupasses in a single linked list grouped based on their hashes. This is not the most efficient way but it can be improved upon later. === M source/blender/draw/intern/draw_manager_data.c M source/blender/draw/intern/draw_manager_shader.c M source/blender/gpu/GPU_material.h M source/blender/gpu/intern/gpu_codegen.c M source/blender/gpu/intern/gpu_codegen.h M source/blender/gpu/intern/gpu_material.c M source/blender/windowmanager/intern/wm_init_exit.c === diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index c419e9e2535..dab3336b3ed 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -732,7 +732,14 @@ static DRWShadingGroup *drw_shgroup_material_create_ex(GPUPass *gpupass, DRWPass return NULL; } - DRWShadingGroup *grp = drw_shgroup_create_ex(GPU_pass_shader(gpupass), pass); + GPUShader *sh = GPU_pass_shader_get(gpupass); + + if (!sh) { + /* Shader not yet compiled */ + return NULL; + } + + DRWShadingGroup *grp = drw_shgroup_create_ex(sh, pass); return grp; } @@ -808,7 +815,7 @@ DRWShadingGroup *DRW_shgroup_material_create( DRWShadingGroup *shgroup = drw_shgroup_material_create_ex(gpupass, pass); if (shgroup) { - drw_shgroup_init(shgroup, GPU_pass_shader(gpupass)); + drw_shgroup_init(shgroup, GPU_pass_shader_get(gpupass)); drw_shgroup_material_inputs(shgroup, material); } @@ -825,7 +832,7 @@ DRWShadingGroup *DRW_shgroup_material_instance_create( shgroup->type = DRW_SHG_INSTANCE; shgroup->instance_geom = geom; drw_call_calc_orco(ob, shgroup->instance_orcofac); - drw_shgroup_instance_init(shgroup, GPU_pass_shader(gpupass), geom, format); + drw_shgroup_instance_init(shgroup, GPU_pass_shader_get(gpupass), geom, format); drw_shgroup_material_inputs(shgroup, material); } @@ -843,7 +850,7 @@ DRWShadingGroup *DRW_shgroup_material_empty_tri_batch_create( if (shgroup) { /* Calling drw_shgroup_init will cause it to call GWN_draw_primitive(). */ - drw_shgroup_init(shgroup, GPU_pass_shader(gpupass)); + drw_shgroup_init(shgroup, GPU_pass_shader_get(gpupass)); shgroup->type = DRW_SHG_TRIANGLE_BATCH; shgroup->instance_count = tri_count * 3; drw_shgroup_material_inputs(shgroup, material); diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c index 56a7c5db08e..dd46248a781 100644 --- a/source/blender/draw/intern/draw_manager_shader.c +++ b/source/blender/draw/intern/draw_manager_shader.c @@ -62,7 +62,6 @@ typedef struct DRWDeferredShader { struct DRWDeferredShader *prev, *next; GPUMaterial *mat; - char *vert, *geom, *frag, *defs; } DRWDeferredShader; typedef struct DRWShaderCompiler { @@ -80,11 +79,6 @@ typedef struct DRWShaderCompiler { static void drw_deferred_shader_free(DRWDeferredShader *dsh) { /* Make sure it is not queued before freeing. */ - MEM_SAFE_FREE(dsh->vert); - MEM_SAFE_FREE(dsh->geom); - MEM_SAFE_FREE(dsh->frag); - MEM_SAFE_FREE(dsh->defs); - MEM_freeN(dsh); } @@ -129,12 +123,7 @@ static void drw_deferred_shader_compilation_exec(void *custom_data, short *stop, BLI_spin_unlock(>list_lock); /* Do the compilation. */ - GPU_material_generate_pass( - comp->mat_compiling->mat, - comp->mat_compiling->vert, - comp->mat_compiling->geom, - comp->mat_compiling->frag, - comp->mat_compiling->defs); + GPU_material_compile(comp->mat_compiling->mat); *progress = (float)comp->shaders_done / (float)total; *do_update = true; @@ -165,25 +154,21 @@ static void drw_deferred_shader_compilation_free(void *custom_data) MEM_freeN(comp); } -static void drw_deferred_shader_add( -GPUMaterial *mat, const char *vert, const char *geom, const char *frag_lib,
[Bf-blender-cvs] [366ac88d685] blender2.8: Merge branch 'master' into blender2.8
Commit: 366ac88d685d569e5eaa19ce3fc43764683b60fd Author: Sergey Sharybin Date: Thu Jun 7 12:01:09 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB366ac88d685d569e5eaa19ce3fc43764683b60fd Merge branch 'master' into blender2.8 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [16017178b24] master: Revert "Cycles: Cleanup: Don't use return on function returning void"
Commit: 16017178b24c9c84df5c1114fae8dce4796c6c26 Author: Sergey Sharybin Date: Thu Jun 7 11:57:57 2018 +0200 Branches: master https://developer.blender.org/rB16017178b24c9c84df5c1114fae8dce4796c6c26 Revert "Cycles: Cleanup: Don't use return on function returning void" Not sure why exactly it is called a cleanup, the code was much more clear and robust against possible missing return statements which are MANDATORY. Missing return statement will: - Cause two different BVH traversals to be run. Not is happening currently, but if more BVH layouts are added, it will become a problem. - It is already causing assert() statements to fail, since functions are no longer returning when they are supposed to. If there is any measurable reason to keep this change, let me know. Otherwise just stick to reliable/tested/robust code. This reverts commit ba65f7093b39a8e5f1fb869cbc347fb810a05ab9. === M intern/cycles/kernel/bvh/bvh.h M intern/cycles/kernel/bvh/bvh_local.h === diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h index c0a5bb434ea..d3e0b25a200 100644 --- a/intern/cycles/kernel/bvh/bvh.h +++ b/intern/cycles/kernel/bvh/bvh.h @@ -212,21 +212,20 @@ ccl_device_intersect void scene_intersect_local(KernelGlobals *kg, { #ifdef __OBJECT_MOTION__ if(kernel_data.bvh.have_motion) { - bvh_intersect_local_motion(kg, - , - local_isect, - local_object, - lcg_state, - max_hits); - return; + return bvh_intersect_local_motion(kg, + , + local_isect, + local_object, + lcg_state, + max_hits); } #endif /* __OBJECT_MOTION__ */ - bvh_intersect_local(kg, - , - local_isect, - local_object, - lcg_state, - max_hits); + return bvh_intersect_local(kg, + , + local_isect, + local_object, + lcg_state, + max_hits); } #endif diff --git a/intern/cycles/kernel/bvh/bvh_local.h b/intern/cycles/kernel/bvh/bvh_local.h index 605d4166819..9292cc76a5c 100644 --- a/intern/cycles/kernel/bvh/bvh_local.h +++ b/intern/cycles/kernel/bvh/bvh_local.h @@ -246,22 +246,20 @@ ccl_device_inline void BVH_FUNCTION_NAME(KernelGlobals *kg, switch(kernel_data.bvh.bvh_layout) { #ifdef __QBVH__ case BVH_LAYOUT_BVH4: - BVH_FUNCTION_FULL_NAME(QBVH)(kg, -ray, -local_isect, -local_object, -lcg_state, -max_hits); - break; + return BVH_FUNCTION_FULL_NAME(QBVH)(kg, + ray, + local_isect, + local_object, + lcg_state, + max_hits); #endif case BVH_LAYOUT_BVH2: - BVH_FUNCTION_FULL_NAME(BVH)(kg, - ray, - local_isect, - local_object, - lcg_state, - max_hits); - break; + return BVH_FUNCTION_FULL_NAME(BVH)(kg, + ray, + local_isect, + local_object, + lcg_state, + max_hits); } kernel_assert(!"Should not happen"); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org
[Bf-blender-cvs] [1aa89d9a1c4] blender2.8: Particle edit: Simplify code by benefiting from single edit context
Commit: 1aa89d9a1c49f553d322ae66c73354a5a08dca66 Author: Sergey Sharybin Date: Wed Jun 6 15:48:30 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB1aa89d9a1c49f553d322ae66c73354a5a08dca66 Particle edit: Simplify code by benefiting from single edit context Makes ADD brush to work. At some point children particles draw got broken, children are not visible for until first stroke is done. Still looking into it. === M source/blender/blenkernel/BKE_particle.h M source/blender/blenkernel/intern/particle.c M source/blender/editors/physics/particle_edit.c === diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index d9a5cbab16e..d87d63454f0 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -303,9 +303,6 @@ void psys_set_current_num(Object *ob, int index); struct LatticeDeformData *psys_create_lattice_deform_data(struct ParticleSimulationData *sim); struct ParticleSystem *psys_orig_get(struct ParticleSystem *psys); -struct ParticleSystem *psys_eval_get(struct Depsgraph *depsgraph, - struct Object *object, - struct ParticleSystem *psys); bool psys_in_edit_mode(struct Depsgraph *depsgraph, struct ParticleSystem *psys); bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, const bool use_render_params); bool psys_check_edited(struct ParticleSystem *psys); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 2cd3ff1ccf3..8c322f0c853 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -298,24 +298,6 @@ ParticleSystem *psys_orig_get(ParticleSystem *psys) return psys->orig_psys; } -struct ParticleSystem *psys_eval_get(Depsgraph *depsgraph, - Object *object, - ParticleSystem *psys) -{ - Object *object_eval = DEG_get_evaluated_object(depsgraph, object); - if (object_eval == object) { - return psys; - } - ParticleSystem *psys_eval = object_eval->particlesystem.first; - while (psys_eval != NULL) { - if (psys_eval->orig_psys == psys) { - return psys_eval; - } - psys_eval = psys_eval->next; - } - return psys_eval; -} - static PTCacheEdit *psys_orig_edit_get(ParticleSystem *psys) { if (psys->orig_psys == NULL) { @@ -2618,7 +2600,6 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_re } void psys_cache_edit_paths(Depsgraph *depsgraph, Scene *scene, Object *ob, PTCacheEdit *edit, float cfra, const bool use_render_params) { - Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); ParticleCacheKey *ca, **cache = edit->pathcache; ParticleEditSettings *pset = >toolsettings->particle; @@ -2626,16 +2607,9 @@ void psys_cache_edit_paths(Depsgraph *depsgraph, Scene *scene, Object *ob, PTCac PTCacheEditKey *ekey = NULL; ParticleSystem *psys = edit->psys; - ParticleSystem *psys_eval = NULL; ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); - ParticleSystemModifierData *psmd_eval = NULL; - - if (psmd != NULL) { - psmd_eval = (ParticleSystemModifierData *)modifiers_findByName(ob_eval, psmd->modifier.name); - psys_eval = psmd_eval->psys; - } - ParticleData *pa = psys_eval ? psys_eval->particles : NULL; + ParticleData *pa = psys ? psys->particles : NULL; ParticleInterpolationData pind; ParticleKey result; @@ -2664,7 +2638,7 @@ void psys_cache_edit_paths(Depsgraph *depsgraph, Scene *scene, Object *ob, PTCac /* frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f; */ /* UNUSED */ - const bool use_weight = (pset->brushtype == PE_BRUSH_WEIGHT) && (psys_eval != NULL) && (psys_eval->particles != NULL); + const bool use_weight = (pset->brushtype == PE_BRUSH_WEIGHT) && (psys != NULL) && (psys->particles != NULL); if (use_weight) { ; /* use weight painting colors now... */ @@ -2709,10 +2683,10 @@ void psys_cache_edit_paths(Depsgraph *depsgraph, Scene *scene, Object *ob, PTCac cache[i]->segments = segments; /*--get the first data points--*/ - init_particle_interpolation(ob_eval, psys_eval, pa, ); + init_particle_interpolation(ob, psys, pa, ); - if (psys_eval) { - psys_mat_hair_to_global(ob_eval, psmd_eval->mesh_final, psys->part->from, pa, hairmat); + if (psys) { +
[Bf-blender-cvs] [613faa09878] blender2.8: Draw: Don't take cache existence into account for draw type
Commit: 613faa0987817c82156d1ce2a65516392173b600 Author: Sergey Sharybin Date: Thu Jun 7 10:15:10 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB613faa0987817c82156d1ce2a65516392173b600 Draw: Don't take cache existence into account for draw type === M source/blender/draw/modes/object_mode.c === diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 37a4928cba4..ba44e5dea10 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1998,10 +1998,6 @@ static void OBJECT_cache_populate_particles(Object *ob, ParticleSettings *part = psys->part; int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as; - if (draw_as == PART_DRAW_PATH && !psys->pathcache && !psys->childcache) { - draw_as = PART_DRAW_DOT; - } - static float mat[4][4]; unit_m4(mat); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [72cfd5134be] blender2.8: Draw: Use proper continue when psys is disabled
Commit: 72cfd5134be8a74b59b41574bebf3f095aa8704a Author: Sergey Sharybin Date: Thu Jun 7 10:12:47 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB72cfd5134be8a74b59b41574bebf3f095aa8704a Draw: Use proper continue when psys is disabled === M source/blender/draw/engines/basic/basic_engine.c M source/blender/draw/engines/clay/clay_engine.c M source/blender/draw/engines/workbench/workbench_deferred.c M source/blender/draw/engines/workbench/workbench_forward.c M source/blender/draw/modes/object_mode.c === diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index c86574f7557..2c771578514 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -155,7 +155,7 @@ static void basic_cache_populate(void *vedata, Object *ob) continue; } if (!DRW_check_psys_visible_within_active_context(ob, psys)) { - return; + continue; } ParticleSettings *part = psys->part; const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as; diff --git a/source/blender/draw/engines/clay/clay_engine.c b/source/blender/draw/engines/clay/clay_engine.c index d08fee6039f..5d3717097b1 100644 --- a/source/blender/draw/engines/clay/clay_engine.c +++ b/source/blender/draw/engines/clay/clay_engine.c @@ -838,7 +838,7 @@ static void clay_cache_populate_particles(void *vedata, Object *ob) continue; } if (!DRW_check_psys_visible_within_active_context(ob, psys)) { - return; + continue; } ParticleSettings *part = psys->part; const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as; diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index 9e71ba551a1..428e5d4f7c8 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -618,7 +618,7 @@ static void workbench_cache_populate_particles(WORKBENCH_Data *vedata, Object *o continue; } if (!DRW_check_psys_visible_within_active_context(ob, psys)) { - return; + continue; } ParticleSettings *part = psys->part; const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as; diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index f313aee30ec..8bd27e18da2 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -457,7 +457,7 @@ static void workbench_forward_cache_populate_particles(WORKBENCH_Data *vedata, O continue; } if (!DRW_check_psys_visible_within_active_context(ob, psys)) { - return; + continue; } ParticleSettings *part = psys->part; const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as; diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index ff6fcdb83d2..37a4928cba4 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1992,7 +1992,7 @@ static void OBJECT_cache_populate_particles(Object *ob, continue; } if (!DRW_check_psys_visible_within_active_context(ob, psys)) { - return; + continue; } ParticleSettings *part = psys->part; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a54235e0c63] blender2.8: Particle mode: Support children drawing
Commit: a54235e0c6345faed6b7f709039ff6efa64d2549 Author: Sergey Sharybin Date: Thu Jun 7 11:25:13 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBa54235e0c6345faed6b7f709039ff6efa64d2549 Particle mode: Support children drawing The issue is that children drawing is done by object mode, which operates with data from evaluated context. But that data needs edit mode's cache to be properly updated first. === M source/blender/blenkernel/intern/particle_system.c M source/blender/makesrna/intern/rna_sculpt_paint.c === diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index a2d9891ec2d..8d6991ff9f4 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4217,6 +4217,18 @@ void particle_system_update(struct Depsgraph *depsgraph, Scene *scene, Object *o if (!psys_check_enabled(ob, psys, use_render_params)) return; + if (DEG_is_active(depsgraph)) { + if (psys->orig_psys != NULL && psys->orig_psys->edit != NULL) { + psys_cache_edit_paths( + depsgraph, + (Scene *)DEG_get_original_id(>id), + DEG_get_original_object(ob), + psys->orig_psys->edit, + DEG_get_ctime(depsgraph), + DEG_get_mode(depsgraph) == DAG_EVAL_RENDER); + } + } + cfra = DEG_get_ctime(depsgraph); sim.depsgraph = depsgraph; diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 12b080a9284..a26aceda3b9 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -162,6 +162,8 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr)) if (!edit) return; + if (ob) DEG_id_tag_update(>id, OB_RECALC_DATA); + BKE_particle_batch_cache_dirty(edit->psys, BKE_PARTICLE_BATCH_DIRTY_ALL); psys_free_path_cache(edit->psys, edit); DEG_id_tag_update(_data_scene(C)->id, DEG_TAG_COPY_ON_WRITE); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [df0253be330] blender2.8: Merge branch 'master' into blender2.8
Commit: df0253be330178a360af99f758fc250397d07a5b Author: Bastien Montagne Date: Thu Jun 7 11:22:11 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBdf0253be330178a360af99f758fc250397d07a5b Merge branch 'master' into blender2.8 Conflicts: source/blender/collada/ArmatureExporter.cpp source/blender/collada/ArmatureExporter.h source/blender/collada/DocumentExporter.cpp source/blender/collada/DocumentExporter.h source/blender/collada/SceneExporter.cpp source/blender/collada/SceneExporter.h source/blender/collada/collada.cpp source/blender/collada/collada.h source/blender/editors/armature/armature_edit.c source/blender/editors/armature/pose_transform.c source/blender/editors/include/ED_armature.h source/blender/editors/include/ED_object.h source/blender/editors/include/ED_screen.h source/blender/editors/io/io_collada.c source/blender/editors/object/object_transform.c source/blender/editors/screen/screen_edit.c source/blender/editors/screen/screen_ops.c source/blender/windowmanager/intern/wm.c source/blender/windowmanager/intern/wm_files.c source/blender/windowmanager/intern/wm_window.c source/blenderplayer/bad_level_call_stubs/stubs.c === === diff --cc source/blender/collada/DocumentExporter.cpp index c685df84d02,472bd326205..2e5d1757c4c --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@@ -180,8 -181,7 +180,7 @@@ static COLLADABU::NativeString make_tem // COLLADA allows this through multiple s in . // For this to work, we need to know objects that use a certain action. - -int DocumentExporter::exportCurrentScene(bContext *C, const EvaluationContext *eval_ctx, Scene *sce) +int DocumentExporter::exportCurrentScene(bContext *C, Scene *sce) { PointerRNA sceneptr, unit_settings; PropertyRNA *system; /* unused , *scale; */ diff --cc source/blender/collada/collada.h index 822e12f34e0,907c94855f7..a47463b5a7a --- a/source/blender/collada/collada.h +++ b/source/blender/collada/collada.h @@@ -51,9 -52,8 +51,8 @@@ struct ViewLayer int collada_import(struct bContext *C, ImportSettings *import_settings); - int collada_export(struct bContext *C, - struct EvaluationContext *eval_ctx, + struct Depsgraph *depsgraph, struct Scene *sce, ExportSettings *export_settings); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [54f9cd52835] master: Cleanup: Nuke moar G.main usages...
Commit: 54f9cd52835bdd96cdd01cf643cfccf8a229c04b Author: Bastien Montagne Date: Wed Jun 6 15:50:24 2018 +0200 Branches: master https://developer.blender.org/rB54f9cd52835bdd96cdd01cf643cfccf8a229c04b Cleanup: Nuke moar G.main usages... === M source/blender/collada/ArmatureExporter.cpp M source/blender/collada/ArmatureExporter.h M source/blender/collada/ArmatureImporter.cpp M source/blender/collada/ArmatureImporter.h M source/blender/collada/DocumentExporter.cpp M source/blender/collada/DocumentExporter.h M source/blender/collada/SceneExporter.cpp M source/blender/collada/SceneExporter.h M source/blender/collada/collada.cpp M source/blender/collada/collada.h M source/blender/editors/armature/armature_edit.c M source/blender/editors/armature/armature_relations.c M source/blender/editors/armature/armature_utils.c M source/blender/editors/armature/editarmature_retarget.c M source/blender/editors/armature/pose_transform.c M source/blender/editors/curve/editcurve.c M source/blender/editors/include/ED_armature.h M source/blender/editors/include/ED_curve.h M source/blender/editors/include/ED_object.h M source/blender/editors/include/ED_screen.h M source/blender/editors/io/io_collada.c M source/blender/editors/object/object_constraint.c M source/blender/editors/object/object_edit.c M source/blender/editors/object/object_hook.c M source/blender/editors/object/object_modifier.c M source/blender/editors/object/object_transform.c M source/blender/editors/screen/screen_edit.c M source/blender/editors/screen/screen_ops.c M source/blender/editors/space_file/filelist.c M source/blender/makesrna/intern/rna_armature.c M source/blender/makesrna/intern/rna_object.c M source/blender/windowmanager/intern/wm.c M source/blender/windowmanager/intern/wm_files.c M source/blender/windowmanager/intern/wm_window.c M source/blenderplayer/bad_level_call_stubs/stubs.c === diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index 92ec8b470a8..9afe4662f74 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -62,10 +62,11 @@ ArmatureExporter::ArmatureExporter(COLLADASW::StreamWriter *sw, const ExportSett } // write bone nodes -void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene *sce, +void ArmatureExporter::add_armature_bones(bContext *C, Object *ob_arm, Scene *sce, SceneExporter *se, std::list& child_objects) { + Main *bmain = CTX_data_main(C); // write bone nodes bArmature * armature = (bArmature *)ob_arm->data; @@ -77,11 +78,11 @@ void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene *sce, for (Bone *bone = (Bone *)armature->bonebase.first; bone; bone = bone->next) { // start from root bones if (!bone->parent) - add_bone_node(bone, ob_arm, sce, se, child_objects); + add_bone_node(C, bone, ob_arm, sce, se, child_objects); } if (!is_edited) { - ED_armature_from_edit(armature); + ED_armature_from_edit(bmain, armature); ED_armature_edit_free(armature); } } @@ -160,7 +161,7 @@ void ArmatureExporter::find_objects_using_armature(Object *ob_arm, std::vector& child_objects) { @@ -234,7 +235,7 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene *sce, mul_m4_m4m4((*i)->parentinv, temp, (*i)->parentinv); } - se->writeNodes(*i, sce); + se->writeNodes(C, *i, sce); copy_m4_m4((*i)->parentinv, backup_parinv); child_objects.erase(i++); @@ -243,13 +244,13 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene *sce, } for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) { - add_bone_node(child, ob_arm, sce, se, child_objects); + add_bone_node(C, child, ob_arm, sce, se, child_objects); } node.end(); } else { for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) { - add_bone_node(child, ob_arm, sce, se, child_objects); +
[Bf-blender-cvs] [e27759152ab] blender2.8: Minor comment on possible TODO while validating paint ops for CoW...
Commit: e27759152ab662145e22d89b061bd1b95949b378 Author: Bastien Montagne Date: Thu Jun 7 10:58:52 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBe27759152ab662145e22d89b061bd1b95949b378 Minor comment on possible TODO while validating paint ops for CoW... === M source/blender/editors/sculpt_paint/paint_vertex_color_ops.c === diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c index d7668a48139..8516d92214d 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c @@ -152,6 +152,7 @@ static bool vertex_paint_from_weight(Object *ob) } /* TODO: respect selection. */ + /* TODO: Do we want to take weights from evaluated mesh instead? 2.7x was not doing it anyway... */ mp = me->mpoly; vgroup_active = ob->actdef - 1; for (int i = 0; i < me->totpoly; i++, mp++) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e43065596bb] blender2.8: Alembic export: CoW/Depsgraph fixes
Commit: e43065596bba574ec755fde12a75faea080b1f62 Author: Sybren A. Stüvel Date: Wed Jun 6 15:43:10 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBe43065596bba574ec755fde12a75faea080b1f62 Alembic export: CoW/Depsgraph fixes === M source/blender/alembic/intern/abc_exporter.cc M source/blender/alembic/intern/abc_mesh.cc M source/blender/alembic/intern/abc_mesh.h M source/blender/alembic/intern/abc_points.cc === diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc index dbffcb46790..eda3deab64d 100644 --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@ -60,6 +60,8 @@ extern "C" { #include "BKE_modifier.h" #include "BKE_particle.h" #include "BKE_scene.h" + +#include "DEG_depsgraph_query.h" } using Alembic::Abc::TimeSamplingPtr; @@ -381,14 +383,13 @@ void AbcExporter::createTransformWritersHierarchy(Depsgraph *depsgraph) void AbcExporter::exploreTransform(Depsgraph *depsgraph, Base *ob_base, Object *parent, Object *dupliObParent) { - Object *ob = ob_base->object; - /* If an object isn't exported itself, its duplilist shouldn't be * exported either. */ if (!export_object(_settings, ob_base, dupliObParent != NULL)) { return; } + Object *ob = DEG_get_evaluated_object(depsgraph, ob_base->object); if (object_type_is_exportable(m_scene, ob)) { createTransformWriter(depsgraph, ob, parent, dupliObParent); } diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index 6afdccb7732..bf569916a07 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -369,7 +369,8 @@ void AbcMeshWriter::do_write() if (!m_first_frame && !m_is_animated) return; - struct Mesh *mesh = getFinalMesh(); + bool needsfree; + struct Mesh *mesh = getFinalMesh(needsfree); try { if (m_settings.use_subdiv_schema && m_subdiv_schema.valid()) { @@ -379,10 +380,10 @@ void AbcMeshWriter::do_write() writeMesh(mesh); } - freeMesh(mesh); + if (needsfree) BKE_id_free(NULL, mesh); } catch (...) { - freeMesh(mesh); + if (needsfree) BKE_id_free(NULL, mesh); throw; } } @@ -518,7 +519,7 @@ void AbcMeshWriter::writeFaceSets(struct Mesh *dm, Schema ) } } -Mesh *AbcMeshWriter::getFinalMesh() +Mesh *AbcMeshWriter::getFinalMesh(bool _needsfree) { /* We don't want subdivided mesh data */ if (m_subsurf_mod) { @@ -526,6 +527,7 @@ Mesh *AbcMeshWriter::getFinalMesh() } struct Mesh *mesh = mesh_get_eval_final(m_depsgraph, m_scene, m_object, CD_MASK_MESH); + r_needsfree = false; if (m_subsurf_mod) { m_subsurf_mod->mode &= ~eModifierMode_DisableTemporary; @@ -546,9 +548,8 @@ Mesh *AbcMeshWriter::getFinalMesh() Mesh *result = BKE_bmesh_to_mesh_nomain(bm, ); BM_mesh_free(bm); - freeMesh(mesh); - mesh = result; + r_needsfree = true; } m_custom_data_config.pack_uvs = m_settings.pack_uv; @@ -561,11 +562,6 @@ Mesh *AbcMeshWriter::getFinalMesh() return mesh; } -void AbcMeshWriter::freeMesh(struct Mesh *mesh) -{ - BKE_id_free(NULL, mesh); -} - void AbcMeshWriter::writeArbGeoParams(struct Mesh *dm) { if (m_is_liquid) { diff --git a/source/blender/alembic/intern/abc_mesh.h b/source/blender/alembic/intern/abc_mesh.h index 53d1f04fd55..ee761ec55bd 100644 --- a/source/blender/alembic/intern/abc_mesh.h +++ b/source/blender/alembic/intern/abc_mesh.h @@ -74,8 +74,7 @@ private: std::vector , std::vector ); - struct Mesh *getFinalMesh(); - void freeMesh(struct Mesh *mesh); + struct Mesh *getFinalMesh(bool _needsfree); void getMaterialIndices(struct Mesh *mesh, std::vector ); diff --git a/source/blender/alembic/intern/abc_points.cc b/source/blender/alembic/intern/abc_points.cc index c0d10ea4645..4200962f33e 100644 --- a/source/blender/alembic/intern/abc_points.cc +++ b/source/blender/alembic/intern/abc_points.cc @@ -40,6 +40,8 @@ extern "C" { #include "BKE_scene.h" #include "BLI_math.h" + +#include "DEG_depsgraph_query.h" } using Alembic::AbcGeom::kVertexScope; @@ -102,7 +104,7 @@ void AbcPointsWriter::do_write() continue; } - state.time = BKE_scene_frame_get(m_scene); + state.time = DEG_get_ctime(m_depsgraph); if
[5b0f96f97cd] blender2.8: Alembic import: port DerivedMesh → Mesh
Commit: 5b0f96f97cd427daef7b00331b841580f6ffcdcf Author: Sybren A. Stüvel Date: Wed Jun 6 11:06:11 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB5b0f96f97cd427daef7b00331b841580f6ffcdcf Alembic import: port DerivedMesh → Mesh === M source/blender/alembic/ABC_alembic.h M source/blender/alembic/intern/abc_curves.cc M source/blender/alembic/intern/abc_curves.h M source/blender/alembic/intern/abc_mesh.cc M source/blender/alembic/intern/abc_mesh.h M source/blender/alembic/intern/abc_object.cc M source/blender/alembic/intern/abc_object.h M source/blender/alembic/intern/abc_points.cc M source/blender/alembic/intern/abc_points.h M source/blender/alembic/intern/alembic_capi.cc M source/blender/modifiers/intern/MOD_meshsequencecache.c === diff --git a/source/blender/alembic/ABC_alembic.h b/source/blender/alembic/ABC_alembic.h index 70250310213..08136fc2f49 100644 --- a/source/blender/alembic/ABC_alembic.h +++ b/source/blender/alembic/ABC_alembic.h @@ -29,8 +29,8 @@ extern "C" { struct bContext; struct CacheReader; -struct DerivedMesh; struct ListBase; +struct Mesh; struct Object; struct Scene; @@ -114,12 +114,13 @@ void ABC_get_transform(struct CacheReader *reader, float time, float scale); -struct DerivedMesh *ABC_read_mesh(struct CacheReader *reader, - struct Object *ob, - struct DerivedMesh *dm, - const float time, - const char **err_str, - int flags); +/* Either modifies current_mesh in-place or constructs a new mesh. */ +struct Mesh *ABC_read_mesh(struct CacheReader *reader, + struct Object *ob, + struct Mesh *current_mesh, + const float time, + const char **err_str, + int flags); void CacheReader_incref(struct CacheReader *reader); void CacheReader_free(struct CacheReader *reader); diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc index 41c1dacabc0..9c64fd0481e 100644 --- a/source/blender/alembic/intern/abc_curves.cc +++ b/source/blender/alembic/intern/abc_curves.cc @@ -37,8 +37,8 @@ extern "C" { #include "BLI_listbase.h" -#include "BKE_cdderivedmesh.h" #include "BKE_curve.h" +#include "BKE_mesh.h" #include "BKE_object.h" #include "ED_curve.h" @@ -400,16 +400,16 @@ void read_curve_sample(Curve *cu, const ICurvesSchema , const ISampleSele } } -/* NOTE: Alembic only stores data about control points, but the DerivedMesh +/* NOTE: Alembic only stores data about control points, but the Mesh * passed from the cache modifier contains the displist, which has more data * than the control points, so to avoid corrupting the displist we modify the - * object directly and create a new DerivedMesh from that. Also we might need to + * object directly and create a new Mesh from that. Also we might need to * create new or delete existing NURBS in the curve. */ -DerivedMesh *AbcCurveReader::read_derivedmesh(DerivedMesh * /*dm*/, - const ISampleSelector _sel, - int /*read_flag*/, - const char ** /*err_str*/) +Mesh *AbcCurveReader::read_mesh(Mesh * /*existing_mesh*/, +const ISampleSelector _sel, +int /*read_flag*/, +const char ** /*err_str*/) { const ICurvesSchema::Sample sample = m_curves_schema.getValue(sample_sel); @@ -450,5 +450,5 @@ DerivedMesh *AbcCurveReader::read_derivedmesh(DerivedMesh * /*dm*/, } } - return CDDM_from_curve(m_object); + return BKE_mesh_new_nomain_from_curve(m_object); } diff --git a/source/blender/alembic/intern/abc_curves.h b/source/blender/alembic/intern/abc_curves.h index 1e7180bbb1f..e2373381703 100644 --- a/source/blender/alembic/intern/abc_curves.h +++ b/source/blender/alembic/intern/abc_curves.h @@ -60,10 +60,10 @@ public: const char **err_str) const; void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector _sel); - DerivedMesh *read_derivedmesh(DerivedMesh *dm, - const Alembic::Abc::ISampleSelector _sel, - int read_flag, - const char **err_str); + struct Mesh *read_mesh(struct Mesh *existing_mesh, + const Alembic::Abc::ISampleSelector _sel, +
[d88314ee5b5] blender2.8: Alembic export: port DerivedMesh → Mesh
Commit: d88314ee5b558b06fab22a51fa21bc2a958fc4eb Author: Sybren A. Stüvel Date: Wed Jun 6 14:16:44 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBd88314ee5b558b06fab22a51fa21bc2a958fc4eb Alembic export: port DerivedMesh → Mesh === M source/blender/alembic/intern/abc_hair.cc M source/blender/alembic/intern/abc_hair.h M source/blender/alembic/intern/abc_mesh.cc M source/blender/alembic/intern/abc_mesh.h === diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc index e7cc474e2e8..19ef0f8898f 100644 --- a/source/blender/alembic/intern/abc_hair.cc +++ b/source/blender/alembic/intern/abc_hair.cc @@ -30,12 +30,16 @@ extern "C" { #include "MEM_guardedalloc.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" #include "BLI_listbase.h" #include "BLI_math_geom.h" -#include "BKE_DerivedMesh.h" +#include "BKE_library.h" +#include "BKE_mesh.h" +#include "BKE_mesh_runtime.h" #include "BKE_object.h" #include "BKE_particle.h" } @@ -77,8 +81,8 @@ void AbcHairWriter::do_write() return; } - DerivedMesh *dm = mesh_create_derived_render(m_depsgraph, m_scene, m_object, CD_MASK_MESH); - DM_ensure_tessface(dm); + Mesh *mesh = mesh_get_eval_final(m_depsgraph, m_scene, m_object, CD_MASK_MESH); + BKE_mesh_tessface_ensure(mesh); std::vector verts; std::vector hvertices; @@ -88,14 +92,14 @@ void AbcHairWriter::do_write() if (m_psys->pathcache) { ParticleSettings *part = m_psys->part; - write_hair_sample(dm, part, verts, norm_values, uv_values, hvertices); + write_hair_sample(mesh, part, verts, norm_values, uv_values, hvertices); if (m_settings.export_child_hairs && m_psys->childcache) { - write_hair_child_sample(dm, part, verts, norm_values, uv_values, hvertices); + write_hair_child_sample(mesh, part, verts, norm_values, uv_values, hvertices); } } - dm->release(dm); + BKE_id_free(NULL, mesh); Alembic::Abc::P3fArraySample iPos(verts); m_sample = OCurvesSchema::Sample(iPos, hvertices); @@ -119,7 +123,7 @@ void AbcHairWriter::do_write() m_schema.set(m_sample); } -void AbcHairWriter::write_hair_sample(DerivedMesh *dm, +void AbcHairWriter::write_hair_sample(Mesh *mesh, ParticleSettings *part, std::vector , std::vector _values, @@ -130,9 +134,9 @@ void AbcHairWriter::write_hair_sample(DerivedMesh *dm, float inv_mat[4][4]; invert_m4_m4_safe(inv_mat, m_object->obmat); - MTFace *mtface = static_cast(CustomData_get_layer(>faceData, CD_MTFACE)); - MFace *mface = dm->getTessFaceArray(dm); - MVert *mverts = dm->getVertArray(dm); + MTFace *mtface = mesh->mtface; + MFace *mface = mesh->mface; + MVert *mverts = mesh->mvert; if ((!mtface || !mface) && !m_uv_warning_shown) { std::fprintf(stderr, "Warning, no UV set found for underlying geometry of %s.\n", @@ -155,8 +159,9 @@ void AbcHairWriter::write_hair_sample(DerivedMesh *dm, if (part->from == PART_FROM_FACE && mtface) { const int num = pa->num_dmcache >= 0 ? pa->num_dmcache : pa->num; - if (num < dm->getNumTessFaces(dm)) { - MFace *face = static_cast(dm->getTessFaceData(dm, num, CD_MFACE)); + if (num < mesh->totface) { + /* TODO(Sybren): check whether the NULL check here and if(mface) are actually required */ + MFace *face = mface == NULL ? NULL : [num]; MTFace *tface = mtface + num; if (mface) { @@ -172,7 +177,7 @@ void AbcHairWriter::write_hair_sample(DerivedMesh *dm, } } else { - std::fprintf(stderr, "Particle to faces overflow (%d/%d)\n", num, dm->getNumTessFaces(dm)); + std::fprintf(stderr, "Particle to faces overflow (%d/%d)\n", num, mesh->totface); } } else if (part->from == PART_FROM_VERT && mtface) { @@ -180,8 +185,8 @@ void AbcHairWriter::write_hair_sample(DerivedMesh *dm, const int num = (pa->num_dmcache >= 0) ? pa->num_dmcache : pa->num; /* iterate over all faces to find a corresponding underlying UV */ - for (int n = 0; n < dm->getNumTessFaces(dm); ++n) { -
[Bf-blender-cvs] [c5fbf68d683] greasepencil-object: Cleanup: Fix comment
Commit: c5fbf68d683ff8ad97cfe9c415cdedc050f101ec Author: Antonio Vazquez Date: Thu Jun 7 09:35:19 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBc5fbf68d683ff8ad97cfe9c415cdedc050f101ec Cleanup: Fix comment === M source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl === diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl index 4e52d59dc4d..0eebd865bb7 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl @@ -19,7 +19,7 @@ uniform int xraymode; uniform sampler2D myTexture; uniform int texture_clamp; -/* keep this list synchronized with list in DNA_brush_types.h */ +/* keep this list synchronized with list in gpencil_draw_utils.c */ #define SOLID 0 #define GRADIENT 1 #define RADIAL 2 ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f447411a826] blender2.8: Bone selection: user control contrast
Commit: f447411a826f3e9daff9da9fc5ef1ba882417668 Author: Jeroen Bakker Date: Thu Jun 7 09:18:57 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBf447411a826f3e9daff9da9fc5ef1ba882417668 Bone selection: user control contrast Experiment: let the user be in control of the alpha channel as some rigs are hard too see during bone selection. Especially rigs that were designed for 2.79 wireframe mode. === M release/scripts/startup/bl_ui/space_view3d.py M source/blender/blenloader/intern/versioning_280.c M source/blender/draw/modes/pose_mode.c M source/blender/editors/space_view3d/space_view3d.c M source/blender/makesdna/DNA_view3d_types.h M source/blender/makesrna/intern/rna_space.c === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index c1793d95245..c17b089e04c 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3724,7 +3724,11 @@ class VIEW3D_PT_overlay(Panel): col = layout.column() col.active = display_all col.prop(overlay, "show_transparent_bones") -col.prop(overlay, "show_bone_selection") +row = col.split(0.65) +row.prop(overlay, "show_bone_selection") +sub = row.column() +sub.active = display_all and overlay.show_bone_selection +sub.prop(overlay, "bone_selection_alpha", text="") elif context.mode == 'EDIT_ARMATURE': col.separator() diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 83a0f21002a..eb165efb4f9 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1581,5 +1581,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "bone_selection_alpha")) { + for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_VIEW3D) { + View3D *v3d = (View3D *)sl; + v3d->overlay.bone_selection_alpha = 0.5f; + } + } + } + } + } } } diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c index 586fb590ebf..ad9567cd9c0 100644 --- a/source/blender/draw/modes/pose_mode.c +++ b/source/blender/draw/modes/pose_mode.c @@ -72,13 +72,15 @@ typedef struct POSE_Data { typedef struct POSE_PrivateData { DRWShadingGroup *bone_selection_shgrp; + DRWShadingGroup *bone_selection_invert_shgrp; + float blend_color[4]; + float blend_color_invert[4]; } POSE_PrivateData; /* Transient data */ static struct { struct GPUShader *bone_selection_sh; } e_data = {NULL}; -static float blend_color[4] = {0.0, 0.0, 0.0, 0.5}; /* *** FUNCTIONS *** */ static bool POSE_is_bone_selection_overlay_active(void) @@ -105,11 +107,14 @@ static void POSE_cache_init(void *vedata) { POSE_PassList *psl = ((POSE_Data *)vedata)->psl; POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; + const DRWContextState *draw_ctx = DRW_context_state_get(); + View3D *v3d = draw_ctx->v3d; if (!stl->g_data) { /* Alloc transient pointers */ stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__); } + POSE_PrivateData *ppd = stl->g_data; { /* Solid bones */ @@ -150,13 +155,18 @@ static void POSE_cache_init(void *vedata) { if (POSE_is_bone_selection_overlay_active()) { + copy_v4_fl4(ppd->blend_color, 0.0f, 0.0f, 0.0f, v3d->overlay.bone_selection_alpha); + copy_v4_fl4(ppd->blend_color_invert, 0.0f, 0.0f, 0.0f, pow(v3d->overlay.bone_selection_alpha, 4)); DRWShadingGroup *grp; psl->bone_selection = DRW_pass_create( "Bone Selection", DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND); grp =
[Bf-blender-cvs] [7fb216d800f] blender2.8: Workbench: respect the duplication visibility flag
Commit: 7fb216d800f03489aacec1e4e261d36bba32147c Author: Jeroen Bakker Date: Thu Jun 7 08:25:22 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB7fb216d800f03489aacec1e4e261d36bba32147c Workbench: respect the duplication visibility flag === M source/blender/draw/engines/workbench/workbench_deferred.c M source/blender/draw/engines/workbench/workbench_forward.c === diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index aad4260241f..9e71ba551a1 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -661,7 +661,6 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob) WORKBENCH_StorageList *stl = vedata->stl; WORKBENCH_PassList *psl = vedata->psl; WORKBENCH_PrivateData *wpd = stl->g_data; - if (!DRW_object_is_renderable(ob)) return; @@ -669,6 +668,10 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob) workbench_cache_populate_particles(vedata, ob); } + if (!DRW_check_object_visible_within_active_context(ob)) { + return; + } + WORKBENCH_MaterialData *material; if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) { const DRWContextState *draw_ctx = DRW_context_state_get(); diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 13821e0e57e..f313aee30ec 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -517,6 +517,11 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob) if (ob->type == OB_MESH) { workbench_forward_cache_populate_particles(vedata, ob); } + + if (!DRW_check_object_visible_within_active_context(ob)) { + return; + } + if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) { const DRWContextState *draw_ctx = DRW_context_state_get(); const bool is_active = (ob == draw_ctx->obact); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [212477f6ee0] greasepencil-object: Fix uniform name
Commit: 212477f6ee09c4bcbbc4684ad70b62a175702080 Author: Antonio Vazquez Date: Thu Jun 7 09:24:01 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB212477f6ee09c4bcbbc4684ad70b62a175702080 Fix uniform name The uniform variable name was wrong. === M source/blender/draw/engines/gpencil/gpencil_draw_utils.c === diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 0e058c875d7..5fc6291e926 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -341,7 +341,7 @@ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create( DRW_shgroup_uniform_texture(grp, "myTexture", texture); stl->shgroups[id].texture_clamp = gp_style->flag & GP_STYLE_COLOR_TEX_CLAMP ? 1 : 0; - DRW_shgroup_uniform_int(grp, "t_clamp", >shgroups[id].texture_clamp, 1); + DRW_shgroup_uniform_int(grp, "texture_clamp", >shgroups[id].texture_clamp, 1); BKE_image_release_ibuf(image, ibuf, NULL); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5d2f63c0900] greasepencil-object: UI: More changes in Fill panel
Commit: 5d2f63c09000dee15f525e1a5ee8b47a160339c8 Author: Antonio Vazquez Date: Thu Jun 7 09:22:09 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB5d2f63c09000dee15f525e1a5ee8b47a160339c8 UI: More changes in Fill panel Fix some issues with pattern type. === M release/scripts/startup/bl_ui/properties_material_gpencil.py === diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py index c3a8660ede6..d6a286bda57 100644 --- a/release/scripts/startup/bl_ui/properties_material_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py @@ -223,7 +223,11 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): # Texture if gpcolor.fill_style == 'TEXTURE' or (gpcolor.texture_mix is True and gpcolor.fill_style == 'SOLID'): col.template_ID(gpcolor, "fill_image", open="image.open") -col.prop(gpcolor, "use_fill_pattern", text="Use As Pattern") + +if gpcolor.fill_style == 'TEXTURE': +col.prop(gpcolor, "use_fill_pattern", text="Use As Pattern") +if gpcolor.use_fill_pattern is True: +col.prop(gpcolor, "fill_color", text="Color") col.prop(gpcolor, "texture_offset", text="Offset") col.prop(gpcolor, "texture_scale", text="Scale") ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2d2f23de101] blender2.8: Fix T55348: Renaming a marker can't cancel
Commit: 2d2f23de10103528cb64beef58ec0cdb277409ff Author: Campbell Barton Date: Thu Jun 7 08:54:47 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB2d2f23de10103528cb64beef58ec0cdb277409ff Fix T55348: Renaming a marker can't cancel Regression in a14005c070a1f === M source/blender/editors/interface/interface_templates.c === diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index d934d4dd1e4..9978726fa74 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -3970,7 +3970,9 @@ eAutoPropButsReturn uiTemplateOperatorPropertyButs( #endif /* set various special settings for buttons */ - { + + /* Only do this if we're not refreshing an existing UI. */ + if (block->oldblock == NULL) { const bool is_popup = (block->flag & UI_BLOCK_KEEP_OPEN) != 0; uiBut *but; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs