[Bf-blender-cvs] [5560722e344] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Antonio Vazquez
noreply at git.blender.org
Wed May 30 16:35:26 CEST 2018
Commit: 5560722e344002b4d982b04d964885f9a5699e67
Author: Antonio Vazquez
Date: Wed May 30 16:25:09 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB5560722e344002b4d982b04d964885f9a5699e67
Merge branch 'blender2.8' into greasepencil-object
Conflicts:
source/blender/editors/include/ED_object.h
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_ops.c
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/object_update.c
index 3324218b903,e953185b726..c518c962d90
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@@ -330,66 -329,7 +330,10 @@@ void BKE_object_eval_uber_data(Depsgrap
case OB_MBALL:
BKE_mball_batch_cache_dirty(ob->data, BKE_MBALL_BATCH_DIRTY_ALL);
break;
+ case OB_GPENCIL:
+ BKE_gpencil_batch_cache_dirty(ob->data);
+ break;
}
-
- if (DEG_depsgraph_use_copy_on_write()) {
- if (ob->type == OB_MESH) {
- /* Quick hack to convert evaluated derivedMesh to Mesh. */
- DerivedMesh *dm = ob->derivedFinal;
- if (dm != NULL) {
- Mesh *mesh = (Mesh *)ob->data;
- Mesh *new_mesh = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(new_mesh);
- /* Copy ID name so GS(new_mesh->id) works correct later on. */
- BLI_strncpy(new_mesh->id.name, mesh->id.name, sizeof(new_mesh->id.name));
- /* Copy materials so render engines can access them. */
- new_mesh->mat = MEM_dupallocN(mesh->mat);
- new_mesh->totcol = mesh->totcol;
- DM_to_mesh(dm, new_mesh, ob, CD_MASK_MESH, true);
- new_mesh->edit_btmesh = mesh->edit_btmesh;
- /* Store result mesh as derived_mesh of object. This way we have
- * explicit way to query final object evaluated data and know for sure
- * who owns the newly created mesh datablock.
- */
- ob->mesh_evaluated = new_mesh;
- /* TODO(sergey): This is kind of compatibility thing, so all render
- * engines can use object->data for mesh data for display. This is
- * something what we might want to change in the future.
- * XXX: This can sometimes cause modifiers to be applied twice!
- */
- ob->data = new_mesh;
- /* Special flags to help debugging. */
- new_mesh->id.tag |= LIB_TAG_COPY_ON_WRITE_EVAL;
- /* Save some memory by throwing DerivedMesh away. */
- /* NOTE: Watch out, some tools might need it!
- * So keep around for now..
- */
- /* Store original ID as a pointer in evaluated ID.
- * This way we can restore original object data when we are freeing
- * evaluated mesh.
- */
- new_mesh->id.orig_id = &mesh->id;
- /* Copy autosmooth settings from original mesh. */
- new_mesh->flag |= (mesh->flag & ME_AUTOSMOOTH);
- new_mesh->smoothresh = mesh->smoothresh;
- }
- #if 0
- if (ob->derivedFinal != NULL) {
- ob->derivedFinal->needsFree = 1;
- ob->derivedFinal->release(ob->derivedFinal);
- ob->derivedFinal = NULL;
- }
- if (ob->derivedDeform != NULL) {
- ob->derivedDeform->needsFree = 1;
- ob->derivedDeform->release(ob->derivedDeform);
- ob->derivedDeform = NULL;
- }
- #endif
- }
- }
}
void BKE_object_eval_cloth(Depsgraph *depsgraph,
diff --cc source/blender/editors/animation/anim_channels_defines.c
index ae5020060c6,d48798ece97..5cf39859ffe
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@@ -4051,17 -4046,18 +4051,26 @@@ static void achannel_setting_flush_widg
return;
}
- if (ale_setting->type == ANIMTYPE_GPLAYER)
+ if (ale_setting->type == ANIMTYPE_GPLAYER) {
+ /* draw cache updates for settings that affect the visible strokes */
+ if (setting == ACHANNEL_SETTING_VISIBLE) {
+ bGPdata *gpd = (bGPdata *)ale_setting->id;
+ DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA);
+ }
+
+ /* UI updates */
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL);
+ }
+ /* tag copy-on-write flushing (so that the settings will have an effect) */
+ if (ale_setting->id) {
+ DEG_id_tag_update(ale_setting->id, DEG_TAG_COPY_ON_WRITE);
+ }
+ if (ale_setting->adt && ale_setting->adt->action) {
+ /* action is it's own datablock, so has to be tagged specifically... */
+ DEG_id_tag_update(&ale_setting->adt->action->id, DEG_TAG_COPY_ON_WRITE);
+ }
+
/* verify animation context */
if (ANIM_animdata_get_context(C, &ac) == 0)
return;
diff --cc source/blender/editors/object/object_ops.c
index 9c475bfe77c,3d1a18e1fb1..bcdfda7ef27
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@@ -292,13 -291,13 +292,12 @@@ void ED_keymap_object(wmKeyConfig *keyc
/* modes */
{
short key_mode_pair[][2] = {
- {ACCENTGRAVEKEY, OB_MODE_OBJECT},
{ONEKEY, OB_MODE_OBJECT},
- {TWOKEY, OB_MODE_EDIT},
- {THREEKEY, OB_MODE_POSE},
- {THREEKEY, OB_MODE_WEIGHT_PAINT},
- {FOURKEY, OB_MODE_VERTEX_PAINT},
- {FIVEKEY, OB_MODE_TEXTURE_PAINT},
- {SIXKEY, OB_MODE_SCULPT},
+ {TWOKEY, OB_MODE_EDIT}, /* or OB_MODE_GPENCIL_EDIT */
+ {THREEKEY, OB_MODE_SCULPT}, /* or OB_MODE_GPENCIL_SCULPT */
+ {FOURKEY, OB_MODE_TEXTURE_PAINT}, /* or OB_MODE_POSE */
+ {FIVEKEY, OB_MODE_VERTEX_PAINT}, /* or OB_MODE_GPENCIL_PAINT */
+ {SIXKEY, OB_MODE_WEIGHT_PAINT}, /* or OB_MODE_GPENCIL_WEIGHT */
{SEVENKEY, OB_MODE_PARTICLE_EDIT},
};
diff --cc source/blender/editors/space_outliner/outliner_select.c
index 7db1cfea90d,0e30c43998e..de1cd4488ee
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@@ -899,12 -973,14 +999,18 @@@ static void do_outliner_item_activate_t
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
else if (OB_DATA_SUPPORT_EDITMODE(te->idcode)) {
- WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL);
+ Object *ob = (Object *)outliner_search_back(soops, te, ID_OB);
+ if ((ob != NULL) && (ob->data == tselem->id)) {
+ Base *base = BKE_view_layer_base_find(view_layer, ob);
+ if ((base != NULL) && (base->flag & BASE_VISIBLED)) {
+ do_outliner_activate_obdata(C, scene, view_layer, base);
+ }
+ }
}
+ else if (ELEM(te->idcode, ID_GD)) {
+ /* set grease pencil to object mode */
+ WM_operator_name_call(C, "GPENCIL_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL);
+ }
else { // rest of types
tree_element_active(C, scene, view_layer, soops, te, OL_SETSEL_NORMAL, false);
}
diff --cc source/blender/makesrna/intern/rna_object.c
index b5791177cf5,f00bf51a3aa..3ed272aaa0a
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@@ -65,15 -65,12 +65,15 @@@ const EnumPropertyItem rna_enum_object_
{OB_MODE_OBJECT, "OBJECT", ICON_OBJECT_DATAMODE, "Object Mode", ""},
{OB_MODE_EDIT, "EDIT", ICON_EDITMODE_HLT, "Edit Mode", ""},
{OB_MODE_POSE, "POSE", ICON_POSE_HLT, "Pose Mode", ""},
- {OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt Mode", ""},
- {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""},
{OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""},
+ {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""},
{OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""},
+ {OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt Mode", ""},
{OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""},
- {OB_MODE_GPENCIL, "GPENCIL_EDIT", ICON_GREASEPENCIL, "Edit Strokes", "Edit Grease Pencil Strokes"},
+ {OB_MODE_GPENCIL_EDIT, "GPENCIL_EDIT", ICON_EDITMODE_HLT, "Edit Mode", "Edit Grease Pencil Strokes"},
+ {OB_MODE_GPENCIL_SCULPT, "GPENCIL_SCULPT", ICON_SCULPTMODE_HLT, "Sculpt Mode", "Sculpt Grease Pencil Strokes"},
+ {OB_MODE_GPENCIL_WEIGHT, "GPENCIL_WEIGHT", ICON_WPAINT_HLT, "Weight Paint", "Grease Pencil Weight Paint Strokes"},
+ {OB_MODE_GPENCIL_PAINT, "GPENCIL_PAINT", ICON_GREASEPENCIL, "Draw", "Paint Grease Pencil Strokes"},
{0, NULL, 0, NULL, NULL}
};
More information about the Bf-blender-cvs
mailing list