Commit: 0f4f4d87542b96942234e10421823dcc6766331c Author: Sergey Sharybin Date: Mon Jun 12 15:09:33 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB0f4f4d87542b96942234e10421823dcc6766331c
Merge branch 'master' into blender2.8 =================================================================== =================================================================== diff --cc release/scripts/startup/bl_ui/space_view3d.py index a6bd29d19cf,02c0f69ac82..0e1a142a41f --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@@ -1263,10 -1253,9 +1263,10 @@@ class INFO_MT_add(Menu) INFO_MT_camera_add.draw(self, context) layout.menu("INFO_MT_lamp_add", icon='OUTLINER_OB_LAMP') + layout.menu("INFO_MT_lightprobe_add") layout.separator() - layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY') + layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_FORCE_FIELD') layout.separator() if len(bpy.data.groups) > 10: diff --cc source/blender/blenkernel/intern/softbody.c index 11c692077c0,600bc3f453d..0b8c11f6dc8 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@@ -2233,11 -2233,11 +2233,11 @@@ static void sb_cf_threads_run(Scene *sc MEM_freeN(sb_threads); } -static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, float timenow) +static void softbody_calc_forcesEx(Scene *scene, SceneLayer *sl, Object *ob, float forcetime, float timenow) { - /* rule we never alter free variables :bp->vec bp->pos in here ! - * this will ruin adaptive stepsize AKA heun! (BM) - */ + /* rule we never alter free variables :bp->vec bp->pos in here ! + * this will ruin adaptive stepsize AKA heun! (BM) + */ SoftBody *sb= ob->soft; /* is supposed to be there */ /*BodyPoint *bproot;*/ /* UNUSED */ ListBase *do_effector = NULL; diff --cc source/blender/blenloader/intern/readfile.c index 884bb363333,f224f0b5633..682ca637fcb --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@@ -10374,7 -10159,7 +10374,7 @@@ void BLO_library_link_copypaste(Main *m static ID *link_named_part_ex( Main *mainl, FileData *fd, const short idcode, const char *name, const short flag, - Scene *scene, SceneLayer *sl, const bool use_placeholders, const bool force_indirect) - Scene *scene, View3D *v3d, const bool use_placeholders, const bool force_indirect) ++ Scene *scene, SceneLayer *sl, const bool use_placeholders, const bool force_indirect) { ID *id = link_named_part(mainl, fd, idcode, name, use_placeholders, force_indirect); diff --cc source/blender/editors/object/object_relations.c index ae3a3866c24,3284af2df69..333bcf00a8c --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@@ -2159,89 -2234,89 +2141,92 @@@ static bool make_local_all__instance_in return changed; } - static int make_local_exec(bContext *C, wmOperator *op) + static void make_local_animdata_tag_strips(ListBase *strips) { - Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); - SceneLayer *sl = CTX_data_scene_layer(C); - SceneCollection *sc = CTX_data_scene_collection(C); - AnimData *adt; - ParticleSystem *psys; - Material *ma, ***matarar; - Lamp *la; - ID *id; - const int mode = RNA_enum_get(op->ptr, "type"); - int a, b; - - if (mode == MAKE_LOCAL_ALL) { - /* de-select so the user can differentiate newly instanced from existing objects */ - BKE_scene_base_deselect_all(scene); + NlaStrip *strip; - if (make_local_all__instance_indirect_unused(bmain, scene, sl, sc)) { - BKE_report(op->reports, RPT_INFO, - "Orphan library objects added to the current scene to avoid loss"); + for (strip = strips->first; strip; strip = strip->next) { + if (strip->act) { + strip->act->id.tag &= ~LIB_TAG_PRE_EXISTING; + } + if (strip->remap && strip->remap->target) { + strip->remap->target->id.tag &= ~LIB_TAG_PRE_EXISTING; } - BKE_library_make_local(bmain, NULL, NULL, false, false); /* NULL is all libs */ - WM_event_add_notifier(C, NC_WINDOW, NULL); - return OPERATOR_FINISHED; + make_local_animdata_tag_strips(&strip->strips); } + } - tag_localizable_objects(C, mode); - - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) - { - if ((ob->id.tag & LIB_TAG_DOIT) == 0) { - continue; + /* Tag all actions used by given animdata to be made local. */ + static void make_local_animdata_tag(AnimData *adt) + { + if (adt) { + /* Actions - Active and Temp */ + if (adt->action) { + adt->action->id.tag &= ~LIB_TAG_PRE_EXISTING; + } + if (adt->tmpact) { + adt->tmpact->id.tag &= ~LIB_TAG_PRE_EXISTING; + } + /* Remaps */ + if (adt->remap && adt->remap->target) { + adt->remap->target->id.tag &= ~LIB_TAG_PRE_EXISTING; } - if (ob->id.lib) - id_make_local(bmain, &ob->id, false, false); - } - CTX_DATA_END; + /* Drivers */ + /* TODO: need to handle the ID-targets too? */ - /* maybe object pointers */ - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) - { - if (ob->id.lib == NULL) { - ID_NEW_REMAP(ob->parent); + /* NLA Data */ + for (NlaTrack *nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) { + make_local_animdata_tag_strips(&nlt->strips); } } - CTX_DATA_END; - - CTX_DATA_BEGIN (C, Object *, ob, selected_objects) - { - if ((ob->id.tag & LIB_TAG_DOIT) == 0) { - continue; - } + } - id = ob->data; + static void make_local_material_tag(Material *ma) + { + if (ma) { + ma->id.tag &= ~LIB_TAG_PRE_EXISTING; + make_local_animdata_tag(BKE_animdata_from_id(&ma->id)); - if (id && (ELEM(mode, MAKE_LOCAL_SELECT_OBDATA, MAKE_LOCAL_SELECT_OBDATA_MATERIAL))) { - id_make_local(bmain, id, false, false); - adt = BKE_animdata_from_id(id); - if (adt) BKE_animdata_make_local(adt); + /* About nodetrees: root one is made local together with material, others we keep linked for now... */ - /* tag indirect data direct */ - matarar = give_matarar(ob); - if (matarar) { - for (a = 0; a < ob->totcol; a++) { - ma = (*matarar)[a]; - if (ma) - id_lib_extern(&ma->id); - } + for (int a = 0; a < MAX_MTEX; a++) { + if (ma->mtex[a] && ma->mtex[a]->tex) { + ma->mtex[a]->tex->id.tag &= ~LIB_TAG_PRE_EXISTING; } } + } + } - for (psys = ob->particlesystem.first; psys; psys = psys->next) - id_make_local(bmain, &psys->part->id, false, false); + static int make_local_exec(bContext *C, wmOperator *op) + { + Main *bmain = CTX_data_main(C); + Scene *scene = CTX_data_scene(C); + ParticleSystem *psys; + Material *ma, ***matarar; + Lamp *la; + const int mode = RNA_enum_get(op->ptr, "type"); + int a; + + /* Note: we (ab)use LIB_TAG_PRE_EXISTING to cherry pick which ID to make local... */ + if (mode == MAKE_LOCAL_ALL) { ++ SceneLayer *sl = CTX_data_scene_layer(C); ++ SceneCollection *sc = CTX_data_scene_collection(C); ++ + BKE_main_id_tag_all(bmain, LIB_TAG_PRE_EXISTING, false); + + /* de-select so the user can differentiate newly instanced from existing objects */ + BKE_scene_base_deselect_all(scene); - adt = BKE_animdata_from_id(&ob->id); - if (adt) BKE_animdata_make_local(adt); - if (make_local_all__instance_indirect_unused(bmain, scene)) { ++ if (make_local_all__instance_indirect_unused(bmain, scene, sl, sc)) { + BKE_report(op->reports, RPT_INFO, "Orphan library objects added to the current scene to avoid loss"); + } } - CTX_DATA_END; + else { + BKE_main_id_tag_all(bmain, LIB_TAG_PRE_EXISTING, true); + tag_localizable_objects(C, mode); - if (mode == MAKE_LOCAL_SELECT_OBDATA_MATERIAL) { CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { if ((ob->id.tag & LIB_TAG_DOIT) == 0) { diff --cc source/blender/modifiers/intern/MOD_array.c index 09597b5b42f,874ac34b613..57f90fb4b51 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@@ -102,9 -102,43 +102,9 @@@ static void foreachObjectLink walk(userData, ob, &amd->offset_ob, IDWALK_CB_NOP); } -static void updateDepgraph(ModifierData *md, DagForest *forest, - struct Main *UNUSED(bmain), - struct Scene *UNUSED(scene), - Object *UNUSED(ob), DagNode *obNode) -{ - ArrayModifierData *amd = (ArrayModifierData *) md; - - if (amd->start_cap) { - DagNode *curNode = dag_get_node(forest, amd->start_cap); - - dag_add_relation(forest, curNode, obNode, - DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier"); - } - if (amd->end_cap) { - DagNode *curNode = dag_get_node(forest, amd->end_cap); - - dag_add_relation(forest, curNode, obNode, - DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier"); - } - if (amd->curve_ob) { - DagNode *curNode = dag_get_node(forest, amd->curve_ob); - curNode->eval_flags |= DAG_EVAL_NEED_CURVE_PATH; - - dag_add_relation(forest, curNode, obNode, - DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier"); - } - if (amd->offset_ob) { - DagNode *curNode = dag_get_node(forest, amd->offset_ob); - - dag_add_relation(forest, curNode, obNode, - DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier"); - } -} - static void updateDepsgraph(ModifierData *md, struct Main *UNUSED(bmain), - struct Scene *scene, + struct Scene *UNUSED(scene), Object *UNUSED(ob), struct DepsNodeHandle *node) { diff --cc source/blender/modifiers/intern/MOD_curve.c index d9acce0a780,3c6ba7acc88..3200caedc32 --- a/source/blender/modifiers/intern/MOD_curve.c +++ b/source/blender/modifiers/intern/MOD_curve.c @@@ -91,9 -92,26 +91,9 @@@ static void foreachObjectLink walk(userData, ob, &cmd->object, IDWALK_CB_NOP); } -static void updateDepgraph(ModifierData *md, DagForest *forest, - struct Main *UNUSED(bmain), - Scene *UNUSED(scene), - Object *UNUSED(ob), - DagNode *obNode) -{ - CurveModifierData *cmd = (CurveModifierData *) md; - - if (cmd->object) { - DagNode *curNode = dag_get_node(forest, cmd->objec @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs