[Bf-blender-cvs] [ad52ba89993] greasepencil-refactor: Merge branch 'greasepencil-object' into greasepencil-refactor
Commit: ad52ba89993ca845780032d1bd719603042fedf3 Author: Antonio Vazquez Date: Sat Feb 1 08:56:28 2020 +0100 Branches: greasepencil-refactor https://developer.blender.org/rBad52ba89993ca845780032d1bd719603042fedf3 Merge branch 'greasepencil-object' into greasepencil-refactor === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9c82e3fd69e] greasepencil-object: Merge branch 'master' into greasepencil-object
Commit: 9c82e3fd69e04be8e27f16f9a179860d768bf75c Author: Antonio Vazquez Date: Sat Feb 1 08:54:49 2020 +0100 Branches: greasepencil-object https://developer.blender.org/rB9c82e3fd69e04be8e27f16f9a179860d768bf75c Merge branch 'master' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f7770cb97bb] temp-lanpr-review: Merge remote-tracking branch 'origin/master' into temp-lanpr-review
Commit: f7770cb97bb9d19d0806f67da9377129fd4d09b0 Author: YimingWu Date: Sat Feb 1 10:35:40 2020 +0800 Branches: temp-lanpr-review https://developer.blender.org/rBf7770cb97bb9d19d0806f67da9377129fd4d09b0 Merge remote-tracking branch 'origin/master' into temp-lanpr-review === === diff --cc source/blender/blenkernel/intern/library_query.c index bda1cac80e4,5fd852ff089..12a90906d1f --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@@ -484,19 -501,8 +501,12 @@@ static void library_foreach_ID_link(Mai SEQ_END; } - for (CollectionObject *cob = scene->master_collection->gobject.first; cob; - cob = cob->next) { - CALLBACK_INVOKE(cob->ob, IDWALK_CB_USER); - } - for (CollectionChild *child = scene->master_collection->children.first; child; - child = child->next) { - CALLBACK_INVOKE(child->collection, IDWALK_CB_USER); - } + library_foreach_collection(, scene->master_collection); +if (scene->master_collection->lanpr) { + CALLBACK_INVOKE(scene->master_collection->lanpr->target, IDWALK_CB_USER); +} + ViewLayer *view_layer; for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { CALLBACK_INVOKE(view_layer->mat_override, IDWALK_CB_USER); diff --cc source/blender/blenloader/intern/versioning_280.c index dc8e5e9f97e,e92ae6e73cc..3c4b153d2ed --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@@ -4330,5 -4403,18 +4416,18 @@@ void blo_do_versions_280(FileData *fd, } } } + + /* Brush cursor alpha */ + for (Brush *br = bmain->brushes.first; br; br = br->id.next) { + br->add_col[3] = 0.9f; + br->sub_col[3] = 0.9f; + } + + /* Pose brush IK segments. */ + for (Brush *br = bmain->brushes.first; br; br = br->id.next) { + if (br->pose_ik_segments == 0) { + br->pose_ik_segments = 1; + } + } } -} +} ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b47883a990e] temp-lanpr-review: Merge remote-tracking branch 'origin/master' into temp-lanpr-review
Commit: b47883a990ee68e659a8a8b44729be9b8e0d002f Author: YimingWu Date: Sat Feb 1 10:25:32 2020 +0800 Branches: temp-lanpr-review https://developer.blender.org/rBb47883a990ee68e659a8a8b44729be9b8e0d002f Merge remote-tracking branch 'origin/master' into temp-lanpr-review === === diff --cc source/blender/editors/space_view3d/CMakeLists.txt index 4542845f90c,95d7f79f666..193be7567bc --- a/source/blender/editors/space_view3d/CMakeLists.txt +++ b/source/blender/editors/space_view3d/CMakeLists.txt @@@ -95,12 -95,8 +95,12 @@@ if(WITH_FREESTYLE add_definitions(-DWITH_FREESTYLE) endif() +if(WITH_LANPR) + add_definitions(-DWITH_LANPR) +endif() + - if(WITH_MOD_SMOKE) - add_definitions(-DWITH_SMOKE) + if(WITH_MOD_FLUID) + add_definitions(-DWITH_FLUID) endif() blender_add_lib(bf_editor_space_view3d "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --cc source/blender/makesrna/intern/makesrna.c index e02376cdcdc,9b38ca8009c..50344cff3c3 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@@ -4239,8 -4238,8 +4238,9 @@@ static RNAProcessItem PROCESS_ITEMS[] {"rna_lattice.c", "rna_lattice_api.c", RNA_def_lattice}, {"rna_layer.c", NULL, RNA_def_view_layer}, {"rna_linestyle.c", NULL, RNA_def_linestyle}, +{"rna_lanpr.c", NULL, RNA_def_lanpr}, {"rna_main.c", "rna_main_api.c", RNA_def_main}, + {"rna_fluid.c", NULL, RNA_def_fluid}, {"rna_material.c", "rna_material_api.c", RNA_def_material}, {"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh}, {"rna_meta.c", "rna_meta_api.c", RNA_def_meta}, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b5abbc40a07] temp-lanpr-review: Merge remote-tracking branch 'origin/master' into temp-lanpr-review
Commit: b5abbc40a07041af91dca5d0a4acd8e5f1518c91 Author: YimingWu Date: Fri Dec 13 13:42:27 2019 +0800 Branches: temp-lanpr-review https://developer.blender.org/rBb5abbc40a07041af91dca5d0a4acd8e5f1518c91 Merge remote-tracking branch 'origin/master' into temp-lanpr-review === === diff --cc source/blender/blenloader/intern/versioning_280.c index 8de01e6334e,03582990703..dc8e5e9f97e --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@@ -4295,5 -4292,30 +4305,30 @@@ void blo_do_versions_280(FileData *fd, } } } + + /* Add primary tile to images. */ + if (!DNA_struct_elem_find(fd->filesdna, "Image", "ListBase", "tiles")) { + for (Image *ima = bmain->images.first; ima; ima = ima->id.next) { + ImageTile *tile = MEM_callocN(sizeof(ImageTile), "Image Tile"); + tile->ok = 1; + tile->tile_number = 1001; + BLI_addtail(>tiles, tile); + } + } + + /* UDIM Image Editor change. */ + if (!DNA_struct_elem_find(fd->filesdna, "SpaceImage", "int", "tile_grid_shape[2]")) { + for (bScreen *screen = bmain->screens.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_IMAGE) { + SpaceImage *sima = (SpaceImage *)sl; + sima->tile_grid_shape[0] = 1; + sima->tile_grid_shape[1] = 1; + } + } + } + } + } } -} +} ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c2c64472290] temp-lanpr-review: Merge remote-tracking branch 'origin/master' into temp-lanpr-review
Commit: c2c644722900213f1a567aec072a5fddac107993 Author: YimingWu Date: Tue Dec 10 22:13:06 2019 +0800 Branches: temp-lanpr-review https://developer.blender.org/rBc2c644722900213f1a567aec072a5fddac107993 Merge remote-tracking branch 'origin/master' into temp-lanpr-review === === diff --cc source/blender/blenloader/intern/versioning_280.c index fc203f2a1c7,5c7fda67ff0..8de01e6334e --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@@ -4281,5 -4268,19 +4281,19 @@@ void blo_do_versions_280(FileData *fd, { /* Versioning code until next subversion bump goes here. */ + /* Cloth internal springs */ + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { + for (ModifierData *md = ob->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_Cloth) { + ClothModifierData *clmd = (ClothModifierData *)md; + + clmd->sim_parms->internal_tension = 15.0f; + clmd->sim_parms->max_internal_tension = 15.0f; + clmd->sim_parms->internal_compression = 15.0f; + clmd->sim_parms->max_internal_compression = 15.0f; + clmd->sim_parms->internal_spring_max_diversion = M_PI / 4.0f; + } + } + } } -} +} ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bf8a26b7453] master: Fix T54292: CrazySpace transform calculation error
Commit: bf8a26b7453d9b980a77452c3510afba0d35af01 Author: mano-wii Date: Fri Jan 31 23:58:32 2020 -0300 Branches: master https://developer.blender.org/rBbf8a26b7453d9b980a77452c3510afba0d35af01 Fix T54292: CrazySpace transform calculation error The function `modifiers_disable_subsurf_temporary` disables temporarily only subsurf modifiers with the `On Cage` option enabled. But a modifier can act on cage even with this option disabled. Differential Revision: https://developer.blender.org/D6722 === M source/blender/blenkernel/intern/crazyspace.c === diff --git a/source/blender/blenkernel/intern/crazyspace.c b/source/blender/blenkernel/intern/crazyspace.c index 33f9b5b1012..85b58da61de 100644 --- a/source/blender/blenkernel/intern/crazyspace.c +++ b/source/blender/blenkernel/intern/crazyspace.c @@ -81,17 +81,16 @@ static void set_crazy_vertex_quat(float r_quat[4], sub_qt_qtqt(r_quat, q2, q1); } -static int modifiers_disable_subsurf_temporary(Object *ob) +static bool modifiers_disable_subsurf_temporary(struct Scene *scene, Object *ob) { - ModifierData *md; - int disabled = 0; + bool disabled = false; + int cageIndex = modifiers_getCageIndex(scene, ob, NULL, 1); - for (md = ob->modifiers.first; md; md = md->next) { + ModifierData *md = ob->modifiers.first; + for (int i = 0; md && i <= cageIndex; i++, md = md->next) { if (md->type == eModifierType_Subsurf) { - if (md->mode & eModifierMode_OnCage) { -md->mode ^= eModifierMode_DisableTemporary; -disabled = 1; - } + md->mode ^= eModifierMode_DisableTemporary; + disabled = true; } } @@ -108,7 +107,7 @@ float (*BKE_crazyspace_get_mapped_editverts(struct Depsgraph *depsgraph, Object BMEditMesh *editmesh_eval = mesh_eval->edit_mesh; /* disable subsurf temporal, get mapped cos, and enable it */ - if (modifiers_disable_subsurf_temporary(obedit_eval)) { + if (modifiers_disable_subsurf_temporary(scene_eval, obedit_eval)) { /* need to make new derivemesh */ makeDerivedMesh(depsgraph, scene_eval, obedit_eval, editmesh_eval, _MASK_BAREMESH); } @@ -122,7 +121,7 @@ float (*BKE_crazyspace_get_mapped_editverts(struct Depsgraph *depsgraph, Object mesh_get_mapped_verts_coords(mesh_eval_cage, vertexcos, nverts); /* set back the flag, no new cage needs to be built, transform does it */ - modifiers_disable_subsurf_temporary(obedit_eval); + modifiers_disable_subsurf_temporary(scene_eval, obedit_eval); return vertexcos; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [26d0f7ed23e] master: Merge branch 'blender-v2.82-release'
Commit: 26d0f7ed23ec6fe81208bfeda9282217ec7c2211 Author: Campbell Barton Date: Sat Feb 1 13:40:07 2020 +1100 Branches: master https://developer.blender.org/rB26d0f7ed23ec6fe81208bfeda9282217ec7c2211 Merge branch 'blender-v2.82-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3ba5461af0c] blender-v2.82-release: Object: support 'Affect Parents' for snap/clear transform
Commit: 3ba5461af0c8b1273d3daf87d050c24a690273be Author: Campbell Barton Date: Sat Feb 1 13:34:27 2020 +1100 Branches: blender-v2.82-release https://developer.blender.org/rB3ba5461af0c8b1273d3daf87d050c24a690273be Object: support 'Affect Parents' for snap/clear transform Resolves T69450 === M source/blender/editors/include/ED_object.h M source/blender/editors/object/object_data_transform.c M source/blender/editors/object/object_transform.c M source/blender/editors/object/object_utils.c M source/blender/editors/space_view3d/view3d_snap.c M source/blender/editors/transform/transform_convert_object.c === diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index d27eeb270ac..a3b7d6bd1c1 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -73,6 +73,51 @@ bool ED_object_calc_active_center_for_posemode(struct Object *ob, float r_center[3]); bool ED_object_calc_active_center(struct Object *ob, const bool select_only, float r_center[3]); +/* Object Data Container helper API. */ +struct XFormObjectData_Container; +struct XFormObjectData_Container *ED_object_data_xform_container_create(void); +void ED_object_data_xform_container_destroy(struct XFormObjectData_Container *xds); +void ED_object_data_xform_container_update_all(struct XFormObjectData_Container *xds, + struct Main *bmain, + struct Depsgraph *depsgraph); +void ED_object_data_xform_container_item_ensure(struct XFormObjectData_Container *xds, +struct Object *ob); + +/* Object Skip-Child Container helper API. */ +enum { + /** + * The parent is transformed, this is held in place. + */ + XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM = 1, + /** + * The same as #XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM, + * however this objects parent isn't transformed directly. + */ + XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM_INDIRECT = 3, + /** + * Use the parent invert matrix to apply transformation, + * this is needed, because breaks in the selection chain prevents this from being transformed. + * This is used to add the transform which would have been added + * if there weren't breaks in the parent/child chain. + */ + XFORM_OB_SKIP_CHILD_PARENT_APPLY = 2, +}; +struct XFormObjectSkipChild_Container; +struct XFormObjectSkipChild_Container *ED_object_xform_skip_child_container_create(void); +void ED_object_xform_skip_child_container_item_ensure_from_array( +struct XFormObjectSkipChild_Container *xcs, +struct ViewLayer *view_layer, +struct Object **objects, +uint objects_len); +void ED_object_xform_skip_child_container_destroy(struct XFormObjectSkipChild_Container *xcs); +void ED_object_xform_skip_child_container_update_all(struct XFormObjectSkipChild_Container *xcs, + struct Main *bmain, + struct Depsgraph *depsgraph); +void ED_object_xform_skip_child_container_item_ensure(struct XFormObjectSkipChild_Container *xcs, + struct Object *ob, + struct Object *ob_parent_recurse, + int mode); + /* object_ops.c */ void ED_operatortypes_object(void); void ED_operatormacros_object(void); @@ -421,16 +466,6 @@ void ED_object_data_xform_by_mat4(struct XFormObjectData *xod, const float mat[4 void ED_object_data_xform_restore(struct XFormObjectData *xod); void ED_object_data_xform_tag_update(struct XFormObjectData *xod); -/* Container helper API. */ -struct XFormObjectData_Container; -struct XFormObjectData_Container *ED_object_data_xform_container_create(void); -void ED_object_data_xform_container_destroy(struct XFormObjectData_Container *xds); -void ED_object_data_xform_container_update_all(struct XFormObjectData_Container *xds, - struct Main *bmain, - struct Depsgraph *depsgraph); -void ED_object_data_xform_container_item_ensure(struct XFormObjectData_Container *xds, -struct Object *ob); - #ifdef __cplusplus } #endif diff --git a/source/blender/editors/object/object_data_transform.c b/source/blender/editors/object/object_data_transform.c index b6f125c6f71..6d03ec2774c 100644 --- a/source/blender/editors/object/object_data_transform.c +++ b/source/blender/editors/object/object_data_transform.c @@ -580,100 +580,3 @@ void ED_object_data_xform_tag_update(struct XFormObjectData *xod_base) }
[Bf-blender-cvs] [b97da8a3de9] master: Merge branch 'blender-v2.82-release'
Commit: b97da8a3de99a7dfde1e051f7a0cf73726632fb8 Author: Campbell Barton Date: Sat Feb 1 13:01:54 2020 +1100 Branches: master https://developer.blender.org/rBb97da8a3de99a7dfde1e051f7a0cf73726632fb8 Merge branch 'blender-v2.82-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [253dbdbb391] blender-v2.82-release: Object: no longer skip weight paint objects when clearing transform
Commit: 253dbdbb39147d4a74ae450964315a4cfd78a837 Author: Campbell Barton Date: Sat Feb 1 12:31:13 2020 +1100 Branches: blender-v2.82-release https://developer.blender.org/rB253dbdbb39147d4a74ae450964315a4cfd78a837 Object: no longer skip weight paint objects when clearing transform This meant a non-active selected object would be skipped based on the mode last used, mostly an issue with 'Lock Object Modes' disabled. Other transform operators (such as snap) don't do this. Partially reverts b8aff064662d5 === M source/blender/editors/object/object_transform.c === diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 45b9c6306ac..26fd66c7f3e 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -320,13 +320,7 @@ static int object_clear_transform_generic_exec(bContext *C, /* get KeyingSet to use */ ks = ANIM_get_keyingset_for_autokeying(scene, default_ksName); - /* operate on selected objects only if they aren't in weight-paint mode - * (so that object-transform clearing won't be applied at same time as bone-clearing) - */ CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { -if (ob->mode & OB_MODE_WEIGHT_PAINT) { - continue; -} if (use_transform_data_origin) { ED_object_data_xform_container_item_ensure(xds, ob); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c0675868a3f] draw-colormanagement: Overlay: Fix edit text overlay invert logic op not working
Commit: c0675868a3fac2e9c38d3d2bb9f22c5e8b0679b9 Author: Clément Foucault Date: Fri Jan 31 23:58:37 2020 +0100 Branches: draw-colormanagement https://developer.blender.org/rBc0675868a3fac2e9c38d3d2bb9f22c5e8b0679b9 Overlay: Fix edit text overlay invert logic op not working The result is still different as the inversion is done in scene refered linear and not in sRGB space as it used to be. === M source/blender/draw/engines/overlay/overlay_edit_text.c M source/blender/draw/intern/draw_manager_exec.c === diff --git a/source/blender/draw/engines/overlay/overlay_edit_text.c b/source/blender/draw/engines/overlay/overlay_edit_text.c index 72b5ae74255..3de0155d6e0 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_text.c +++ b/source/blender/draw/engines/overlay/overlay_edit_text.c @@ -56,7 +56,9 @@ void OVERLAY_edit_text_cache_init(OVERLAY_Data *vedata) DRW_PASS_CREATE(psl->edit_text_overlay_ps, state | pd->clipping_state); sh = OVERLAY_shader_uniform_color(); -pd->edit_text_overlay_grp = DRW_shgroup_create(sh, psl->edit_text_overlay_ps); +pd->edit_text_overlay_grp = grp = DRW_shgroup_create(sh, psl->edit_text_overlay_ps); + +DRW_shgroup_uniform_vec4_copy(grp, "color", (float[4]){1.0f, 1.0f, 1.0f, 1.0f}); } } diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 68c5b8994d0..23a3e0b05d4 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -234,11 +234,11 @@ void drw_state_set(DRWState state) /* Blending (all buffer) */ { int test; -if (CHANGED_ANY_STORE_VAR(DRW_STATE_BLEND_ALPHA | DRW_STATE_BLEND_ALPHA_PREMUL | - DRW_STATE_BLEND_ADD | DRW_STATE_BLEND_MUL | - DRW_STATE_BLEND_ADD_FULL | DRW_STATE_BLEND_OIT | - DRW_STATE_BLEND_BACKGROUND | DRW_STATE_BLEND_CUSTOM, - test)) { +if (CHANGED_ANY_STORE_VAR( +DRW_STATE_BLEND_ALPHA | DRW_STATE_BLEND_ALPHA_PREMUL | DRW_STATE_BLEND_ADD | +DRW_STATE_BLEND_MUL | DRW_STATE_BLEND_ADD_FULL | DRW_STATE_BLEND_OIT | +DRW_STATE_BLEND_BACKGROUND | DRW_STATE_BLEND_CUSTOM | DRW_STATE_LOGIC_INVERT, +test)) { if (test) { glEnable(GL_BLEND); @@ -283,6 +283,13 @@ void drw_state_set(DRWState state) * Can only be used with one Draw Buffer. */ glBlendFunc(GL_ONE, GL_SRC1_COLOR); } +else if ((state & DRW_STATE_LOGIC_INVERT) != 0) { + /* Replace logic op by blend func to support floating point framebuffer. */ + glBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, + GL_ZERO, /* RGB */ + GL_ZERO, + GL_ONE); /* Alpha */ +} else { BLI_assert(0); } @@ -328,21 +335,6 @@ void drw_state_set(DRWState state) } } - /* Logic Ops */ - { -int test; -if ((test = CHANGED_TO(DRW_STATE_LOGIC_INVERT))) { - if (test == 1) { -glLogicOp(GL_INVERT); -glEnable(GL_COLOR_LOGIC_OP); - } - else { -glLogicOp(GL_COPY); -glDisable(GL_COLOR_LOGIC_OP); - } -} - } - /* Clip Planes */ { int test; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [dc3f073d1c5] master: UI: Font Binary Symbol Updates
Commit: dc3f073d1c5255e79763dfff3ef17f6216f1b391 Author: Harley Acheson Date: Fri Jan 31 14:07:49 2020 -0800 Branches: master https://developer.blender.org/rBdc3f073d1c5255e79763dfff3ef17f6216f1b391 UI: Font Binary Symbol Updates Font binaries updated with consistent keyboard symbols. Footer events now have per-platform icons. Differential Revision: https://developer.blender.org/D6055 Reviewed by Brecht Van Lommel === M release/datafiles/bfont.ttf M release/datafiles/bmonofont.ttf M release/datafiles/fonts/bmonofont-i18n.ttf.gz M release/datafiles/fonts/droidsans.ttf.gz M source/blender/editors/interface/interface_icons_event.c === diff --git a/release/datafiles/bfont.ttf b/release/datafiles/bfont.ttf index 2217f9d1aad..7cb06a988ed 100644 Binary files a/release/datafiles/bfont.ttf and b/release/datafiles/bfont.ttf differ diff --git a/release/datafiles/bmonofont.ttf b/release/datafiles/bmonofont.ttf index e95786a49e4..06235dce116 100644 Binary files a/release/datafiles/bmonofont.ttf and b/release/datafiles/bmonofont.ttf differ diff --git a/release/datafiles/fonts/bmonofont-i18n.ttf.gz b/release/datafiles/fonts/bmonofont-i18n.ttf.gz index 1453ad48c6c..2c3e00d1c75 100644 Binary files a/release/datafiles/fonts/bmonofont-i18n.ttf.gz and b/release/datafiles/fonts/bmonofont-i18n.ttf.gz differ diff --git a/release/datafiles/fonts/droidsans.ttf.gz b/release/datafiles/fonts/droidsans.ttf.gz index 8cd640ba525..858264142f1 100644 Binary files a/release/datafiles/fonts/droidsans.ttf.gz and b/release/datafiles/fonts/droidsans.ttf.gz differ diff --git a/source/blender/editors/interface/interface_icons_event.c b/source/blender/editors/interface/interface_icons_event.c index b7fd953ed63..3cc7aaddf38 100644 --- a/source/blender/editors/interface/interface_icons_event.c +++ b/source/blender/editors/interface/interface_icons_event.c @@ -74,79 +74,35 @@ #include "interface_intern.h" -static void icon_draw_rect_input_small_text_ex( -const rctf *rect, const float color[4], const float margin[2], const char *str, int font_size) +static void icon_draw_rect_input_text( +const rctf *rect, const float color[4], const char *str, int font_size) { BLF_batch_draw_flush(); const int font_id = BLF_default(); BLF_color4fv(font_id, color); BLF_size(font_id, font_size * U.pixelsize, U.dpi); - BLF_position(font_id, rect->xmin + margin[0] * 2, rect->ymin + margin[1] * 5, 0.0f); + float width, height; + BLF_width_and_height(font_id, str, BLF_DRAW_STR_DUMMY_MAX, , ); + float x = rect->xmin + (((rect->xmax - rect->xmin) - width) / 2.0f); + float y = rect->ymin + (((rect->ymax - rect->ymin) - height) / 2.0f); + BLF_position(font_id, x, y, 0.0f); BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); BLF_batch_draw_flush(); } -static void icon_draw_rect_input_small_text(const rctf *rect, -const float color[4], -const float margin[2], -const char *str) -{ - icon_draw_rect_input_small_text_ex(rect, color, margin, str, 8); -} - -static void icon_draw_rect_input_default_text(const rctf *rect, - const float color[4], - const float margin[2], - const char *str) -{ - BLF_batch_draw_flush(); - const int font_id = BLF_default(); - BLF_color4fv(font_id, color); - BLF_position( - font_id, (int)(rect->xmin + margin[0] * 5), (int)(rect->ymin + margin[1] * 5), 0.0f); - BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); - BLF_batch_draw_flush(); -} - -static void icon_draw_rect_input_mono_text(const rctf *rect, - const float color[4], - const float margin[2], - const char *str) +static void icon_draw_rect_input_symbol(const rctf *rect, const float color[4], const char *str) { BLF_batch_draw_flush(); const int font_id = blf_mono_font; BLF_color4fv(font_id, color); - BLF_size(font_id, 20 * U.pixelsize, U.dpi); - BLF_position( - font_id, (int)(rect->xmin + margin[0] * 5), (int)(rect->ymin + margin[1] * 5), 0.0f); + BLF_size(font_id, 19 * U.pixelsize, U.dpi); + float x = rect->xmin + (2.0f * U.pixelsize); + float y = rect->ymin + (1.0f * U.pixelsize); + BLF_position(font_id, x, y, 0.0f); BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); BLF_batch_draw_flush(); } -static void icon_draw_rect_input_line_prim( -const rctf *rect, const float color[4], const int prim, const char lines[][2], int lines_len) -{ - GPU_line_smooth(true); - GPU_blend(true); - BLI_assert(ELEM(prim, GPU_PRIM_LINE_LOOP, GPU_PRIM_LINE_STRIP)); - const uint
[Bf-blender-cvs] [3a4fbf6df1c] new-object-types: UI: use full width for ID blocks in hair/pointcloud/volume properties
Commit: 3a4fbf6df1c696c4341abcebba9a3e2ec25748e5 Author: Philipp Oeser Date: Fri Jan 31 22:05:01 2020 +0100 Branches: new-object-types https://developer.blender.org/rB3a4fbf6df1c696c4341abcebba9a3e2ec25748e5 UI: use full width for ID blocks in hair/pointcloud/volume properties === M release/scripts/startup/bl_ui/properties_data_hair.py M release/scripts/startup/bl_ui/properties_data_pointcloud.py M release/scripts/startup/bl_ui/properties_data_volume.py === diff --git a/release/scripts/startup/bl_ui/properties_data_hair.py b/release/scripts/startup/bl_ui/properties_data_hair.py index e2a59ee4974..e86c2566ac4 100644 --- a/release/scripts/startup/bl_ui/properties_data_hair.py +++ b/release/scripts/startup/bl_ui/properties_data_hair.py @@ -45,12 +45,10 @@ class DATA_PT_context_hair(DataButtonsPanel, Panel): hair = context.hair space = context.space_data -split = layout.split(factor=0.65) - if ob: -split.template_ID(ob, "data") +layout.template_ID(ob, "data") elif hair: -split.template_ID(space, "pin_id") +layout.template_ID(space, "pin_id") class DATA_PT_hair(DataButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_data_pointcloud.py b/release/scripts/startup/bl_ui/properties_data_pointcloud.py index f7f3f70545b..658618e6e77 100644 --- a/release/scripts/startup/bl_ui/properties_data_pointcloud.py +++ b/release/scripts/startup/bl_ui/properties_data_pointcloud.py @@ -45,12 +45,10 @@ class DATA_PT_context_pointcloud(DataButtonsPanel, Panel): pointcloud = context.pointcloud space = context.space_data -split = layout.split(factor=0.65) - if ob: -split.template_ID(ob, "data") +layout.template_ID(ob, "data") elif pointcloud: -split.template_ID(space, "pin_id") +layout.template_ID(space, "pin_id") class DATA_PT_pointcloud(DataButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_data_volume.py b/release/scripts/startup/bl_ui/properties_data_volume.py index dfeadfb1af4..e95aee645ae 100644 --- a/release/scripts/startup/bl_ui/properties_data_volume.py +++ b/release/scripts/startup/bl_ui/properties_data_volume.py @@ -45,12 +45,10 @@ class DATA_PT_context_volume(DataButtonsPanel, Panel): volume = context.volume space = context.space_data -split = layout.split(factor=0.65) - if ob: -split.template_ID(ob, "data") +layout.template_ID(ob, "data") elif volume: -split.template_ID(space, "pin_id") +layout.template_ID(space, "pin_id") class DATA_PT_volume(DataButtonsPanel, Panel): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4046fade9ba] master: Merge branch 'blender-v2.82-release'
Commit: 4046fade9ba74b4a126745c3e9ec594f6a33b41f Author: Philipp Oeser Date: Fri Jan 31 21:58:02 2020 +0100 Branches: master https://developer.blender.org/rB4046fade9ba74b4a126745c3e9ec594f6a33b41f Merge branch 'blender-v2.82-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [eee5a0e4ecd] blender-v2.82-release: UI: use full width for ID blocks in speaker properties
Commit: eee5a0e4ecd3e326c1169f636526040aa964f402 Author: Philipp Oeser Date: Fri Jan 31 21:49:24 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rBeee5a0e4ecd3e326c1169f636526040aa964f402 UI: use full width for ID blocks in speaker properties rBb6a97baa0efa already did this for World, Light, Camera, Texture. rBb196c42d4ade already did this for Lattice. === M release/scripts/startup/bl_ui/properties_data_speaker.py === diff --git a/release/scripts/startup/bl_ui/properties_data_speaker.py b/release/scripts/startup/bl_ui/properties_data_speaker.py index 5de133f184a..10645bdd214 100644 --- a/release/scripts/startup/bl_ui/properties_data_speaker.py +++ b/release/scripts/startup/bl_ui/properties_data_speaker.py @@ -45,12 +45,10 @@ class DATA_PT_context_speaker(DataButtonsPanel, Panel): speaker = context.speaker space = context.space_data -split = layout.split(factor=0.65) - if ob: -split.template_ID(ob, "data") +layout.template_ID(ob, "data") elif speaker: -split.template_ID(space, "pin_id") +layout.template_ID(space, "pin_id") class DATA_PT_speaker(DataButtonsPanel, Panel): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7d1d27c9bf1] new-object-types: Fix compile error
Commit: 7d1d27c9bf1035b444fc0ab1051153609ba68f8c Author: Philipp Oeser Date: Fri Jan 31 20:41:52 2020 +0100 Branches: new-object-types https://developer.blender.org/rB7d1d27c9bf1035b444fc0ab1051153609ba68f8c Fix compile error 'data_orig' / 'data_eval' are already ID. === M source/blender/blenkernel/intern/object.c === diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 4bd0448fb2f..e8b839c5df1 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -432,7 +432,7 @@ void BKE_object_eval_assign_data(Object *object_eval, ID *data_eval, bool is_own { BLI_assert(object_eval->id.tag & LIB_TAG_COPIED_ON_WRITE); BLI_assert(object_eval->runtime.data_eval == NULL); - BLI_assert(data_eval->id.tag & LIB_TAG_NO_MAIN); + BLI_assert(data_eval->tag & LIB_TAG_NO_MAIN); if (is_owned) { /* Set flag for debugging. */ @@ -3472,7 +3472,7 @@ Mesh *BKE_object_get_pre_modified_mesh(Object *object) if (object->type == OB_MESH && object->runtime.data_orig != NULL) { BLI_assert(object->id.tag & LIB_TAG_COPIED_ON_WRITE); BLI_assert(object->id.orig_id != NULL); -BLI_assert(object->runtime.data_orig->id.orig_id == ((Object *)object->id.orig_id)->data); +BLI_assert(object->runtime.data_orig->orig_id == ((Object *)object->id.orig_id)->data); Mesh *result = (Mesh *)object->runtime.data_orig; BLI_assert((result->id.tag & LIB_TAG_COPIED_ON_WRITE) != 0); BLI_assert((result->id.tag & LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT) == 0); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fe327c0970a] draw-colormanagement: Overlay: Put all colors inside draw_common.c for correct colormanagment.
Commit: fe327c0970adba95c6d4d552e6efac4cb1ae841b Author: Clément Foucault Date: Fri Jan 31 18:59:32 2020 +0100 Branches: draw-colormanagement https://developer.blender.org/rBfe327c0970adba95c6d4d552e6efac4cb1ae841b Overlay: Put all colors inside draw_common.c for correct colormanagment. The only exception is for text drawing where the color needs to be sRGB bytes. This could be fixed in the future. There are only two hardcoded values remaining but are rather not important: - object center transform gizmo darkening. - particle display default color. === M source/blender/draw/engines/overlay/overlay_armature.c M source/blender/draw/engines/overlay/overlay_extra.c M source/blender/draw/engines/overlay/overlay_metaball.c M source/blender/draw/engines/overlay/overlay_motion_path.c M source/blender/draw/intern/draw_common.c M source/blender/draw/intern/draw_common.h M source/blender/draw/intern/shaders/common_globals_lib.glsl === diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index 416283e321b..bfa843c06e9 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -88,26 +88,6 @@ typedef struct ArmatureDrawContext { OVERLAY_ExtraCallBuffers *extras; - /** - * Follow `TH_*` naming except for mixed colors. - */ - struct { -float select[4]; -float edge_select[4]; -float bone_select[4]; /* tint */ -float wire[4]; -float wire_edit[4]; -float bone_solid[4]; -float bone_active_unselect[4]; /* mix */ -float bone_pose[4]; -float bone_pose_active[4]; -float bone_pose_active_unselect[4]; /* mix */ -float text_hi[4]; -float text[4]; -float vertex_select[4]; -float vertex[4]; - } color; - /* not a theme, this is an override */ const float *const_color; float const_wire; @@ -667,31 +647,28 @@ static void drw_shgroup_bone_relationship_lines(ArmatureDrawContext *ctx, const float start[3], const float end[3]) { - drw_shgroup_bone_relationship_lines_ex(ctx, start, end, ctx->color.wire); + drw_shgroup_bone_relationship_lines_ex(ctx, start, end, G_draw.block.colorWire); } static void drw_shgroup_bone_ik_lines(ArmatureDrawContext *ctx, const float start[3], const float end[3]) { - float fcolor[4] = {0.8f, 0.5f, 0.0f, 1.0f}; /* add theme! */ - drw_shgroup_bone_relationship_lines_ex(ctx, start, end, fcolor); + drw_shgroup_bone_relationship_lines_ex(ctx, start, end, G_draw.block.colorBoneIKLine); } static void drw_shgroup_bone_ik_no_target_lines(ArmatureDrawContext *ctx, const float start[3], const float end[3]) { - float fcolor[4] = {0.8f, 0.8f, 0.2f, 1.0f}; /* add theme! */ - drw_shgroup_bone_relationship_lines_ex(ctx, start, end, fcolor); + drw_shgroup_bone_relationship_lines_ex(ctx, start, end, G_draw.block.colorBoneIKLineNoTarget); } static void drw_shgroup_bone_ik_spline_lines(ArmatureDrawContext *ctx, const float start[3], const float end[3]) { - float fcolor[4] = {0.8f, 0.8f, 0.2f, 1.0f}; /* add theme! */ - drw_shgroup_bone_relationship_lines_ex(ctx, start, end, fcolor); + drw_shgroup_bone_relationship_lines_ex(ctx, start, end, G_draw.block.colorBoneIKLineSpline); } /** \} */ @@ -708,10 +685,6 @@ enum { PCHAN_COLOR_NORMAL = 0, /* normal drawing */ PCHAN_COLOR_SOLID, /* specific case where "solid" color is needed */ PCHAN_COLOR_CONSTS, /* "constraint" colors (which may/may-not be suppressed) */ - - PCHAN_COLOR_SPHEREBONE_BASE, /* for the 'stick' of sphere (envelope) bones */ - PCHAN_COLOR_SPHEREBONE_END, /* for the ends of sphere (envelope) bones */ - PCHAN_COLOR_LINEBONE,/* for the middle of line-bones */ }; /* This function sets the color-set for coloring a certain bone */ @@ -796,7 +769,6 @@ static bool set_pchan_color(const ArmatureDrawContext *ctx, case PCHAN_COLOR_NORMAL: { if (bcolor) { uchar cp[4] = {255}; - if (boneflag & BONE_DRAW_ACTIVE) { copy_v3_v3_uchar(cp, bcolor->active); if (!(boneflag & BONE_SELECTED)) { @@ -811,159 +783,58 @@ static bool set_pchan_color(const ArmatureDrawContext *ctx, copy_v3_v3_uchar(cp, bcolor->solid); cp_shade_color3ub(cp, -50); } - rgb_uchar_to_float(fcolor, cp); +/* Meh, hardcoded srgb transform here. */ +srgb_to_linearrgb_v4(fcolor, fcolor);
[Bf-blender-cvs] [f9914a8ef99] draw-colormanagement: Overlay: Armature: Fix look regression because of linear space rendering
Commit: f9914a8ef99114a68b4ef35bc0a118cd371f260c Author: Clément Foucault Date: Fri Jan 31 19:40:56 2020 +0100 Branches: draw-colormanagement https://developer.blender.org/rBf9914a8ef99114a68b4ef35bc0a118cd371f260c Overlay: Armature: Fix look regression because of linear space rendering If rendering using linear color the blending of color is different. So we compensate by using non linear mix of the color inside the shader and modify color mixing on the cpu. === M source/blender/draw/engines/overlay/overlay_armature.c M source/blender/draw/engines/overlay/shaders/armature_envelope_solid_frag.glsl M source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl M source/blender/draw/engines/overlay/shaders/armature_sphere_solid_frag.glsl === diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index bfa843c06e9..9174d50009f 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -747,14 +747,6 @@ static void cp_shade_color3ub(uchar cp[3], const int offset) cp[2] = b; } -static void cp_shade_color3f(float cp[3], const float offset) -{ - add_v3_fl(cp, offset); - CLAMP(cp[0], 0, 255); - CLAMP(cp[1], 0, 255); - CLAMP(cp[2], 0, 255); -} - /* This function sets the gl-color for coloring a certain bone (based on bcolor) */ static bool set_pchan_color(const ArmatureDrawContext *ctx, short colCode, @@ -963,13 +955,12 @@ static const float *get_bone_wire_color(const ArmatureDrawContext *ctx, return disp_color; } -#define HINT_MUL 0.5f -#define HINT_SHADE 0.2f - static void bone_hint_color_shade(float hint_color[4], const float color[4]) { - mul_v3_v3fl(hint_color, color, HINT_MUL); - cp_shade_color3f(hint_color, -HINT_SHADE); + /* Increase contrast. */ + mul_v3_v3v3(hint_color, color, color); + /* Decrease value to add mode shading to the shape. */ + mul_v3_fl(hint_color, 0.1f); hint_color[3] = 1.0f; } @@ -1268,7 +1259,7 @@ static void draw_axes(ArmatureDrawContext *ctx, EditBone *eBone, bPoseChannel *p G_draw.block.colorText; copy_v4_v4(final_col, col); /* Mix with axes color. */ - final_col[3] = (ctx->const_color) ? 1.0 : (BONE_FLAG(eBone, pchan) & BONE_SELECTED) ? 0.3 : 0.8; + final_col[3] = (ctx->const_color) ? 1.0 : (BONE_FLAG(eBone, pchan) & BONE_SELECTED) ? 0.1 : 0.65; drw_shgroup_bone_axes(ctx, BONE_VAR(eBone, pchan, disp_mat), final_col); } diff --git a/source/blender/draw/engines/overlay/shaders/armature_envelope_solid_frag.glsl b/source/blender/draw/engines/overlay/shaders/armature_envelope_solid_frag.glsl index 1be9a46e8c7..e4a4f0875f8 100644 --- a/source/blender/draw/engines/overlay/shaders/armature_envelope_solid_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/armature_envelope_solid_frag.glsl @@ -20,7 +20,7 @@ void main() /* Smooth lighting factor. */ const float s = 0.2; /* [0.0-0.5] range */ float fac = clamp((n * (1.0 - s)) + s, 0.0, 1.0); -fragColor.rgb = mix(finalStateColor, finalBoneColor, fac); +fragColor.rgb = mix(finalStateColor, finalBoneColor, fac * fac); fragColor.a = alpha; } lineOutput = vec4(0.0); diff --git a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl index 8284bd43adc..c381aa06e7d 100644 --- a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_vert.glsl @@ -25,7 +25,7 @@ void main() /* Smooth lighting factor. */ const float s = 0.2; /* [0.0-0.5] range */ float fac = clamp((n * (1.0 - s)) + s, 0.0, 1.0); - finalColor.rgb = mix(state_color.rgb, bone_color.rgb, fac); + finalColor.rgb = mix(state_color.rgb, bone_color.rgb, fac * fac); finalColor.a = 1.0; vec4 worldPosition = model_mat * vec4(pos, 1.0); diff --git a/source/blender/draw/engines/overlay/shaders/armature_sphere_solid_frag.glsl b/source/blender/draw/engines/overlay/shaders/armature_sphere_solid_frag.glsl index 0ff0fdf0870..380708795e9 100644 --- a/source/blender/draw/engines/overlay/shaders/armature_sphere_solid_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/armature_sphere_solid_frag.glsl @@ -64,7 +64,7 @@ void main() /* Smooth lighting factor. */ const float s = 0.2; /* [0.0-0.5] range */ float fac = clamp((dot(n, l) * (1.0 - s)) + s, 0.0, 1.0); - fragColor.rgb = mix(finalStateColor, finalBoneColor, fac); + fragColor.rgb = mix(finalStateColor, finalBoneColor, fac * fac); /* 2x2 dither pattern to smooth the lighting. */ float dither = (0.5 +
[Bf-blender-cvs] [f9d09a12091] master: Merge branch 'blender-v2.82-release'
Commit: f9d09a120910a21d383933c15fd72546772b5e81 Author: Brecht Van Lommel Date: Fri Jan 31 19:26:20 2020 +0100 Branches: master https://developer.blender.org/rBf9d09a120910a21d383933c15fd72546772b5e81 Merge branch 'blender-v2.82-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ff40f3967a9] master: Cycles: bump version to 1.12, matching Blender 2.83 release cycle
Commit: ff40f3967a97689423a697d7404fe5bd16b2a79d Author: Brecht Van Lommel Date: Fri Jan 31 19:26:40 2020 +0100 Branches: master https://developer.blender.org/rBff40f3967a97689423a697d7404fe5bd16b2a79d Cycles: bump version to 1.12, matching Blender 2.83 release cycle === M intern/cycles/util/util_version.h === diff --git a/intern/cycles/util/util_version.h b/intern/cycles/util/util_version.h index 7489eed8aed..bb2c99cc6d7 100644 --- a/intern/cycles/util/util_version.h +++ b/intern/cycles/util/util_version.h @@ -22,7 +22,7 @@ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 -#define CYCLES_VERSION_MINOR 11 +#define CYCLES_VERSION_MINOR 12 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d27e852cb73] greasepencil-refactor: GPencil: Moves buffer drawing data to eval data
Commit: d27e852cb733284345398a9e28b0b491c5766b5e Author: Antonio Vazquez Date: Fri Jan 31 17:02:47 2020 +0100 Branches: greasepencil-refactor https://developer.blender.org/rBd27e852cb733284345398a9e28b0b491c5766b5e GPencil: Moves buffer drawing data to eval data Instead to put the sbuffer data in the original datablock, now is copied to evaluated data, but without tagging all datablock that makes things very slow in fast drawing. This changes removes the hacks to use the original datablock for buffers in the drawing engine. Note: still there is a problem when a datablock is used several times with modifiers. === M source/blender/blenkernel/intern/gpencil_modifier.c M source/blender/draw/engines/gpencil/gpencil_engine.c M source/blender/draw/intern/draw_cache_impl_gpencil.c M source/blender/editors/gpencil/gpencil_paint.c M source/blender/editors/gpencil/gpencil_primitive.c M source/blender/editors/gpencil/gpencil_utils.c M source/blender/editors/include/ED_gpencil.h === diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c index bd951607079..83e6b28a9e8 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier.c +++ b/source/blender/blenkernel/intern/gpencil_modifier.c @@ -766,15 +766,28 @@ static void gpencil_copy_activeframe_to_eval( Depsgraph *depsgraph, Scene *scene, Object *ob, bGPdata *gpd_orig, bGPdata *gpd_eval) { /* Copy all relevant data of the datablock. */ - ListBase layers = gpd_eval->layers; - bGPdata_Runtime runtime = gpd_eval->runtime; MEM_SAFE_FREE(gpd_eval->mat); - - memcpy(gpd_eval, gpd_orig, sizeof(bGPdata)); - gpd_eval->layers = layers; - gpd_eval->runtime = runtime; gpd_eval->mat = MEM_dupallocN(gpd_orig->mat); + gpd_eval->flag = gpd_orig->flag; + gpd_eval->pixfactor = gpd_orig->pixfactor; + copy_v4_v4(gpd_eval->line_color, gpd_orig->line_color); + gpd_eval->onion_factor = gpd_orig->onion_factor; + gpd_eval->onion_mode = gpd_orig->onion_mode; + gpd_eval->onion_flag = gpd_orig->onion_flag; + gpd_eval->gstep = gpd_orig->gstep; + gpd_eval->gstep_next = gpd_orig->gstep_next; + copy_v3_v3(gpd_eval->gcolor_prev, gpd_orig->gcolor_prev); + copy_v3_v3(gpd_eval->gcolor_next, gpd_orig->gcolor_next); + gpd_eval->zdepth_offset = gpd_orig->zdepth_offset; + gpd_eval->totcol = gpd_orig->totcol; + gpd_eval->totlayer = gpd_orig->totlayer; + gpd_eval->totframe = gpd_orig->totframe; + gpd_eval->totstroke = gpd_orig->totstroke; + gpd_eval->totpoint = gpd_orig->totpoint; + gpd_eval->draw_mode = gpd_orig->draw_mode; + gpd_eval->onion_keytype = gpd_orig->onion_keytype; + /* Assign (can be NULL if reuse eval copy done by depsgraph). */ if (ob->runtime.gpd_eval != NULL) { ob->data = ob->runtime.gpd_eval; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 4a9aa98c3ce..b0e812a8416 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -228,10 +228,7 @@ void GPENCIL_cache_init(void *ved) if (pd->obact && pd->obact->type == OB_GPENCIL) { /* Check if active object has a temp stroke data. */ bGPdata *gpd = (bGPdata *)pd->obact->data; - /* Current stroke data is stored in the original id. This is waiting refactor of the - * Depsgraph to support more granular update of the GPencil data. */ - bGPdata *gpd_orig = (bGPdata *)DEG_get_original_id(>id); - if (gpd_orig->runtime.sbuffer_used > 0) { + if (gpd->runtime.sbuffer_used > 0) { pd->sbuffer_gpd = gpd; pd->sbuffer_stroke = DRW_cache_gpencil_sbuffer_stroke_data_get(pd->obact); pd->sbuffer_layer = BKE_gpencil_layer_active_get(pd->sbuffer_gpd); diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c index 49ab8b020e3..e77026e850a 100644 --- a/source/blender/draw/intern/draw_cache_impl_gpencil.c +++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c @@ -483,10 +483,6 @@ GPUBatch *DRW_cache_gpencil_face_wireframe_get(Object *ob) bGPDstroke *DRW_cache_gpencil_sbuffer_stroke_data_get(Object *ob) { bGPdata *gpd = (bGPdata *)ob->data; - /* Current stroke data is stored in the original id. This is waiting refactor of the - * Depsgraph to support more granular update of the GPencil data. */ - gpd = (bGPdata *)DEG_get_original_id(>id); - /* Convert the sbuffer to a bGPDstroke. */ if (gpd->runtime.sbuffer_gps == NULL) { bGPDstroke *gps = MEM_callocN(sizeof(*gps), "bGPDstroke sbuffer"); @@ -603,38 +599,27 @@ static void gpencil_sbuffer_stroke_ensure(bGPdata *gpd, bool do_stroke, bool do_ GPUBatch *DRW_cache_gpencil_sbuffer_stroke_get(Object *ob) { bGPdata *gpd =
[Bf-blender-cvs] [8da73170580] greasepencil-refactor: GPencil: Fix problem drawing in instances with modifiers
Commit: 8da73170580fc927b873d64ff6a2ceddcce610f3 Author: Antonio Vazquez Date: Fri Jan 31 18:14:57 2020 +0100 Branches: greasepencil-refactor https://developer.blender.org/rB8da73170580fc927b873d64ff6a2ceddcce610f3 GPencil: Fix problem drawing in instances with modifiers There is a problem of performance if a instance uses modifiers because need a full copy. Need more investigation to find a faster method to duplicate the full datablock. === M source/blender/blenkernel/intern/gpencil_modifier.c === diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c index 83e6b28a9e8..056a80ac151 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier.c +++ b/source/blender/blenkernel/intern/gpencil_modifier.c @@ -762,7 +762,7 @@ static void gpencil_assign_object_eval(Object *object) } /* Helper: Copy active frame from original datablock to evaluated datablock for modifiers. */ -static void gpencil_copy_activeframe_to_eval( +static void gpencil_copy_activeframe_to_eval_ex( Depsgraph *depsgraph, Scene *scene, Object *ob, bGPdata *gpd_orig, bGPdata *gpd_eval) { /* Copy all relevant data of the datablock. */ @@ -841,13 +841,43 @@ static void gpencil_copy_activeframe_to_eval( } } -static bGPdata *gpencil_copy_for_eval(bGPdata *gpd, bool reference) +static void gpencil_copy_activeframe_to_eval( +Depsgraph *depsgraph, Scene *scene, Object *ob, bGPdata *gpd_orig, bGPdata *gpd_eval) { - int flags = LIB_ID_COPY_LOCALIZE; - if (reference) { -flags |= LIB_ID_COPY_CD_REFERENCE; + int layer_index = -1; + LISTBASE_FOREACH (bGPDlayer *, gpl_orig, _orig->layers) { +layer_index++; + +int remap_cfra = gpencil_remap_time_get(depsgraph, scene, ob, gpl_orig); +bGPDframe *gpf_orig = BKE_gpencil_layer_frame_get(gpl_orig, remap_cfra, GP_GETFRAME_USE_PREV); +if (gpf_orig == NULL) { + continue; +} +int gpf_index = BLI_findindex(_orig->frames, gpf_orig); + +bGPDlayer *gpl_eval = BLI_findlink(_eval->layers, layer_index); +if (gpl_eval == NULL) { + continue; +} + +bGPDframe *gpf_eval = BLI_findlink(_eval->frames, gpf_index); + +if ((gpf_orig != NULL) && (gpf_eval != NULL)) { + /* Delete old strokes. */ + BKE_gpencil_free_strokes(gpf_eval); + /* Copy again strokes. */ + BKE_gpencil_frame_copy_strokes(gpf_orig, gpf_eval); + + gpf_eval->runtime.gpf_orig = (bGPDframe *)gpf_orig; + BKE_gpencil_frame_original_pointers_update(gpf_orig, gpf_eval); +} } +} + +static bGPdata *gpencil_copy_for_eval(bGPdata *gpd) +{ + int flags = LIB_ID_COPY_LOCALIZE; bGPdata *result; BKE_id_copy_ex(NULL, >id, (ID **), flags); @@ -877,34 +907,23 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, Scene *scene, Object *o } DEG_debug_print_eval(depsgraph, __func__, gpd_eval->id.name, gpd_eval); - /* If only one user, don't need a new copy, just update data. */ + /* If only one user, don't need a new copy, just update data of the frame. */ if (gpd_orig->id.us == 1) { ob->runtime.gpd_eval = NULL; gpencil_copy_activeframe_to_eval(depsgraph, scene, ob, ob_orig->data, gpd_eval); return; } - /* If first time, do a full copy. */ - if (ob->runtime.gpd_orig == NULL) { -ob->runtime.gpd_orig = gpd_orig; -/* Copy Datablock to evaluated version. */ -if (ob->runtime.gpd_eval != NULL) { - BKE_gpencil_eval_delete(ob->runtime.gpd_eval); - ob->runtime.gpd_eval = NULL; - ob->data = ob->runtime.gpd_orig; -} - -ob->runtime.gpd_eval = gpencil_copy_for_eval(ob->runtime.gpd_orig, true); -gpencil_assign_object_eval(ob); -BKE_gpencil_update_orig_pointers(ob_orig, (Object *)ob); - } - else { -/* Replace only active frame. */ -if (DEG_is_active(depsgraph)) { - gpencil_copy_activeframe_to_eval( - depsgraph, scene, ob, ob->runtime.gpd_orig, ob->runtime.gpd_eval); -} + /* Copy full Datablock to evaluated version. */ + ob->runtime.gpd_orig = gpd_orig; + if (ob->runtime.gpd_eval != NULL) { +BKE_gpencil_eval_delete(ob->runtime.gpd_eval); +ob->runtime.gpd_eval = NULL; +ob->data = ob->runtime.gpd_orig; } + ob->runtime.gpd_eval = gpencil_copy_for_eval(ob->runtime.gpd_orig); + gpencil_assign_object_eval(ob); + BKE_gpencil_update_orig_pointers(ob_orig, (Object *)ob); } /* Calculate gpencil modifiers */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [42d3a160bd9] greasepencil-refactor: GPencil: Fix crash when mask layer is empty
Commit: 42d3a160bd953dbbded17d172408dd95afa2d5ec Author: Antonio Vazquez Date: Thu Jan 30 16:59:11 2020 +0100 Branches: greasepencil-refactor https://developer.blender.org/rB42d3a160bd953dbbded17d172408dd95afa2d5ec GPencil: Fix crash when mask layer is empty When the layer is empty, the mask framebuffer must be created. === M source/blender/blenkernel/intern/gpencil.c M source/blender/draw/engines/gpencil/gpencil_engine.c === diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 4386792d507..73128818748 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -3753,6 +3753,9 @@ void BKE_gpencil_visible_stroke_iter( } if (sta_gpf == NULL && act_gpf == NULL) { + if (layer_cb) { +layer_cb(gpl, act_gpf, NULL, thunk); + } continue; } diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 2418d5e7abc..4a9aa98c3ce 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -490,7 +490,7 @@ static void gp_layer_cache_populate(bGPDlayer *gpl, DRW_shgroup_uniform_float_copy(iter->grp, "strokeIndexOffset", iter->stroke_index_offset); DRW_shgroup_stencil_mask(iter->grp, 0xFF); - bool use_onion = gpf->runtime.onion_id != 0.0f; + bool use_onion = gpf && gpf->runtime.onion_id != 0.0f; if (use_onion) { const bool use_onion_custom_col = (gpd->onion_flag & GP_ONION_GHOST_PREVCOL) != 0; const bool use_onion_fade = (gpd->onion_flag & GP_ONION_FADE) != 0; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [80290684a35] greasepencil-refactor: GPencil: Cleanup unused function
Commit: 80290684a35aa1c54bffcf39d469eb031131376e Author: Antonio Vazquez Date: Fri Jan 31 19:18:37 2020 +0100 Branches: greasepencil-refactor https://developer.blender.org/rB80290684a35aa1c54bffcf39d469eb031131376e GPencil: Cleanup unused function === M source/blender/blenkernel/intern/gpencil_modifier.c === diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c index 056a80ac151..dd4d869c651 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier.c +++ b/source/blender/blenkernel/intern/gpencil_modifier.c @@ -762,85 +762,6 @@ static void gpencil_assign_object_eval(Object *object) } /* Helper: Copy active frame from original datablock to evaluated datablock for modifiers. */ -static void gpencil_copy_activeframe_to_eval_ex( -Depsgraph *depsgraph, Scene *scene, Object *ob, bGPdata *gpd_orig, bGPdata *gpd_eval) -{ - /* Copy all relevant data of the datablock. */ - MEM_SAFE_FREE(gpd_eval->mat); - gpd_eval->mat = MEM_dupallocN(gpd_orig->mat); - - gpd_eval->flag = gpd_orig->flag; - gpd_eval->pixfactor = gpd_orig->pixfactor; - copy_v4_v4(gpd_eval->line_color, gpd_orig->line_color); - gpd_eval->onion_factor = gpd_orig->onion_factor; - gpd_eval->onion_mode = gpd_orig->onion_mode; - gpd_eval->onion_flag = gpd_orig->onion_flag; - gpd_eval->gstep = gpd_orig->gstep; - gpd_eval->gstep_next = gpd_orig->gstep_next; - copy_v3_v3(gpd_eval->gcolor_prev, gpd_orig->gcolor_prev); - copy_v3_v3(gpd_eval->gcolor_next, gpd_orig->gcolor_next); - gpd_eval->zdepth_offset = gpd_orig->zdepth_offset; - gpd_eval->totcol = gpd_orig->totcol; - gpd_eval->totlayer = gpd_orig->totlayer; - gpd_eval->totframe = gpd_orig->totframe; - gpd_eval->totstroke = gpd_orig->totstroke; - gpd_eval->totpoint = gpd_orig->totpoint; - gpd_eval->draw_mode = gpd_orig->draw_mode; - gpd_eval->onion_keytype = gpd_orig->onion_keytype; - - /* Assign (can be NULL if reuse eval copy done by depsgraph). */ - if (ob->runtime.gpd_eval != NULL) { -ob->data = ob->runtime.gpd_eval; - } - - int layer_index = -1; - LISTBASE_FOREACH (bGPDlayer *, gpl_orig, _orig->layers) { -layer_index++; - -int remap_cfra = gpencil_remap_time_get(depsgraph, scene, ob, gpl_orig); -bGPDframe *gpf_orig = BKE_gpencil_layer_frame_get(gpl_orig, remap_cfra, GP_GETFRAME_USE_PREV); -if (gpf_orig == NULL) { - continue; -} -int gpf_index = BLI_findindex(_orig->frames, gpf_orig); - -bGPDlayer *gpl_eval = BLI_findlink(_eval->layers, layer_index); -if (gpl_eval == NULL) { - continue; -} -/* Copy all relevant data of the layer. */ -gpl_eval->flag = gpl_orig->flag; -gpl_eval->onion_flag = gpl_orig->onion_flag; -copy_v4_v4(gpl_eval->color, gpl_orig->color); -copy_v4_v4(gpl_eval->fill, gpl_orig->fill); -BLI_strncpy(gpl_eval->info, gpl_orig->info, sizeof(gpl_eval->info)); -gpl_eval->thickness = gpl_orig->thickness; -gpl_eval->pass_index = gpl_orig->pass_index; -gpl_eval->parent = gpl_orig->parent; -copy_m4_m4(gpl_eval->inverse, gpl_orig->inverse); -BLI_strncpy(gpl_eval->parsubstr, gpl_orig->parsubstr, sizeof(gpl_eval->parsubstr)); -gpl_eval->partype = gpl_orig->partype; -gpl_eval->line_change = gpl_orig->line_change; -copy_v4_v4(gpl_eval->tintcolor, gpl_orig->tintcolor); -gpl_eval->opacity = gpl_orig->opacity; -BLI_strncpy(gpl_eval->viewlayername, gpl_orig->viewlayername, sizeof(gpl_eval->viewlayername)); -gpl_eval->blend_mode = gpl_orig->blend_mode; -gpl_eval->vertex_paint_opacity = gpl_orig->vertex_paint_opacity; - -bGPDframe *gpf_eval = BLI_findlink(_eval->frames, gpf_index); - -if ((gpf_orig != NULL) && (gpf_eval != NULL)) { - /* Delete old strokes. */ - BKE_gpencil_free_strokes(gpf_eval); - /* Copy again strokes. */ - BKE_gpencil_frame_copy_strokes(gpf_orig, gpf_eval); - - gpf_eval->runtime.gpf_orig = (bGPDframe *)gpf_orig; - BKE_gpencil_frame_original_pointers_update(gpf_orig, gpf_eval); -} - } -} - static void gpencil_copy_activeframe_to_eval( Depsgraph *depsgraph, Scene *scene, Object *ob, bGPdata *gpd_orig, bGPdata *gpd_eval) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [57801426792] blender-v2.82-release: Fix T64024: fullscreen switching on macOS shows red line artifacts
Commit: 57801426792c3ca9c126c3c720ca6f337815294c Author: Yevgeny Makarov Date: Fri Jan 31 18:33:36 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rB57801426792c3ca9c126c3c720ca6f337815294c Fix T64024: fullscreen switching on macOS shows red line artifacts Specifically, this happened when automatically hiding and showing of the menu bar and dock was enabled in the system preferences. Differential Revision: https://developer.blender.org/D6710 === M intern/ghost/intern/GHOST_WindowCocoa.mm === diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 43e35faf808..41163239a2b 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -94,6 +94,12 @@ - (void)windowWillEnterFullScreen:(NSNotification *)notification { associatedWindow->setImmediateDraw(true); + /* macOS does not send a window resize event when switching between zoomed + * and fullscreen, when automatic show/hide of dock and menu bar are enabled. + * Send our own to prevent artifacts. */ + if ([(NSWindow *)associatedWindow->getOSWindow() isZoomed]) { +systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); + } } - (void)windowDidEnterFullScreen:(NSNotification *)notification @@ -109,6 +115,10 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification { associatedWindow->setImmediateDraw(false); + /* See comment for windowWillEnterFullScreen. */ + if ([(NSWindow *)associatedWindow->getOSWindow() isZoomed]) { +systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); + } } - (void)windowDidResize:(NSNotification *)notification ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4633bb9939c] master: Cleanup: enforce immutability through const, instead of a comment
Commit: 4633bb9939cd11a2429aeb2c0e5e3ede311a3126 Author: Nicholas Rishel Date: Fri Jan 31 17:43:51 2020 +0100 Branches: master https://developer.blender.org/rB4633bb9939cd11a2429aeb2c0e5e3ede311a3126 Cleanup: enforce immutability through const, instead of a comment Differential Revision: https://developer.blender.org/D6504 === M intern/ghost/intern/GHOST_SystemSDL.cpp M intern/ghost/intern/GHOST_SystemX11.cpp M intern/ghost/intern/GHOST_WindowManager.cpp M intern/ghost/intern/GHOST_WindowManager.h === diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp index d3295d5584c..7ed912b8218 100644 --- a/intern/ghost/intern/GHOST_SystemSDL.cpp +++ b/intern/ghost/intern/GHOST_SystemSDL.cpp @@ -702,9 +702,9 @@ GHOST_WindowSDL *GHOST_SystemSDL::findGhostWindow(SDL_Window *sdl_win) // We should always check the window manager's list of windows // and only process events on these windows. - std::vector _vec = m_windowManager->getWindows(); + const std::vector _vec = m_windowManager->getWindows(); - std::vector::iterator win_it = win_vec.begin(); + std::vector::const_iterator win_it = win_vec.begin(); std::vector::const_iterator win_end = win_vec.end(); for (; win_it != win_end; ++win_it) { diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 4c77dbd7abe..2cc515ca3d7 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -546,9 +546,9 @@ GHOST_WindowX11 *GHOST_SystemX11::findGhostWindow(Window xwind) const * We should always check the window manager's list of windows * and only process events on these windows. */ - vector _vec = m_windowManager->getWindows(); + const vector _vec = m_windowManager->getWindows(); - vector::iterator win_it = win_vec.begin(); + vector::const_iterator win_it = win_vec.begin(); vector::const_iterator win_end = win_vec.end(); for (; win_it != win_end; ++win_it) { @@ -840,8 +840,8 @@ void GHOST_SystemX11::processEvent(XEvent *xe) /* update all window events */ { - vector _vec = m_windowManager->getWindows(); - vector::iterator win_it = win_vec.begin(); + const vector _vec = m_windowManager->getWindows(); + vector::const_iterator win_it = win_vec.begin(); vector::const_iterator win_end = win_vec.end(); for (; win_it != win_end; ++win_it) { @@ -1661,7 +1661,7 @@ void GHOST_SystemX11::addDirtyWindow(GHOST_WindowX11 *bad_wind) bool GHOST_SystemX11::generateWindowExposeEvents() { - vector::iterator w_start = m_dirty_windows.begin(); + vector::const_iterator w_start = m_dirty_windows.begin(); vector::const_iterator w_end = m_dirty_windows.end(); bool anyProcessed = false; @@ -1871,8 +1871,8 @@ void GHOST_SystemX11::getClipboard_xcout(const XEvent *evt, unsigned long pty_size, pty_items; unsigned char *ltxt = *txt; - vector _vec = m_windowManager->getWindows(); - vector::iterator win_it = win_vec.begin(); + const vector _vec = m_windowManager->getWindows(); + vector::const_iterator win_it = win_vec.begin(); GHOST_WindowX11 *window = static_cast(*win_it); Window win = window->getXWindow(); @@ -2077,8 +2077,8 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const else sseln = m_atom.CLIPBOARD; - vector _vec = m_windowManager->getWindows(); - vector::iterator win_it = win_vec.begin(); + const vector _vec = m_windowManager->getWindows(); + vector::const_iterator win_it = win_vec.begin(); GHOST_WindowX11 *window = static_cast(*win_it); Window win = window->getXWindow(); @@ -2157,8 +2157,8 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const { Window m_window, owner; - vector _vec = m_windowManager->getWindows(); - vector::iterator win_it = win_vec.begin(); + const vector _vec = m_windowManager->getWindows(); + vector::const_iterator win_it = win_vec.begin(); GHOST_WindowX11 *window = static_cast(*win_it); m_window = window->getXWindow(); diff --git a/intern/ghost/intern/GHOST_WindowManager.cpp b/intern/ghost/intern/GHOST_WindowManager.cpp index 52a57edd4e9..d1d66c35de5 100644 --- a/intern/ghost/intern/GHOST_WindowManager.cpp +++ b/intern/ghost/intern/GHOST_WindowManager.cpp @@ -162,7 +162,7 @@ void GHOST_WindowManager::setWindowInactive(const GHOST_IWindow *window) } } -std::vector _WindowManager::getWindows() +const std::vector _WindowManager::getWindows() const { return m_windows; } diff --git a/intern/ghost/intern/GHOST_WindowManager.h b/intern/ghost/intern/GHOST_WindowManager.h index 025d84f1f3d..c32689e4043 100644 --- a/intern/ghost/intern/GHOST_WindowManager.h +++ b/intern/ghost/intern/GHOST_WindowManager.h @@ -115,11 +115,9 @@ class
[Bf-blender-cvs] [aa81a05de86] blender-v2.82-release: Cycles: bump version to 1.11, matching Blender 2.82 release cycle
Commit: aa81a05de8680befc87740658128511a8ade4b85 Author: Brecht Van Lommel Date: Fri Jan 31 15:46:30 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rBaa81a05de8680befc87740658128511a8ade4b85 Cycles: bump version to 1.11, matching Blender 2.82 release cycle === M intern/cycles/util/util_version.h === diff --git a/intern/cycles/util/util_version.h b/intern/cycles/util/util_version.h index 38829d3a29c..7489eed8aed 100644 --- a/intern/cycles/util/util_version.h +++ b/intern/cycles/util/util_version.h @@ -22,7 +22,7 @@ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 -#define CYCLES_VERSION_MINOR 9 +#define CYCLES_VERSION_MINOR 11 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4f8f0f3208b] blender-v2.82-release: Fix issues in Cycles standalone, particularly related to render display
Commit: 4f8f0f3208b51fd2c599917415dcfaa3cf424d5f Author: Brecht Van Lommel Date: Fri Jan 31 15:23:17 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rB4f8f0f3208b51fd2c599917415dcfaa3cf424d5f Fix issues in Cycles standalone, particularly related to render display Some code was removed to avoid storing the combined pass when viewport rendering other passes. But we can keep this by default, Blender overrides the list of passes entirely. === M intern/cycles/render/buffers.cpp M intern/cycles/render/film.cpp M intern/cycles/util/util_view.cpp === diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp index 50308d0d377..b08b6c84c1d 100644 --- a/intern/cycles/render/buffers.cpp +++ b/intern/cycles/render/buffers.cpp @@ -43,6 +43,8 @@ BufferParams::BufferParams() denoising_data_pass = false; denoising_clean_pass = false; denoising_prefiltered_pass = false; + + Pass::add(PASS_COMBINED, passes); } void BufferParams::get_offset_stride(int , int ) diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp index bd274844b52..4af0f3c45f0 100644 --- a/intern/cycles/render/film.cpp +++ b/intern/cycles/render/film.cpp @@ -324,9 +324,12 @@ NODE_DEFINE(Film) Film::Film() : Node(node_type) { + Pass::add(PASS_COMBINED, passes); + use_light_visibility = false; filter_table_offset = TABLE_OFFSET_INVALID; cryptomatte_passes = CRYPT_NONE; + display_pass = PASS_COMBINED; need_update = true; } diff --git a/intern/cycles/util/util_view.cpp b/intern/cycles/util/util_view.cpp index f23174fd6dc..9d9ff451b3b 100644 --- a/intern/cycles/util/util_view.cpp +++ b/intern/cycles/util/util_view.cpp @@ -134,7 +134,7 @@ static void view_display() glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluOrtho2D(0, V.width, 0, V.height); + glOrtho(0, V.width, 0, V.height, -1, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [48fe6f73cd0] temp-sybren-alembic: Cleanup: removed unused #include statements from Alembic code
Commit: 48fe6f73cd09a38268af44233e5519435b8b2525 Author: Sybren A. Stüvel Date: Fri Jan 31 15:04:22 2020 +0100 Branches: temp-sybren-alembic https://developer.blender.org/rB48fe6f73cd09a38268af44233e5519435b8b2525 Cleanup: removed unused #include statements from Alembic code No functional changes. === M source/blender/alembic/intern/abc_customdata.cc M source/blender/alembic/intern/abc_reader_archive.cc M source/blender/alembic/intern/abc_reader_camera.cc M source/blender/alembic/intern/abc_reader_curves.cc M source/blender/alembic/intern/abc_reader_mesh.cc M source/blender/alembic/intern/abc_reader_nurbs.cc M source/blender/alembic/intern/abc_reader_object.cc M source/blender/alembic/intern/abc_reader_points.cc M source/blender/alembic/intern/abc_reader_transform.cc M source/blender/alembic/intern/abc_util.cc M source/blender/alembic/intern/abc_writer_archive.cc M source/blender/alembic/intern/abc_writer_camera.cc M source/blender/alembic/intern/abc_writer_curves.cc M source/blender/alembic/intern/abc_writer_hair.cc M source/blender/alembic/intern/abc_writer_mball.cc M source/blender/alembic/intern/abc_writer_mesh.cc M source/blender/alembic/intern/abc_writer_nurbs.cc M source/blender/alembic/intern/abc_writer_object.cc M source/blender/alembic/intern/abc_writer_points.cc M source/blender/alembic/intern/abc_writer_transform.cc === diff --git a/source/blender/alembic/intern/abc_customdata.cc b/source/blender/alembic/intern/abc_customdata.cc index 7f04bb77052..c5f60ac3e29 100644 --- a/source/blender/alembic/intern/abc_customdata.cc +++ b/source/blender/alembic/intern/abc_customdata.cc @@ -32,6 +32,8 @@ extern "C" { #include "DNA_meshdata_types.h" #include "BLI_math_base.h" +#include "BLI_utildefines.h" + #include "BKE_customdata.h" } diff --git a/source/blender/alembic/intern/abc_reader_archive.cc b/source/blender/alembic/intern/abc_reader_archive.cc index 69c50c5e56d..6ad44553701 100644 --- a/source/blender/alembic/intern/abc_reader_archive.cc +++ b/source/blender/alembic/intern/abc_reader_archive.cc @@ -24,13 +24,10 @@ #include "abc_reader_archive.h" extern "C" { -#include "BKE_blender_version.h" #include "BKE_main.h" #include "BLI_path_util.h" #include "BLI_string.h" - -#include "DNA_scene_types.h" } #ifdef WIN32 diff --git a/source/blender/alembic/intern/abc_reader_camera.cc b/source/blender/alembic/intern/abc_reader_camera.cc index c5f752cdf9a..ab506f32cbe 100644 --- a/source/blender/alembic/intern/abc_reader_camera.cc +++ b/source/blender/alembic/intern/abc_reader_camera.cc @@ -19,7 +19,6 @@ */ #include "abc_reader_camera.h" - #include "abc_reader_transform.h" #include "abc_util.h" @@ -31,7 +30,6 @@ extern "C" { #include "BKE_object.h" #include "BLI_math.h" -#include "BLI_string.h" } using Alembic::AbcGeom::CameraSample; diff --git a/source/blender/alembic/intern/abc_reader_curves.cc b/source/blender/alembic/intern/abc_reader_curves.cc index 3a52a5a1d72..1be164c7c94 100644 --- a/source/blender/alembic/intern/abc_reader_curves.cc +++ b/source/blender/alembic/intern/abc_reader_curves.cc @@ -22,12 +22,11 @@ */ #include "abc_reader_curves.h" - -#include - #include "abc_reader_transform.h" #include "abc_util.h" +#include + #include "MEM_guardedalloc.h" extern "C" { @@ -39,8 +38,6 @@ extern "C" { #include "BKE_curve.h" #include "BKE_mesh.h" #include "BKE_object.h" - -#include "ED_curve.h" } using Alembic::Abc::FloatArraySamplePtr; diff --git a/source/blender/alembic/intern/abc_reader_mesh.cc b/source/blender/alembic/intern/abc_reader_mesh.cc index 3e002c91a98..bca1a32d3e3 100644 --- a/source/blender/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/alembic/intern/abc_reader_mesh.cc @@ -19,44 +19,26 @@ */ #include "abc_reader_mesh.h" - -#include - #include "abc_reader_transform.h" #include "abc_util.h" +#include + #include "MEM_guardedalloc.h" extern "C" { #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_fluidsim_types.h" #include "DNA_object_types.h" #include "BLI_math_geom.h" -#include "BLI_string.h" -#include "BKE_animsys.h" -#include "BKE_key.h" -#include "BKE_library.h" #include "BKE_main.h" #include "BKE_material.h" #include "BKE_mesh.h" -#include "BKE_mesh_runtime.h" #include "BKE_modifier.h" #include "BKE_object.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "ED_mesh.h" - -#include "bmesh.h" -#include "bmesh_tools.h" - -#include "DEG_depsgraph_query.h" } using Alembic::Abc::Int32ArraySamplePtr; diff --git a/source/blender/alembic/intern/abc_reader_nurbs.cc b/source/blender/alembic/intern/abc_reader_nurbs.cc index
[b79a9e2eaf9] temp-sybren-alembic: Same split-up for abc_archive.{cc,h} → abc_{reader,writer}_archive.{cc,h}
Commit: b79a9e2eaf94f0485d5120bd83d3f3bea5fb42e7 Author: Sybren A. Stüvel Date: Fri Jan 31 13:05:26 2020 +0100 Branches: temp-sybren-alembic https://developer.blender.org/rBb79a9e2eaf94f0485d5120bd83d3f3bea5fb42e7 Same split-up for abc_archive.{cc,h} → abc_{reader,writer}_archive.{cc,h} === M source/blender/alembic/CMakeLists.txt M source/blender/alembic/intern/abc_exporter.cc R062source/blender/alembic/intern/abc_archive.cc source/blender/alembic/intern/abc_reader_archive.cc R083source/blender/alembic/intern/abc_archive.h source/blender/alembic/intern/abc_reader_archive.h A source/blender/alembic/intern/abc_writer_archive.cc A source/blender/alembic/intern/abc_writer_archive.h M source/blender/alembic/intern/alembic_capi.cc === diff --git a/source/blender/alembic/CMakeLists.txt b/source/blender/alembic/CMakeLists.txt index 2909b2f1792..8bb7051982a 100644 --- a/source/blender/alembic/CMakeLists.txt +++ b/source/blender/alembic/CMakeLists.txt @@ -41,9 +41,9 @@ set(INC_SYS ) set(SRC - intern/abc_archive.cc intern/abc_customdata.cc intern/abc_exporter.cc + intern/abc_reader_archive.cc intern/abc_reader_camera.cc intern/abc_reader_curves.cc intern/abc_reader_mesh.cc @@ -52,6 +52,7 @@ set(SRC intern/abc_reader_points.cc intern/abc_reader_transform.cc intern/abc_util.cc + intern/abc_writer_archive.cc intern/abc_writer_camera.cc intern/abc_writer_curves.cc intern/abc_writer_hair.cc @@ -64,9 +65,9 @@ set(SRC intern/alembic_capi.cc ABC_alembic.h - intern/abc_archive.h intern/abc_customdata.h intern/abc_exporter.h + intern/abc_reader_archive.h intern/abc_reader_camera.h intern/abc_reader_curves.h intern/abc_reader_mesh.h @@ -75,6 +76,7 @@ set(SRC intern/abc_reader_points.h intern/abc_reader_transform.h intern/abc_util.h + intern/abc_writer_archive.h intern/abc_writer_camera.h intern/abc_writer_curves.h intern/abc_writer_hair.h diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc index 404124f702b..a2dd57868b5 100644 --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@ -22,7 +22,7 @@ #include -#include "abc_archive.h" +#include "abc_writer_archive.h" #include "abc_writer_camera.h" #include "abc_writer_curves.h" #include "abc_writer_hair.h" diff --git a/source/blender/alembic/intern/abc_archive.cc b/source/blender/alembic/intern/abc_reader_archive.cc similarity index 62% copy from source/blender/alembic/intern/abc_archive.cc copy to source/blender/alembic/intern/abc_reader_archive.cc index 15e7efad1c3..69c50c5e56d 100644 --- a/source/blender/alembic/intern/abc_archive.cc +++ b/source/blender/alembic/intern/abc_reader_archive.cc @@ -21,7 +21,8 @@ * \ingroup balembic */ -#include "abc_archive.h" +#include "abc_reader_archive.h" + extern "C" { #include "BKE_blender_version.h" #include "BKE_main.h" @@ -42,7 +43,6 @@ using Alembic::Abc::ErrorHandler; using Alembic::Abc::Exception; using Alembic::Abc::IArchive; using Alembic::Abc::kWrapExisting; -using Alembic::Abc::OArchive; static IArchive open_archive(const std::string , const std::vector _streams, @@ -141,77 +141,3 @@ Alembic::Abc::IObject ArchiveReader::getTop() { return m_archive.getTop(); } - -/* ** */ - -/* This kinda duplicates CreateArchiveWithInfo, but Alembic does not seem to - * have a version supporting streams. */ -static OArchive create_archive(std::ostream *ostream, - const std::string , - const std::string _name, - double scene_fps, - bool ogawa) -{ - Alembic::Abc::MetaData abc_metadata; - - abc_metadata.set(Alembic::Abc::kApplicationNameKey, "Blender"); - abc_metadata.set(Alembic::Abc::kUserDescriptionKey, scene_name); - abc_metadata.set("blender_version", versionstr); - abc_metadata.set("FramesPerTimeUnit", std::to_string(scene_fps)); - - time_t raw_time; - time(_time); - char buffer[128]; - -#if defined _WIN32 || defined _WIN64 - ctime_s(buffer, 128, _time); -#else - ctime_r(_time, buffer); -#endif - - const std::size_t buffer_len = strlen(buffer); - if (buffer_len > 0 && buffer[buffer_len - 1] == '\n') { -buffer[buffer_len - 1] = '\0'; - } - - abc_metadata.set(Alembic::Abc::kDateWrittenKey, buffer); - - ErrorHandler::Policy policy = ErrorHandler::kThrowPolicy; - -#ifdef WITH_ALEMBIC_HDF5 - if (!ogawa) { -return OArchive(Alembic::AbcCoreHDF5::WriteArchive(), filename, abc_metadata, policy); - } -#else - static_cast(filename); - static_cast(ogawa); -#endif - - Alembic::AbcCoreOgawa::WriteArchive
[Bf-blender-cvs] [6e48f98e436] temp-sybren-alembic: Cleanup: separated Alembic code into reader and writer files
Commit: 6e48f98e4360dccdf440823af5b55e9e175553fd Author: Sybren A. Stüvel Date: Fri Jan 31 12:47:23 2020 +0100 Branches: temp-sybren-alembic https://developer.blender.org/rB6e48f98e4360dccdf440823af5b55e9e175553fd Cleanup: separated Alembic code into reader and writer files This is in preparation of using the AbstractHierarchyIterator from the USD exporter. No functional changes. === M source/blender/alembic/CMakeLists.txt M source/blender/alembic/intern/abc_exporter.cc R062source/blender/alembic/intern/abc_camera.cc source/blender/alembic/intern/abc_reader_camera.cc A source/blender/alembic/intern/abc_reader_camera.h R066source/blender/alembic/intern/abc_curves.cc source/blender/alembic/intern/abc_reader_curves.cc R062source/blender/alembic/intern/abc_curves.h source/blender/alembic/intern/abc_reader_curves.h R063source/blender/alembic/intern/abc_mesh.cc source/blender/alembic/intern/abc_reader_mesh.cc R057source/blender/alembic/intern/abc_mesh.h source/blender/alembic/intern/abc_reader_mesh.h R058source/blender/alembic/intern/abc_nurbs.cc source/blender/alembic/intern/abc_reader_nurbs.cc R064source/blender/alembic/intern/abc_nurbs.h source/blender/alembic/intern/abc_reader_nurbs.h R083source/blender/alembic/intern/abc_object.cc source/blender/alembic/intern/abc_reader_object.cc R080source/blender/alembic/intern/abc_object.h source/blender/alembic/intern/abc_reader_object.h R065source/blender/alembic/intern/abc_points.cc source/blender/alembic/intern/abc_reader_points.cc R072source/blender/alembic/intern/abc_points.h source/blender/alembic/intern/abc_reader_points.h A source/blender/alembic/intern/abc_reader_transform.cc A source/blender/alembic/intern/abc_reader_transform.h M source/blender/alembic/intern/abc_util.cc A source/blender/alembic/intern/abc_writer_camera.cc R067source/blender/alembic/intern/abc_camera.h source/blender/alembic/intern/abc_writer_camera.h A source/blender/alembic/intern/abc_writer_curves.cc A source/blender/alembic/intern/abc_writer_curves.h R099source/blender/alembic/intern/abc_hair.cc source/blender/alembic/intern/abc_writer_hair.cc R091source/blender/alembic/intern/abc_hair.h source/blender/alembic/intern/abc_writer_hair.h R096source/blender/alembic/intern/abc_mball.cc source/blender/alembic/intern/abc_writer_mball.cc R091source/blender/alembic/intern/abc_mball.h source/blender/alembic/intern/abc_writer_mball.h A source/blender/alembic/intern/abc_writer_mesh.cc A source/blender/alembic/intern/abc_writer_mesh.h A source/blender/alembic/intern/abc_writer_nurbs.cc A source/blender/alembic/intern/abc_writer_nurbs.h A source/blender/alembic/intern/abc_writer_object.cc A source/blender/alembic/intern/abc_writer_object.h A source/blender/alembic/intern/abc_writer_points.cc A source/blender/alembic/intern/abc_writer_points.h R072source/blender/alembic/intern/abc_transform.cc source/blender/alembic/intern/abc_writer_transform.cc R067source/blender/alembic/intern/abc_transform.h source/blender/alembic/intern/abc_writer_transform.h M source/blender/alembic/intern/alembic_capi.cc === diff --git a/source/blender/alembic/CMakeLists.txt b/source/blender/alembic/CMakeLists.txt index 4618246013a..2909b2f1792 100644 --- a/source/blender/alembic/CMakeLists.txt +++ b/source/blender/alembic/CMakeLists.txt @@ -42,34 +42,48 @@ set(INC_SYS set(SRC intern/abc_archive.cc - intern/abc_camera.cc - intern/abc_curves.cc intern/abc_customdata.cc intern/abc_exporter.cc - intern/abc_hair.cc - intern/abc_mball.cc - intern/abc_mesh.cc - intern/abc_nurbs.cc - intern/abc_object.cc - intern/abc_points.cc - intern/abc_transform.cc + intern/abc_reader_camera.cc + intern/abc_reader_curves.cc + intern/abc_reader_mesh.cc + intern/abc_reader_nurbs.cc + intern/abc_reader_object.cc + intern/abc_reader_points.cc + intern/abc_reader_transform.cc intern/abc_util.cc + intern/abc_writer_camera.cc + intern/abc_writer_curves.cc + intern/abc_writer_hair.cc + intern/abc_writer_mball.cc + intern/abc_writer_mesh.cc + intern/abc_writer_nurbs.cc + intern/abc_writer_object.cc + intern/abc_writer_points.cc + intern/abc_writer_transform.cc intern/alembic_capi.cc ABC_alembic.h intern/abc_archive.h - intern/abc_camera.h - intern/abc_curves.h intern/abc_customdata.h intern/abc_exporter.h - intern/abc_hair.h - intern/abc_mball.h - intern/abc_mesh.h - intern/abc_nurbs.h - intern/abc_object.h - intern/abc_points.h - intern/abc_transform.h + intern/abc_reader_camera.h + intern/abc_reader_curves.h + intern/abc_reader_mesh.h + intern/abc_reader_nurbs.h +
[Bf-blender-cvs] [952feb64049] undo-experiments-swap-reread-datablocks: Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks
Commit: 952feb64049e323433b3f26ddf2d96e87405df80 Author: Bastien Montagne Date: Fri Jan 31 14:48:05 2020 +0100 Branches: undo-experiments-swap-reread-datablocks https://developer.blender.org/rB952feb64049e323433b3f26ddf2d96e87405df80 Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8c9243dbdd3] undo-experiments-swap-reread-datablocks: undoexp: cleanup typo.
Commit: 8c9243dbdd3dce26f36bdd63b0603936bb951915 Author: Bastien Montagne Date: Fri Jan 31 12:09:42 2020 +0100 Branches: undo-experiments-swap-reread-datablocks https://developer.blender.org/rB8c9243dbdd3dce26f36bdd63b0603936bb951915 undoexp: cleanup typo. === M source/blender/blenloader/intern/readfile.c === diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 07f65c112fa..04d4416ad40 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10186,7 +10186,7 @@ static void blo_undo_merge_and_fix_collisions_in_libmaps(FileData *fd) const void *old_new_oldpointers[2] = {orig_oldp, oldp}; FOREACH_MAIN_ID_BEGIN (bmain, id) { if (id->tag & LIB_TAG_UNDO_OLD_ID_REUSED) { - /* We only want to update values of odl pointers in data read from memfile, not the one + /* We only want to update values of old pointers in data read from memfile, not the one * re-used from the old bmain. */ continue; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b55f656e73e] undo-experiments: Merge branch 'master' into undo-experiments
Commit: b55f656e73ec42ca2602f6c9d112d4aeb37b0310 Author: Bastien Montagne Date: Fri Jan 31 14:47:08 2020 +0100 Branches: undo-experiments https://developer.blender.org/rBb55f656e73ec42ca2602f6c9d112d4aeb37b0310 Merge branch 'master' into undo-experiments === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e0dcb60e502] undo-experiments-swap-reread-datablocks: Merge branch 'master' into undo-experiments-swap-reread-datablocks
Commit: e0dcb60e502fec14749d822882a95d78a1ad1a5e Author: Bastien Montagne Date: Fri Jan 31 14:47:45 2020 +0100 Branches: undo-experiments-swap-reread-datablocks https://developer.blender.org/rBe0dcb60e502fec14749d822882a95d78a1ad1a5e Merge branch 'master' into undo-experiments-swap-reread-datablocks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a9e20e2f4d3] undo-experiments-swap-reread-datablocks: Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks
Commit: a9e20e2f4d33b64c4108a1d1fa8f6a1037f3b8f5 Author: Bastien Montagne Date: Fri Jan 31 14:46:35 2020 +0100 Branches: undo-experiments-swap-reread-datablocks https://developer.blender.org/rBa9e20e2f4d33b64c4108a1d1fa8f6a1037f3b8f5 Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7ee4b9ca0eb] undo-experiments: undoexp: Fix issue with usual infamous pose's bone pointers.
Commit: 7ee4b9ca0eb5670e9f09969f7fd3ffdf2729b596 Author: Bastien Montagne Date: Fri Jan 31 14:45:34 2020 +0100 Branches: undo-experiments https://developer.blender.org/rB7ee4b9ca0eb5670e9f09969f7fd3ffdf2729b596 undoexp: Fix issue with usual infamous pose's bone pointers. === M source/blender/editors/undo/memfile_undo.c === diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c index b4e1bdb3626..d50aa549dfc 100644 --- a/source/blender/editors/undo/memfile_undo.c +++ b/source/blender/editors/undo/memfile_undo.c @@ -26,6 +26,7 @@ #include "BLI_ghash.h" #include "DNA_object_enums.h" +#include "DNA_object_types.h" #include "BKE_blender_undo.h" #include "BKE_context.h" @@ -110,10 +111,29 @@ static int memfile_undosys_step_id_reused_cb(void *user_data, ID *id = *id_pointer; if (id != NULL && id->lib == NULL && (id->tag & LIB_TAG_UNDO_OLD_ID_REUSED) == 0) { +bool do_stop_iter = true; +if (GS(id_self->name) == ID_OB) { + Object *ob_self = (Object *)id_self; + if (ob_self->type == OB_ARMATURE) { +if (ob_self->data == id) { + BLI_assert(GS(id->name) == ID_AR); + if (ob_self->pose != NULL) { +/* We have a changed/re-read armature used by an unchanged armature object: our beloved + * Bone pointers from the object's pose need their usual special treatment. */ +ob_self->pose->flag |= POSE_RECALC; + } +} +else { + /* Cannot stop iteration until we checked ob_self->data pointer... */ + do_stop_iter = false; +} + } +} + /* In case an old, re-used ID is using a newly read data-block (i.e. one of its ID pointers got * updated), we have to tell the depsgraph about it. */ DEG_id_tag_update_ex(bmain, id_self, ID_RECALC_COPY_ON_WRITE); -return IDWALK_RET_STOP_ITER; +return do_stop_iter ? IDWALK_RET_STOP_ITER : IDWALK_RET_NOP; } return IDWALK_RET_NOP; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8c57402a666] undo-experiments: undoexp: cleanup typo.
Commit: 8c57402a666a0edac625f680ca1953150c476f20 Author: Bastien Montagne Date: Fri Jan 31 12:09:42 2020 +0100 Branches: undo-experiments https://developer.blender.org/rB8c57402a666a0edac625f680ca1953150c476f20 undoexp: cleanup typo. === M source/blender/blenloader/intern/readfile.c === diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5a5347eb1e1..21c9d422e9c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10130,7 +10130,7 @@ static void blo_undo_merge_and_fix_collisions_in_libmaps(FileData *fd) const void *old_new_oldpointers[2] = {orig_oldp, oldp}; FOREACH_MAIN_ID_BEGIN (bmain, id) { if (id->tag & LIB_TAG_UNDO_OLD_ID_REUSED) { - /* We only want to update values of odl pointers in data read from memfile, not the one + /* We only want to update values of old pointers in data read from memfile, not the one * re-used from the old bmain. */ continue; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [eea3751c5bb] master: UI: Icons update
Commit: eea3751c5bb2aef421cb7117add0f860da06d7af Author: William Reynish Date: Fri Jan 31 13:06:36 2020 +0100 Branches: master https://developer.blender.org/rBeea3751c5bb2aef421cb7117add0f860da06d7af UI: Icons update - New bespoke icon for the universal brush toggles - New icon for Redirected Folder (currently unused) - New icons for handle types (Auto Clamped, Auto, Aligned, Vector, Free) - New icons for Sequencer Text Strip anchor (Top, Bottom, Left, Right, Centre) Thanks to Andrzej Ambroż for the new icons === M release/datafiles/blender_icons.svg A release/datafiles/blender_icons16/icon16_anchor_bottom.dat A release/datafiles/blender_icons16/icon16_anchor_center.dat A release/datafiles/blender_icons16/icon16_anchor_left.dat A release/datafiles/blender_icons16/icon16_anchor_right.dat A release/datafiles/blender_icons16/icon16_anchor_top.dat A release/datafiles/blender_icons16/icon16_brushes_all.dat A release/datafiles/blender_icons16/icon16_folder_redirect.dat A release/datafiles/blender_icons16/icon16_handle_aligned.dat A release/datafiles/blender_icons16/icon16_handle_auto.dat A release/datafiles/blender_icons16/icon16_handle_autoclamped.dat A release/datafiles/blender_icons16/icon16_handle_free.dat A release/datafiles/blender_icons16/icon16_handle_vector.dat A release/datafiles/blender_icons32/icon32_anchor_bottom.dat A release/datafiles/blender_icons32/icon32_anchor_center.dat A release/datafiles/blender_icons32/icon32_anchor_left.dat A release/datafiles/blender_icons32/icon32_anchor_right.dat A release/datafiles/blender_icons32/icon32_anchor_top.dat A release/datafiles/blender_icons32/icon32_brushes_all.dat A release/datafiles/blender_icons32/icon32_folder_redirect.dat A release/datafiles/blender_icons32/icon32_handle_aligned.dat A release/datafiles/blender_icons32/icon32_handle_auto.dat A release/datafiles/blender_icons32/icon32_handle_autoclamped.dat A release/datafiles/blender_icons32/icon32_handle_free.dat A release/datafiles/blender_icons32/icon32_handle_vector.dat M release/scripts/startup/bl_ui/properties_paint_common.py M source/blender/editors/include/UI_icons.h M source/blender/makesrna/intern/rna_curve.c M source/blender/makesrna/intern/rna_sequencer.c === diff --git a/release/datafiles/blender_icons.svg b/release/datafiles/blender_icons.svg index 6a87ac0adaa..ebebc82695a 100644 --- a/release/datafiles/blender_icons.svg +++ b/release/datafiles/blender_icons.svg @@ -1048,6 +1048,9 @@ + + + @@ -1062,6 +1065,9 @@ + + + @@ -1321,6 +1327,14 @@ + + + + + + + + @@ -3732,6 +3746,14 @@ + +https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3601924acb3] blender-v2.82-release: Fluid: More stable flow emission
Commit: 3601924acb3201a2e8672cf7825a7831c4f0a324 Author: Sebastián Barschkis Date: Fri Jan 31 12:41:52 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rB3601924acb3201a2e8672cf7825a7831c4f0a324 Fluid: More stable flow emission Reverting some changes that were made in 33317b464777 === M intern/mantaflow/intern/strings/liquid_script.h M intern/mantaflow/intern/strings/smoke_script.h M source/blender/blenkernel/intern/fluid.c === diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h index bb42b781c19..442b09b5a8a 100644 --- a/intern/mantaflow/intern/strings/liquid_script.h +++ b/intern/mantaflow/intern/strings/liquid_script.h @@ -139,7 +139,7 @@ waveCrest_sp$ID$ = sp$ID$.create(RealGrid)\n\ kineticEnergy_sp$ID$ = sp$ID$.create(RealGrid)\n\ \n\ # Keep track of important objects in dict to load them later on\n\ -liquid_particles_dict_final_s$ID$ = dict(ppSnd=ppSnd_sp$ID$, pVelSnd=pVelSnd_pp$ID$, pLifeSnd=pLifeSnd_pp$ID$)\n\ +liquid_particles_dict_final_s$ID$ = dict(ppSnd=ppSnd_sp$ID$, pVelSnd=pVelSnd_pp$ID$, pLifeSnd=pLifeSnd_pp$ID$)\n\ liquid_particles_dict_resume_s$ID$ = dict(trappedAir=trappedAir_sp$ID$, waveCrest=waveCrest_sp$ID$, kineticEnergy=kineticEnergy_sp$ID$)\n"; const std::string liquid_init_phi = @@ -166,15 +166,18 @@ def liquid_adaptive_step_$ID$(framenr):\n\ mantaMsg('Initializing obstacle levelset')\n\ phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\ extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ -extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=int(res_s$ID$/2), inside=False)\n\ +extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=3, inside=False)\n\ phiObs_s$ID$.join(phiObsIn_s$ID$)\n\ \n\ # Using boundaryWidth=2 to not search beginning from walls (just a performance optimization)\n\ # Additional sanity check: fill holes in phiObs which can result after joining with phiObsIn\n\ phiObs_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\ extrapolateLsSimple(phi=phiObs_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ -extrapolateLsSimple(phi=phiObs_s$ID$, distance=int(res_s$ID$/2), inside=False)\n\ +extrapolateLsSimple(phi=phiObs_s$ID$, distance=3, inside=False)\n\ \n\ +mantaMsg('Initializing fluid levelset')\n\ +extrapolateLsSimple(phi=phiIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ +extrapolateLsSimple(phi=phiIn_s$ID$, distance=int(res_s$ID$/2), inside=False)\n\ phi_s$ID$.join(phiIn_s$ID$)\n\ \n\ if using_obstacle_s$ID$:\n\ diff --git a/intern/mantaflow/intern/strings/smoke_script.h b/intern/mantaflow/intern/strings/smoke_script.h index ad966503fd1..b4f7a39adeb 100644 --- a/intern/mantaflow/intern/strings/smoke_script.h +++ b/intern/mantaflow/intern/strings/smoke_script.h @@ -279,14 +279,18 @@ def smoke_adaptive_step_$ID$(framenr):\n\ mantaMsg('Initializing obstacle levelset')\n\ phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\ extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ -extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=int(res_s$ID$/2), inside=False)\n\ +extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=3, inside=False)\n\ phiObs_s$ID$.join(phiObsIn_s$ID$)\n\ \n\ # Using boundaryWidth=2 to not search beginning from walls (just a performance optimization)\n\ # Additional sanity check: fill holes in phiObs which can result after joining with phiObsIn\n\ phiObs_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\ extrapolateLsSimple(phi=phiObs_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ -extrapolateLsSimple(phi=phiObs_s$ID$, distance=int(res_s$ID$/2), inside=False)\n\ +extrapolateLsSimple(phi=phiObs_s$ID$, distance=3, inside=False)\n\ +\n\ +mantaMsg('Initializing fluid levelset')\n\ +extrapolateLsSimple(phi=phiIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ +extrapolateLsSimple(phi=phiIn_s$ID$, distance=3, inside=False)\n\ \n\ if using_outflow_s$ID$:\n\ phiOut_s$ID$.join(phiOutIn_s$ID$)\n\ diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index b8d7429fa94..f19137bf796 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1452,7 +1452,7 @@ static void update_mesh_distances(int index, return; } - /* b) Volumetric initialization: 1) Ray-casts around mesh object. */ + /* b) Volumetric initialization: Ray-casts around mesh object. */ /* Ray-casts in 26 directions. * (6 main axis +
[Bf-blender-cvs] [a663ece5a30] blender-v2.82-release: Fluid: Better default values and cleanup
Commit: a663ece5a3065a745947647c7f68221e496fccf7 Author: Sebastián Barschkis Date: Fri Jan 31 11:40:49 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rBa663ece5a3065a745947647c7f68221e496fccf7 Fluid: Better default values and cleanup Use OpenVDB by default, smaller particle radius to avoid volume increase, and shorter names for combined fluid particle systems. === M source/blender/blenkernel/intern/fluid.c M source/blender/makesrna/intern/rna_fluid.c === diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 12c65027e25..b8d7429fa94 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -4012,7 +4012,7 @@ void BKE_fluid_particle_system_create(struct Main *bmain, part->type = psys_type; part->totpart = 0; - part->draw_size = 0.01f; // make fluid particles more subtle in viewport + part->draw_size = 0.01f; /* Make fluid particles more subtle in viewport. */ part->draw_col = PART_DRAW_COL_VEL; psys->part = part; psys->pointcache = BKE_ptcache_add(>ptcaches); @@ -4386,7 +4386,7 @@ void BKE_fluid_modifier_create_type_data(struct FluidModifierData *mmd) mmd->domain->particle_number = 2; mmd->domain->particle_minimum = 8; mmd->domain->particle_maximum = 16; -mmd->domain->particle_radius = 1.5f; +mmd->domain->particle_radius = 1.0f; mmd->domain->particle_band_width = 3.0f; mmd->domain->fractions_threshold = 0.05f; @@ -4445,9 +4445,9 @@ void BKE_fluid_modifier_create_type_data(struct FluidModifierData *mmd) mmd->domain->cache_flag = 0; mmd->domain->cache_type = FLUID_DOMAIN_CACHE_MODULAR; mmd->domain->cache_mesh_format = FLUID_DOMAIN_FILE_BIN_OBJECT; -mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_UNI; -mmd->domain->cache_particle_format = FLUID_DOMAIN_FILE_UNI; -mmd->domain->cache_noise_format = FLUID_DOMAIN_FILE_UNI; +mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_OPENVDB; +mmd->domain->cache_particle_format = FLUID_DOMAIN_FILE_OPENVDB; +mmd->domain->cache_noise_format = FLUID_DOMAIN_FILE_OPENVDB; modifier_path_init(mmd->domain->cache_directory, sizeof(mmd->domain->cache_directory), FLUID_DOMAIN_DIR_DEFAULT); diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index 3c29f8ec8c0..01f240e715b 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -246,7 +246,7 @@ static void rna_Fluid_tracer_parts_update(Main *bmain, Scene *UNUSED(scene), Poi rna_Fluid_parts_create(bmain, ptr, "TracerParticleSettings", - "Tracer Particles", + "Tracers", "Tracer Particle System", PART_FLUID_TRACER); mmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_TRACER; @@ -290,7 +290,7 @@ static void rna_Fluid_combined_export_update(Main *bmain, Scene *scene, PointerR rna_Fluid_parts_create(bmain, ptr, "SprayFoamParticleSettings", - "Spray + Foam Particles", + "Spray + Foam", "Spray + Foam Particle System", PART_FLUID_SPRAYFOAM); @@ -316,7 +316,7 @@ static void rna_Fluid_combined_export_update(Main *bmain, Scene *scene, PointerR rna_Fluid_parts_create(bmain, ptr, "SprayBubbleParticleSettings", - "Spray + Bubble Particles", + "Spray + Bubbles", "Spray + Bubble Particle System", PART_FLUID_SPRAYBUBBLE); @@ -369,7 +369,7 @@ static void rna_Fluid_combined_export_update(Main *bmain, Scene *scene, PointerR rna_Fluid_parts_create(bmain, ptr, "SprayFoamBubbleParticleSettings", - "Spray + Foam + Bubble Particles", + "Spray + Foam + Bubbles", "Spray + Foam + Bubble Particle System", PART_FLUID_SPRAYFOAMBUBBLE); @@ -1522,10 +1522,10 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "particle_radius", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); - RNA_def_property_ui_text( - prop, - "Radius", - "Particle radius factor. Adjust this parameter when the simulation appears to leak volume"); + RNA_def_property_ui_text(prop, +
[Bf-blender-cvs] [9b308f27ad8] blender-v2.82-release: Fluid: Fixed deletion issue with secondary fluid particle systems
Commit: 9b308f27ad8d2eae6d37df65f22ae74bbdb2792b Author: Sebastián Barschkis Date: Fri Jan 31 11:35:47 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rB9b308f27ad8d2eae6d37df65f22ae74bbdb2792b Fluid: Fixed deletion issue with secondary fluid particle systems Manually deleting fluid particle systems had no effect in the fluid domain UI. === M source/blender/blenkernel/intern/particle.c === diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 6b87cf2df81..97fcef4fd27 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3586,14 +3586,47 @@ void object_remove_particle_system(Main *bmain, Scene *UNUSED(scene), Object *ob return; } - /* clear all other appearances of this pointer (like on manta flow modifier) */ + /* Clear particle system in fluid modifier. */ if ((md = modifiers_findByType(ob, eModifierType_Fluid))) { FluidModifierData *mmd = (FluidModifierData *)md; + +/* Clear particle system pointer in flow settings. */ if ((mmd->type == MOD_FLUID_TYPE_FLOW) && mmd->flow && mmd->flow->psys) { if (mmd->flow->psys == psys) { mmd->flow->psys = NULL; } } +/* Clear particle flag in domain settings when removing particle system manually. */ +if (mmd->type == MOD_FLUID_TYPE_DOMAIN) { + if (psys->part->type == PART_FLUID_FLIP) { +mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FLIP; + } + if (psys->part->type == PART_FLUID_SPRAY || psys->part->type == PART_FLUID_SPRAYFOAM || + psys->part->type == PART_FLUID_SPRAYBUBBLE || + psys->part->type == PART_FLUID_SPRAYFOAMBUBBLE) { +mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_SPRAY; + } + if (psys->part->type == PART_FLUID_FOAM || psys->part->type == PART_FLUID_SPRAYFOAM || + psys->part->type == PART_FLUID_FOAMBUBBLE || + psys->part->type == PART_FLUID_SPRAYFOAMBUBBLE) { +mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FOAM; + } + if (psys->part->type == PART_FLUID_BUBBLE || psys->part->type == PART_FLUID_FOAMBUBBLE || + psys->part->type == PART_FLUID_SPRAYBUBBLE || + psys->part->type == PART_FLUID_SPRAYFOAMBUBBLE) { +mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_BUBBLE; + } + if (psys->part->type == PART_FLUID_TRACER) { +mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_TRACER; + } + + /* Disable combined export if combined particle system was deleted. */ + if (psys->part->type == PART_FLUID_SPRAYFOAM || psys->part->type == PART_FLUID_SPRAYBUBBLE || + psys->part->type == PART_FLUID_FOAMBUBBLE || + psys->part->type == PART_FLUID_SPRAYFOAMBUBBLE) { +mmd->domain->sndparticle_combined_export = SNDPARTICLE_COMBINED_EXPORT_OFF; + } +} } if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [385b34b9b83] blender-v2.82-release: Fluid: Fixed secondary particle warnings
Commit: 385b34b9b83f7699b023ae1ec0b7fcdbd2d98799 Author: Sebastián Barschkis Date: Fri Jan 31 11:30:29 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rB385b34b9b83f7699b023ae1ec0b7fcdbd2d98799 Fluid: Fixed secondary particle warnings This commit fixes the warning that bpy_rna.c470 was producing. === M source/blender/makesrna/intern/rna_particle.c === diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 536691b074d..431f2c71e3f 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -120,6 +120,29 @@ static const EnumPropertyItem part_hair_ren_as_items[] = { }; #endif +static const EnumPropertyItem part_type_items[] = { +{PART_EMITTER, "EMITTER", 0, "Emitter", ""}, +/*{PART_REACTOR, "REACTOR", 0, "Reactor", ""}, */ +{PART_HAIR, "HAIR", 0, "Hair", ""}, +{0, NULL, 0, NULL, NULL}, +}; + +#ifdef RNA_RUNTIME +static const EnumPropertyItem part_fluid_type_items[] = { +{PART_FLUID, "FLUID", 0, "Fluid", ""}, +{PART_FLUID_FLIP, "FLIP", 0, "Liquid", ""}, +{PART_FLUID_SPRAY, "SPRAY", 0, "Spray", ""}, +{PART_FLUID_BUBBLE, "BUBBLE", 0, "Bubble", ""}, +{PART_FLUID_FOAM, "FOAM", 0, "Foam", ""}, +{PART_FLUID_TRACER, "TRACER", 0, "Tracer", ""}, +{PART_FLUID_SPRAYFOAM, "SPRAYFOAM", 0, "Spray-Foam", ""}, +{PART_FLUID_SPRAYBUBBLE, "SPRAYBUBBLE", 0, "Spray-Bubble", ""}, +{PART_FLUID_FOAMBUBBLE, "FOAMBUBBLE", 0, "Foam-Bubble", ""}, +{PART_FLUID_SPRAYFOAMBUBBLE, "SPRAYFOAMBUBBLE", 0, "Spray-Foam-Bubble", ""}, +{0, NULL, 0, NULL, NULL}, +}; +#endif + #ifdef RNA_RUNTIME # include "BLI_math.h" @@ -1239,6 +1262,21 @@ static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr) return strlen(tstr); } +static const EnumPropertyItem *rna_Particle_type_itemf(bContext *UNUSED(C), + PointerRNA *ptr, + PropertyRNA *UNUSED(prop), + bool *UNUSED(r_free)) +{ + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; + + if (part->type == PART_HAIR || part->type == PART_EMITTER) { +return part_type_items; + } + else { +return part_fluid_type_items; + } +} + static const EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), @@ -2260,13 +2298,6 @@ static void rna_def_particle_settings(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static const EnumPropertyItem type_items[] = { - {PART_EMITTER, "EMITTER", 0, "Emitter", ""}, - /*{PART_REACTOR, "REACTOR", 0, "Reactor", ""}, */ - {PART_HAIR, "HAIR", 0, "Hair", ""}, - {0, NULL, 0, NULL, NULL}, - }; - static const EnumPropertyItem phys_type_items[] = { {PART_PHYS_NO, "NO", 0, "None", ""}, {PART_PHYS_NEWTON, "NEWTON", 0, "Newtonian", ""}, @@ -2493,8 +2524,9 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, type_items); + RNA_def_property_enum_items(prop, part_type_items); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_type_itemf"); RNA_def_property_ui_text(prop, "Type", "Particle Type"); RNA_def_property_update(prop, 0, "rna_Particle_change_type"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [53d805abcbf] master: Merge branch 'blender-v2.82-release'
Commit: 53d805abcbf0a68155025a186d8a3c60de4af374 Author: Brecht Van Lommel Date: Fri Jan 31 13:03:15 2020 +0100 Branches: master https://developer.blender.org/rB53d805abcbf0a68155025a186d8a3c60de4af374 Merge branch 'blender-v2.82-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6ab359e5252] master: Fix potential crash in guarded alloc stats, when there are no allocations
Commit: 6ab359e525204e476cfa9c772e80d37d3d2c5014 Author: James Fulop Date: Fri Jan 31 12:58:16 2020 +0100 Branches: master https://developer.blender.org/rB6ab359e525204e476cfa9c772e80d37d3d2c5014 Fix potential crash in guarded alloc stats, when there are no allocations This was found with static analysis warnings in Visual Studio 2019. Differential Revision: https://developer.blender.org/D6564 === M intern/guardedalloc/intern/mallocn_guarded_impl.c === diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c index ef74f394fb1..de2b2eee93a 100644 --- a/intern/guardedalloc/intern/mallocn_guarded_impl.c +++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c @@ -735,8 +735,19 @@ void MEM_guarded_printmemlist_stats(void) mem_lock_thread(); - /* put memory blocks into array */ - printblock = malloc(sizeof(MemPrintBlock) * totblock); + if (totblock != 0) { +/* put memory blocks into array */ +printblock = malloc(sizeof(MemPrintBlock) * totblock); + +if (UNLIKELY(!printblock)) { + mem_unlock_thread(); + print_error("malloc returned null while generating stats"); + return; +} + } + else { +printblock = NULL; + } pb = printblock; totpb = 0; @@ -745,7 +756,7 @@ void MEM_guarded_printmemlist_stats(void) if (membl) membl = MEMNEXT(membl); - while (membl) { + while (membl && pb) { pb->name = membl->name; pb->len = membl->len; pb->items = 1; @@ -767,7 +778,10 @@ void MEM_guarded_printmemlist_stats(void) } /* sort by name and add together blocks with the same name */ - qsort(printblock, totpb, sizeof(MemPrintBlock), compare_name); + if (totpb > 1) { +qsort(printblock, totpb, sizeof(MemPrintBlock), compare_name); + } + for (a = 0, b = 0; a < totpb; a++) { if (a == b) { continue; @@ -784,7 +798,10 @@ void MEM_guarded_printmemlist_stats(void) totpb = b + 1; /* sort by length and print */ - qsort(printblock, totpb, sizeof(MemPrintBlock), compare_len); + if (totpb > 1) { +qsort(printblock, totpb, sizeof(MemPrintBlock), compare_len); + } + printf("\ntotal memory len: %.3f MB\n", (double)mem_in_use / (double)(1024 * 1024)); printf("peak memory len: %.3f MB\n", (double)peak_mem / (double)(1024 * 1024)); printf("slop memory len: %.3f MB\n", (double)mem_in_use_slop / (double)(1024 * 1024)); @@ -796,7 +813,10 @@ void MEM_guarded_printmemlist_stats(void) (double)pb->len / 1024.0 / (double)pb->items, pb->name); } - free(printblock); + + if (printblock != NULL) { +free(printblock); + } mem_unlock_thread(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c82b8c5944d] blender-v2.82-release: Fix tests failing on AMD Ryzen, due TBB initialization order issue
Commit: c82b8c5944d85a24fcb1b6552e970accb4628c9d Author: Brecht Van Lommel Date: Fri Jan 31 12:51:35 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rBc82b8c5944d85a24fcb1b6552e970accb4628c9d Fix tests failing on AMD Ryzen, due TBB initialization order issue Similar fix as the one we did for the blender executable, see T72015. === M build_files/cmake/Modules/GTestTesting.cmake M source/creator/CMakeLists.txt === diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake index 30b10ae5980..c9f62906ae0 100644 --- a/build_files/cmake/Modules/GTestTesting.cmake +++ b/build_files/cmake/Modules/GTestTesting.cmake @@ -40,9 +40,14 @@ macro(BLENDER_SRC_GTEST_EX) add_executable(${TARGET_NAME} ${ARG_SRC} ${MANIFEST}) target_include_directories(${TARGET_NAME} PUBLIC "${TEST_INC}") target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${TEST_INC_SYS}") +target_link_libraries(${TARGET_NAME} ${ARG_EXTRA_LIBS} ${PLATFORM_LINKLIBS}) +if(WITH_TBB) + # Force TBB libraries to be in front of MKL (part of OpenImageDenoise), so + # that it is initialized before MKL and static library initialization order + # issues are avoided. + target_link_libraries(${TARGET_NAME} ${TBB_LIBRARIES}) +endif() target_link_libraries(${TARGET_NAME} - ${ARG_EXTRA_LIBS} - ${PLATFORM_LINKLIBS} bf_testing_main bf_intern_eigen bf_intern_guardedalloc diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 82c45b4fe64..690c332c20e 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -38,20 +38,16 @@ blender_include_dirs( ) set(LIB - # This forces TBB libraries to be in front of MKL (which is a part of OpenImageDenoise). - # - # The need of this comes to need to ensure static libraries initialization order, making it - # so TBB is initialized prior to MKL (or any other dpeendnecy). - # - # This isn't fully robust but seems to work. - ${TBB_LIBRARIES} - bf_windowmanager ) -# Note: this should not be needed, but causes issues in some situations: -# See reply to daf290dcc80c. -if(WITH_TBB AND WITH_OPENIMAGEDENOISE) +if(WITH_TBB) + # Force TBB libraries to be in front of MKL (part of OpenImageDenoise), so + # that it is initialized before MKL and static library initialization order + # issues are avoided. + # + # This isn't fully robust but seems to work. + list(INSERT LIB 0 ${TBB_LIBRARIES}) list(INSERT LIB 0 bf_blenkernel) endif() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a075f45526e] blender-v2.82-release: Fix more undefined behavior in tangent space computation
Commit: a075f45526eccb218314368859ac4ce9138bd0be Author: Brecht Van Lommel Date: Wed Jan 29 15:06:25 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rBa075f45526eccb218314368859ac4ce9138bd0be Fix more undefined behavior in tangent space computation Ref D6677 === M intern/mikktspace/mikktspace.c === diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index 285529298eb..47bed53ed28 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -1392,7 +1392,7 @@ static void QuickSort(int *pSortBuffer, int iLeft, int iRight, unsigned int uSee // Random unsigned int t = uSeed & 31; - t = (uSeed << t) | (uSeed >> (32 - t)); + t = rotl(uSeed, t); uSeed = uSeed + t + 3; // Random end ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [500d7545f07] new-object-types: Volumes: use full transform matrix for workbench drawing
Commit: 500d7545f074bed19b116720029e8590d0f4e77c Author: Brecht Van Lommel Date: Fri Jan 31 11:19:36 2020 +0100 Branches: new-object-types https://developer.blender.org/rB500d7545f074bed19b116720029e8590d0f4e77c Volumes: use full transform matrix for workbench drawing === M source/blender/draw/engines/workbench/workbench_volume.c M source/blender/draw/intern/draw_cache.h M source/blender/draw/intern/draw_cache_impl_volume.c === diff --git a/source/blender/draw/engines/workbench/workbench_volume.c b/source/blender/draw/engines/workbench/workbench_volume.c index 9d0d40a1675..ea8a0a82479 100644 --- a/source/blender/draw/engines/workbench/workbench_volume.c +++ b/source/blender/draw/engines/workbench/workbench_volume.c @@ -256,12 +256,14 @@ static void workbench_volume_object_cache_populate(WORKBENCH_Data *vedata, Objec /* Create shader. */ GPUShader *sh = volume_shader_get(use_slice, false, cubic_interp); + /* Combined texture to object, and object to world transform. */ + float texture_to_world[4][4]; + mul_m4_m4m4(texture_to_world, ob->obmat, density->texture_to_object); + /* Compute world space dimensions for step size. */ - float ob_size[3]; - mat4_to_size(ob_size, ob->obmat); - float world_space_size[3] = {fabsf(ob_size[0]) * density->size[0], - fabsf(ob_size[1]) * density->size[1], - fabsf(ob_size[2]) * density->size[2]}; + float world_size[3]; + mat4_to_size(world_size, texture_to_world); + abs_v3(world_size); /* Compute slice parameters. */ double noise_ofs; @@ -271,7 +273,7 @@ static void workbench_volume_object_cache_populate(WORKBENCH_Data *vedata, Objec mul_v3_fl(slice_ct, max_ff(0.001f, slice_per_voxel)); max_slice = max_fff(slice_ct[0], slice_ct[1], slice_ct[2]); invert_v3(slice_ct); - mul_v3_v3(slice_ct, world_space_size); + mul_v3_v3(slice_ct, world_size); step_length = len_v3(slice_ct); DRWShadingGroup *grp = DRW_shgroup_create(sh, vedata->psl->volume_pass); @@ -293,19 +295,13 @@ static void workbench_volume_object_cache_populate(WORKBENCH_Data *vedata, Objec DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", >depth); DRW_shgroup_uniform_float_copy(grp, "densityScale", 10.0f * display_thickness); - /* Combined object and unit cube to bounding box transform. */ - float unit_cube_to_bb[4][4], drawmat[4][4]; - size_to_mat4(unit_cube_to_bb, density->size); - copy_v3_v3(unit_cube_to_bb[3], density->loc); - mul_m4_m4m4(drawmat, ob->obmat, unit_cube_to_bb); - // TODO: DRW_shgroup_call_obmat is not working here, and also does not // support culling, so we hack around it like this. float backup_obmat[4][4], backup_imat[4][4]; copy_m4_m4(backup_obmat, ob->obmat); copy_m4_m4(backup_imat, ob->imat); - copy_m4_m4(ob->obmat, drawmat); - invert_m4_m4(ob->imat, drawmat); + copy_m4_m4(ob->obmat, texture_to_world); + invert_m4_m4(ob->imat, texture_to_world); DRW_shgroup_call(grp, DRW_cache_cube_get(), ob); copy_m4_m4(ob->obmat, backup_obmat); copy_m4_m4(ob->imat, backup_imat); diff --git a/source/blender/draw/intern/draw_cache.h b/source/blender/draw/intern/draw_cache.h index 22cad8f01af..52172be8990 100644 --- a/source/blender/draw/intern/draw_cache.h +++ b/source/blender/draw/intern/draw_cache.h @@ -220,9 +220,10 @@ typedef struct DRWVolumeGrid { struct GPUTexture *texture; size_t resolution[3]; + /* Transform from 0..1 texture space to object space. */ + float texture_to_object[4][4]; + /* Grid bounding box to fit 3D texture to. */ - float loc[3]; - float size[3]; float mid[3]; float halfsize[3]; } DRWVolumeGrid; diff --git a/source/blender/draw/intern/draw_cache_impl_volume.c b/source/blender/draw/intern/draw_cache_impl_volume.c index c3dc1aca815..b5696eda628 100644 --- a/source/blender/draw/intern/draw_cache_impl_volume.c +++ b/source/blender/draw/intern/draw_cache_impl_volume.c @@ -199,12 +199,13 @@ static DRWVolumeGrid *volume_grid_cache_get(Volume *volume, MEM_freeN(voxels); -/* Compute transform. */ -/* TODO: support full transform, compute bbox as part of dense conversion for perfomance. */ +/* Compute transform matrix. */ +BKE_volume_grid_dense_transform_matrix( +grid, dense_min, dense_max, cache_grid->texture_to_object); + +/* TODO: support transform matrix in Eevee and remove this code. */ float min[3], max[3]; BKE_volume_grid_bounds(grid, min, max); -copy_v3_v3(cache_grid->loc, min); -sub_v3_v3v3(cache_grid->size, max, min); mid_v3_v3v3(cache_grid->mid, min, max); cache_grid->halfsize[0] = (max[0] - min[0]) / 2.0f; cache_grid->halfsize[1] = (max[1] - min[1]) / 2.0f; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org
[Bf-blender-cvs] [e936e1a8933] new-object-types: Volumes: expose grid data type in Python API
Commit: e936e1a89331c550b9e0f066f30f46a854bad88c Author: Brecht Van Lommel Date: Fri Jan 31 11:19:36 2020 +0100 Branches: new-object-types https://developer.blender.org/rBe936e1a89331c550b9e0f066f30f46a854bad88c Volumes: expose grid data type in Python API === M source/blender/makesrna/intern/rna_volume.c === diff --git a/source/blender/makesrna/intern/rna_volume.c b/source/blender/makesrna/intern/rna_volume.c index 3f2111d6d21..7c9b558fd73 100644 --- a/source/blender/makesrna/intern/rna_volume.c +++ b/source/blender/makesrna/intern/rna_volume.c @@ -34,12 +34,12 @@ #include "DNA_volume_types.h" +#include "BKE_volume.h" + #include "BLI_math_base.h" #ifdef RNA_RUNTIME -# include "BKE_volume.h" - # include "DEG_depsgraph.h" # include "WM_types.h" @@ -69,6 +69,12 @@ static int rna_VolumeGrid_name_length(PointerRNA *ptr) return strlen(BKE_volume_grid_name(grid)); } +static int rna_VolumeGrid_data_type_get(PointerRNA *ptr) +{ + const VolumeGrid *grid = ptr->data; + return BKE_volume_grid_type(grid); +} + static int rna_VolumeGrid_channels_get(PointerRNA *ptr) { const VolumeGrid *grid = ptr->data; @@ -192,18 +198,37 @@ static void rna_def_volume_grid(BlenderRNA *brna) prop, "rna_VolumeGrid_name_get", "rna_VolumeGrid_name_length", NULL); RNA_def_property_ui_text(prop, "Name", "Volume grid name"); + static const EnumPropertyItem data_type_items[] = { + {VOLUME_GRID_BOOLEAN, "BOOLEAN", 0, "Boolean", "Boolean"}, + {VOLUME_GRID_FLOAT, "FLOAT", 0, "Float", "Single precision float"}, + {VOLUME_GRID_DOUBLE, "DOUBLE", 0, "Double", "Double precision"}, + {VOLUME_GRID_INT, "INT", 0, "Integer", "32 bit integer"}, + {VOLUME_GRID_INT64, "INT64", 0, "Integer 64 bit", "64 bit integer"}, + {VOLUME_GRID_MASK, "MASK", 0, "Mask", "No data, boolean mask of active voxels"}, + {VOLUME_GRID_STRING, "STRING", 0, "String", "Text string"}, + {VOLUME_GRID_VECTOR_FLOAT, "VECTOR_FLOAT", 0, "Float Vector", "3D float vector"}, + {VOLUME_GRID_VECTOR_DOUBLE, "VECTOR_DOUBLE", 0, "Double Vector", "3D double vector"}, + {VOLUME_GRID_VECTOR_INT, "VECTOR_INT", 0, "Integer Vector", "3D integer vector"}, + {VOLUME_GRID_UNKNOWN, "UNKNOWN", 0, "Unknown", "Unsupported data type"}, + }; + + prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_enum_funcs(prop, "rna_VolumeGrid_data_type_get", NULL, NULL); + RNA_def_property_enum_items(prop, data_type_items); + RNA_def_property_ui_text(prop, "Data Type", "Data type of voxel values"); + prop = RNA_def_property(srna, "channels", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_int_funcs(prop, "rna_VolumeGrid_channels_get", NULL, NULL); - RNA_def_property_ui_text(prop, "Channels", "Number of channels in voxel data"); + RNA_def_property_ui_text(prop, "Channels", "Number of dimensions of the grid data type"); - /* TODO: naming, clarification of what index space is. */ prop = RNA_def_property(srna, "matrix_object", PROP_FLOAT, PROP_MATRIX); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_float_funcs(prop, "rna_VolumeGrid_matrix_object_get", NULL, NULL); RNA_def_property_ui_text( - prop, "Matrix Object", "Transformation from index space to world space"); + prop, "Matrix Object", "Transformation matrix from voxel index to object space"); prop = RNA_def_property(srna, "is_loaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [84ffa93f776] new-object-types: Fix new object types missing for viewport visibility menu
Commit: 84ffa93f776574ecb34daf2bf427c14a2f02f241 Author: Brecht Van Lommel Date: Fri Jan 31 11:19:36 2020 +0100 Branches: new-object-types https://developer.blender.org/rB84ffa93f776574ecb34daf2bf427c14a2f02f241 Fix new object types missing for viewport visibility menu === 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 999fb1940cb..fb8e9f1414f 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -5244,6 +5244,9 @@ class VIEW3D_PT_object_type_visibility(Panel): ("surf", "Surface"), ("meta", "Meta"), ("font", "Text"), +("hair", "Hair"), +("pointcloud", "Point Cloud"), +("volume", "Volume"), ("grease_pencil", "Grease Pencil"), (None, None), # Other ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [14ccda75f63] blender-v2.82-release: USD: Include USD library version in System Info
Commit: 14ccda75f6313849c5b4376f7e74def24084782e Author: Sybren A. Stüvel Date: Fri Jan 31 10:24:28 2020 +0100 Branches: blender-v2.82-release https://developer.blender.org/rB14ccda75f6313849c5b4376f7e74def24084782e USD: Include USD library version in System Info Pixar recently released USD 20.02 [1]. I think it's important for people to be able to figure out which version of the USD library is used in Blender. [1] https://github.com/PixarAnimationStudios/USD/releases/tag/v20.02 This commit exposes the USD library information via `bpy.app.usd`, and includes that info in the `system-info.txt` saved via Help → Save System Info. Reviewed by: brecht Differential Revision: https://developer.blender.org/D6724 === M release/scripts/modules/sys_info.py M source/blender/python/intern/CMakeLists.txt M source/blender/python/intern/bpy_app.c A source/blender/python/intern/bpy_app_usd.c A source/blender/python/intern/bpy_app_usd.h M source/blender/usd/intern/usd_capi.cc M source/blender/usd/usd.h === diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index 8b4e224efe4..656e2b3bd54 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -172,6 +172,13 @@ def write_sysinfo(filepath): else: output.write("Blender was built without Alembic support\n") +usd = bpy.app.usd +output.write("USD: ") +if usd.supported: +output.write("%s\n" % usd.version_string) +else: +output.write("Blender was built without USD support\n") + if not bpy.app.build_options.sdl: output.write("SDL: Blender was built without SDL support\n") diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index adcda710622..7106dace084 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -56,6 +56,7 @@ set(SRC bpy_app_sdl.c bpy_app_timers.c bpy_app_translations.c + bpy_app_usd.c bpy_capi_utils.c bpy_driver.c bpy_gizmo_wrap.c @@ -95,6 +96,7 @@ set(SRC bpy_app_sdl.h bpy_app_timers.h bpy_app_translations.h + bpy_app_usd.h bpy_capi_utils.h bpy_driver.h bpy_gizmo_wrap.h @@ -309,6 +311,9 @@ endif() if(WITH_USD) add_definitions(-DWITH_USD) + list(APPEND INC +../../usd + ) endif() if(WITH_OPENIMAGEIO) diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 043b31007f1..678df0d8993 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -33,6 +33,7 @@ #include "bpy_app_opensubdiv.h" #include "bpy_app_openvdb.h" #include "bpy_app_sdl.h" +#include "bpy_app_usd.h" #include "bpy_app_build_options.h" #include "bpy_app_translations.h" @@ -108,6 +109,7 @@ static PyStructSequence_Field app_info_fields[] = { /* submodules */ {"alembic", "Alembic library information backend"}, +{"usd", "USD library information backend"}, {"ffmpeg", "FFmpeg library information backend"}, {"ocio", "OpenColorIO library information backend"}, {"oiio", "OpenImageIO library information backend"}, @@ -201,6 +203,7 @@ static PyObject *make_app_info(void) #endif SetObjItem(BPY_app_alembic_struct()); + SetObjItem(BPY_app_usd_struct()); SetObjItem(BPY_app_ffmpeg_struct()); SetObjItem(BPY_app_ocio_struct()); SetObjItem(BPY_app_oiio_struct()); diff --git a/source/blender/python/intern/bpy_app_usd.c b/source/blender/python/intern/bpy_app_usd.c new file mode 100644 index 000..d87d218a5e5 --- /dev/null +++ b/source/blender/python/intern/bpy_app_usd.c @@ -0,0 +1,107 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2020 Blender Foundation. + * All rights reserved. + */ + +/** \file + * \ingroup pythonintern + */ + +#include +#include "BLI_utildefines.h" + +#include "bpy_app_usd.h" + +#include "../generic/py_capi_utils.h" + +#ifdef WITH_USD +# include "usd.h" +#endif + +static PyTypeObject
[Bf-blender-cvs] [7c144ac1f9c] new-object-types: Volumes: cycles rendering support of volume object as dense grids
Commit: 7c144ac1f9cd1f343aa271b1ab8aa70b030da25f Author: Brecht Van Lommel Date: Thu Jan 30 12:21:05 2020 +0100 Branches: new-object-types https://developer.blender.org/rB7c144ac1f9cd1f343aa271b1ab8aa70b030da25f Volumes: cycles rendering support of volume object as dense grids This does not yet use OpenVDB grid transforms properly, in particular it is assumed all grids have the same transform and do not contain rotation or shear. The conversion is also not optimized. Grid bounds are being computed multiple times, and for the bounding mesh we should be using the VDB tree directly. === M intern/cycles/blender/blender_mesh.cpp M intern/cycles/blender/blender_object.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_util.h M intern/cycles/render/mesh_volume.cpp === diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index b18f9a37948..994d625cdd8 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -326,6 +326,90 @@ static void create_mesh_volume_attributes(Scene *scene, BL::Object _ob, Mesh * b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_VELOCITY, frame); } +static void create_volume_object(BL::BlendData _data, BL::Object _ob, Scene *scene, Mesh *mesh) +{ + BL::Volume b_volume(b_ob.data()); + b_volume.grids.load(b_data.ptr.data); + + bool transform_added = false; + + mesh->volume_isovalue = 1e-3f; /* TODO: make user setting. */ + + /* Find grid with matching name. */ + BL::Volume::grids_iterator b_grid_iter; + for (b_volume.grids.begin(b_grid_iter); b_grid_iter != b_volume.grids.end(); ++b_grid_iter) { +BL::VolumeGrid b_grid = *b_grid_iter; +ustring name = ustring(b_grid.name()); +AttributeStandard std = ATTR_STD_NONE; + +/* TODO: find nicer solution to detect standard attribute. */ +if (name == Attribute::standard_name(ATTR_STD_VOLUME_DENSITY)) { + std = ATTR_STD_VOLUME_DENSITY; +} +else if (name == Attribute::standard_name(ATTR_STD_VOLUME_COLOR)) { + std = ATTR_STD_VOLUME_COLOR; +} +else if (name == Attribute::standard_name(ATTR_STD_VOLUME_FLAME)) { + std = ATTR_STD_VOLUME_FLAME; +} +else if (name == Attribute::standard_name(ATTR_STD_VOLUME_HEAT)) { + std = ATTR_STD_VOLUME_HEAT; +} +else if (name == Attribute::standard_name(ATTR_STD_VOLUME_TEMPERATURE)) { + std = ATTR_STD_VOLUME_TEMPERATURE; +} +else if (name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY)) { + std = ATTR_STD_VOLUME_VELOCITY; +} + +if ((std != ATTR_STD_NONE && mesh->need_attribute(scene, std)) || +mesh->need_attribute(scene, name)) { + Attribute *attr = (std != ATTR_STD_NONE) ? +mesh->attributes.add(std) : +mesh->attributes.add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VOXEL); + VoxelAttribute *volume_data = attr->data_voxel(); + ImageMetaData metadata; + const bool animated = false; + const float frame = 0.0f; + + volume_data->manager = scene->image_manager; + volume_data->slot = scene->image_manager->add_image(name.c_str(), + b_volume.ptr.data, + animated, + frame, + INTERPOLATION_LINEAR, + EXTENSION_CLIP, + IMAGE_ALPHA_AUTO, + u_colorspace_raw, + metadata); + + /* TODO: support each grid having own transform. */ + /* TODO: support full transform instead of only using boundbox. */ + /* TODO: avoid computing bounds multiple times, perhaps by postponing + * setting this transform until voxels are loaded. */ + if (!transform_added && mesh->need_attribute(scene, ATTR_STD_GENERATED_TRANSFORM)) { +Attribute *attr = mesh->attributes.add(ATTR_STD_GENERATED_TRANSFORM); +Transform *tfm = attr->data_transform(); + +b_grid.load(); + +VolumeGrid *volume_grid = (VolumeGrid *)b_grid.ptr.data; +size_t min[3], max[3]; +if (BKE_volume_grid_dense_bounds(volume_grid, min, max)) { + float mat[4][4]; + BKE_volume_grid_dense_transform_matrix(volume_grid, min, max, mat); + *tfm = transform_inverse(get_transform(mat)); +} +else { + *tfm = transform_identity(); +} + +transform_added = true; + } +} + } +} + /* Create vertex color attributes. */ static void
[Bf-blender-cvs] [e893f5c61ac] new-object-types: Volumes: work on completing the grid access API
Commit: e893f5c61ac0f67e7cf1f6729966b59bec539986 Author: Brecht Van Lommel Date: Wed Jan 29 20:48:33 2020 +0100 Branches: new-object-types https://developer.blender.org/rBe893f5c61ac0f67e7cf1f6729966b59bec539986 Volumes: work on completing the grid access API === M source/blender/blenkernel/BKE_volume.h M source/blender/blenkernel/intern/volume.cc M source/blender/draw/intern/draw_cache_impl_volume.c M source/blender/makesrna/intern/rna_volume.c M source/creator/creator.c === diff --git a/source/blender/blenkernel/BKE_volume.h b/source/blender/blenkernel/BKE_volume.h index 7b85fdb3d0e..75b8db09c21 100644 --- a/source/blender/blenkernel/BKE_volume.h +++ b/source/blender/blenkernel/BKE_volume.h @@ -38,6 +38,12 @@ struct Object; struct Scene; struct Volume; +/* Module */ + +void BKE_volumes_init(void); + +/* Datablock Management */ + void BKE_volume_init(struct Volume *volume); void BKE_volume_init_grids(struct Volume *volume); void *BKE_volume_add(struct Main *bmain, const char *name); @@ -49,9 +55,6 @@ struct Volume *BKE_volume_copy(struct Main *bmain, const struct Volume *volume); void BKE_volume_make_local(struct Main *bmain, struct Volume *volume, const bool lib_local); void BKE_volume_free(struct Volume *volume); -void BKE_volume_load(struct Volume *volume, struct Main *bmain); -void BKE_volume_unload(struct Volume *volume); - struct BoundBox *BKE_volume_boundbox_get(struct Object *ob); /* Depsgraph */ @@ -77,27 +80,64 @@ extern void (*BKE_volume_batch_cache_free_cb)(struct Volume *volume); /* Grids * - * When accessing a grid, it must be specified if the grid will be used for - * reading only metadata, or reading metadata and voxels. - * - * This makes it possible to load just the required data on-demand, and share - * grids between volumes for copy-on-write. */ + * For volumes referencing a file, the list of grids and metadata must be + * loaded before it can be accessed. This happens on-demand, only when needed + * by the user interface, dependency graph or render engine. */ typedef struct VolumeGrid VolumeGrid; +bool BKE_volume_load(struct Volume *volume, struct Main *bmain); +void BKE_volume_unload(struct Volume *volume); +bool BKE_volume_is_loaded(const struct Volume *volume); + int BKE_volume_num_grids(struct Volume *volume); const char *BKE_volume_grids_error_msg(const struct Volume *volume); +VolumeGrid *BKE_volume_grid_get(struct Volume *volume, int grid_index); +VolumeGrid *BKE_volume_grid_find(struct Volume *volume, const char *name); -/* Grid Metadata */ - -const VolumeGrid *BKE_volume_grid_for_metadata(struct Volume *volume, int grid_index); +/* Grid + * + * By default only grid metadata is loaded, for access to the tree and voxels + * the BKE_volume_grid_load must be called first. */ + +typedef enum VolumeGridType { + VOLUME_GRID_UNKNOWN = 0, + VOLUME_GRID_BOOLEAN, + VOLUME_GRID_FLOAT, + VOLUME_GRID_DOUBLE, + VOLUME_GRID_INT, + VOLUME_GRID_INT64, + VOLUME_GRID_MASK, + VOLUME_GRID_STRING, + VOLUME_GRID_VECTOR_FLOAT, + VOLUME_GRID_VECTOR_DOUBLE, + VOLUME_GRID_VECTOR_INT, +} VolumeGridType; + +bool BKE_volume_grid_load(struct Volume *volume, struct VolumeGrid *grid); +void BKE_volume_grid_unload(struct VolumeGrid *volume); +bool BKE_volume_grid_is_loaded(const struct VolumeGrid *grid); + +/* Metadata */ const char *BKE_volume_grid_name(const struct VolumeGrid *grid); +VolumeGridType BKE_volume_grid_type(const struct VolumeGrid *grid); +int BKE_volume_grid_channels(const struct VolumeGrid *grid); +void BKE_volume_grid_transform_matrix(const struct VolumeGrid *grid, float mat[4][4]); -/* Grid Tree and Voxels */ - -const VolumeGrid *BKE_volume_grid_for_tree(struct Volume *volume, int grid_index); +/* Tree and Voxels */ bool BKE_volume_grid_bounds(const struct VolumeGrid *grid, float min[3], float max[3]); -float *BKE_volume_grid_to_dense_voxels(const struct VolumeGrid *volume_grid, size_t size[3]); + +bool BKE_volume_grid_dense_bounds(const struct VolumeGrid *volume_grid, + size_t min[3], + size_t max[3]); +void BKE_volume_grid_dense_transform_matrix(const struct VolumeGrid *volume_grid, +const size_t min[3], +const size_t max[3], +float mat[4][4]); +void BKE_volume_grid_dense_voxels(const struct VolumeGrid *volume_grid, + const size_t min[3], + const size_t max[3], + float *voxels); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc index 5ecb5ae6904..7a867099560 100644 ---