[Bf-blender-cvs] [cfbd605] blender2.8: Merge branch 'master' into blender2.8
Bastien Montagne
noreply at git.blender.org
Tue Jul 12 00:08:08 CEST 2016
Commit: cfbd605567f48229a923df382baf6db98fbafc61
Author: Bastien Montagne
Date: Tue Jul 12 00:01:38 2016 +0200
Branches: blender2.8
https://developer.blender.org/rBcfbd605567f48229a923df382baf6db98fbafc61
Merge branch 'master' into blender2.8
Conflicts:
intern/cycles/blender/addon/ui.py
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_distribute.c
source/blender/blenkernel/intern/texture.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_relations.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/transform/transform_snap_object.c
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/library.c
index 5f7bded,869e024..978f1ac
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@@ -323,17 -333,20 +332,17 @@@ bool id_make_local(Main *bmain, ID *id
case ID_GR:
return false; /* not implemented */
case ID_AR:
- if (!test) BKE_armature_make_local((bArmature *)id);
+ if (!test) BKE_armature_make_local(bmain, (bArmature *)id);
return true;
case ID_AC:
- if (!test) BKE_action_make_local((bAction *)id);
+ if (!test) BKE_action_make_local(bmain, (bAction *)id);
return true;
case ID_NT:
- if (!test) ntreeMakeLocal((bNodeTree *)id, true);
+ if (!test) ntreeMakeLocal(bmain, (bNodeTree *)id, true);
return true;
case ID_BR:
- if (!test) BKE_brush_make_local((Brush *)id);
+ if (!test) BKE_brush_make_local(bmain, (Brush *)id);
return true;
- case ID_PA:
- if (!test) BKE_particlesettings_make_local(bmain, (ParticleSettings *)id);
- return true;
case ID_WM:
return false; /* can't be linked */
case ID_GD:
@@@ -412,20 -427,23 +423,20 @@@ bool id_copy(Main *bmain, ID *id, ID **
case ID_SO:
return false; /* not implemented */
case ID_GR:
- if (!test) *newid = (ID *)BKE_group_copy((Group *)id);
+ if (!test) *newid = (ID *)BKE_group_copy(bmain, (Group *)id);
return true;
case ID_AR:
- if (!test) *newid = (ID *)BKE_armature_copy((bArmature *)id);
+ if (!test) *newid = (ID *)BKE_armature_copy(bmain, (bArmature *)id);
return true;
case ID_AC:
- if (!test) *newid = (ID *)BKE_action_copy((bAction *)id);
+ if (!test) *newid = (ID *)BKE_action_copy(bmain, (bAction *)id);
return true;
case ID_NT:
- if (!test) *newid = (ID *)ntreeCopyTree((bNodeTree *)id);
+ if (!test) *newid = (ID *)ntreeCopyTree(bmain, (bNodeTree *)id);
return true;
case ID_BR:
- if (!test) *newid = (ID *)BKE_brush_copy((Brush *)id);
+ if (!test) *newid = (ID *)BKE_brush_copy(bmain, (Brush *)id);
return true;
- case ID_PA:
- if (!test) *newid = (ID *)BKE_particlesettings_copy(bmain, (ParticleSettings *)id);
- return true;
case ID_WM:
return false; /* can't be copied from here */
case ID_GD:
diff --cc source/blender/blenkernel/intern/library_query.c
index 7cb5bfd,f86f5fa..b623cec
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@@ -71,7 -72,9 +72,8 @@@
#include "BKE_fcurve.h"
#include "BKE_library.h"
#include "BKE_library_query.h"
+ #include "BKE_main.h"
#include "BKE_modifier.h"
-#include "BKE_particle.h"
#include "BKE_rigidbody.h"
#include "BKE_sca.h"
#include "BKE_sequencer.h"
@@@ -399,8 -417,14 +403,13 @@@ void BKE_library_foreach_ID_link(ID *id
case ID_OB:
{
Object *object = (Object *) id;
- ParticleSystem *psys;
+ /* Object is special, proxies make things hard... */
+ const int data_cd_flag = data.cd_flag;
+ const int proxy_cd_flag = (object->proxy || object->proxy_group) ? IDWALK_INDIRECT_USAGE : 0;
+
/* object data special case */
+ data.cd_flag |= proxy_cd_flag;
if (object->type == OB_EMPTY) {
/* empty can have NULL or Image */
CALLBACK_INVOKE_ID(object->data, IDWALK_USER);
@@@ -743,6 -854,82 +785,80 @@@ void BKE_library_update_ID_link_user(I
}
}
+ /**
+ * Say whether given \a id_type_owner can use (in any way) a datablock of \a id_type_used.
+ */
+ /* This is a 'simplified' abstract version of BKE_library_foreach_ID_link() above, quite useful to reduce
+ * useless ietrations in some cases. */
+ bool BKE_library_idtype_can_use_idtype(const short id_type_owner, const short id_type_used)
+ {
+ if (id_type_used == ID_AC) {
+ return id_type_can_have_animdata(id_type_owner);
+ }
+
+ switch (id_type_owner) {
+ case ID_LI:
+ return ELEM(id_type_used, ID_LI);
+ case ID_SCE:
+ return (ELEM(id_type_used, ID_OB, ID_WO, ID_SCE, ID_MC, ID_MA, ID_GR, ID_TXT,
+ ID_LS, ID_MSK, ID_SO, ID_GD, ID_BR, ID_PAL, ID_IM, ID_NT) ||
+ BKE_library_idtype_can_use_idtype(ID_NT, id_type_used));
+ case ID_OB:
+ /* Could be the following, but simpler to just always say 'yes' here. */
+ #if 0
+ return ELEM(id_type_used, ID_ME, ID_CU, ID_MB, ID_LT, ID_SPK, ID_AR, ID_LA, ID_CA, /* obdata */
- ID_OB, ID_MA, ID_GD, ID_GR, ID_TE, ID_PA, ID_TXT, ID_SO, ID_MC, ID_IM, ID_AC
++ ID_OB, ID_MA, ID_GD, ID_GR, ID_TE, ID_TXT, ID_SO, ID_MC, ID_IM, ID_AC
+ /* + constraints, modifiers and game logic ID types... */);
+ #else
+ return true;
+ #endif
+ case ID_ME:
+ return ELEM(id_type_used, ID_ME, ID_KE, ID_MA);
+ case ID_CU:
+ return ELEM(id_type_used, ID_OB, ID_KE, ID_MA, ID_VF);
+ case ID_MB:
+ return ELEM(id_type_used, ID_MA);
+ case ID_MA:
+ return (ELEM(id_type_used, ID_TE, ID_GR) || BKE_library_idtype_can_use_idtype(ID_NT, id_type_used));
+ case ID_TE:
+ return (ELEM(id_type_used, ID_IM, ID_OB) || BKE_library_idtype_can_use_idtype(ID_NT, id_type_used));
+ case ID_LT:
+ return ELEM(id_type_used, ID_KE);
+ case ID_LA:
+ return (ELEM(id_type_used, ID_TE) || BKE_library_idtype_can_use_idtype(ID_NT, id_type_used));
+ case ID_CA:
+ return ELEM(id_type_used, ID_OB);
+ case ID_KE:
+ return ELEM(id_type_used, ID_ME, ID_CU, ID_LT); /* Warning! key->from, could be more types in future? */
+ case ID_SCR:
+ return ELEM(id_type_used, ID_SCE);
+ case ID_WO:
+ return (ELEM(id_type_used, ID_TE) || BKE_library_idtype_can_use_idtype(ID_NT, id_type_used));
+ case ID_SPK:
+ return ELEM(id_type_used, ID_SO);
+ case ID_GR:
+ return ELEM(id_type_used, ID_OB);
+ case ID_NT:
+ /* Could be the following, but node.id has no type restriction... */
+ #if 0
+ return ELEM(id_type_used, ID_GD /* + node.id types... */);
+ #else
+ return true;
+ #endif
+ case ID_BR:
+ return ELEM(id_type_used, ID_BR, ID_IM, ID_PC, ID_TE);
- case ID_PA:
- return ELEM(id_type_used, ID_OB, ID_GR, ID_TE);
+ case ID_MC:
+ return ELEM(id_type_used, ID_GD, ID_IM);
+ case ID_MSK:
+ return ELEM(id_type_used, ID_MC); /* WARNING! mask->parent.id, not typed. */
+ case ID_LS:
+ return (ELEM(id_type_used, ID_TE, ID_OB) || BKE_library_idtype_can_use_idtype(ID_NT, id_type_used));
+ default:
+ return false;
+ }
+ }
+
+
/* ***** ID users iterator. ***** */
typedef struct IDUsersIter {
ID *id;
diff --cc source/blender/editors/interface/interface_templates.c
index cf3a50d,d91bd49..7cc7b54
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@@ -939,9 -974,9 +939,9 @@@ static uiLayout *draw_modifier
}
UI_block_lock_clear(block);
- UI_block_lock_set(block, ob && ob->id.lib, ERROR_LIBDATA_MESSAGE);
+ UI_block_lock_set(block, ob && ID_IS_LINKED_DATABLOCK(ob), ERROR_LIBDATA_MESSAGE);
- if (!ELEM(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem,
+ if (!ELEM(md->type, eModifierType_Fluidsim, eModifierType_Softbody,
eModifierType_Cloth, eModifierType_Smoke))
{
uiItemO(row, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), ICON_NONE,
diff --cc source/blender/editors/transform/transform_snap_object.c
index af465d7,59dfe18..ed6d49d
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@@ -1324,9 -1450,34 +1450,18 @@@ static bool snapObjectsRay
ListBase *r_hit_list)
{
bool retval = false;
+
+ float dvec[3];
+ sub_v3_v3v3(dvec, ray_start, ray_origin);
+
+ const float ray_depth_range[2] = {
+ dot_v3v3(dvec, ray_normal),
+ *ray_depth,
+ };
+
unsigned int ob_index = 0;
Object *obedit = use_object_edit_cage ? sctx->scene->obedit : NULL;
-
- /* Need an exception for particle edit because the base is flagged with BA_HAS_RECALC_DATA
- * which makes the loop skip it, even the derived mesh will never change
- *
- * To solve that problem, we do it first as an exception.
- * */
Base *base_act = sctx->scene->basact;
- if (base_act && base_act->object && base_act->object->mode & OB_MODE_PARTICLE_EDIT) {
- Object *ob = base_act->object;
-
- retval |= snapObject(
- sctx, ob, ob->obmat, ob_index++,
- false, snap_to,
- ray_origin, ray_start, ray_normal, ray_depth_range,
- ray_depth, dist_to_ray_sq,
- r_loc, r_no, r_index, r_ob, r_obmat, r_hit_list);
- }
bool ignore_object_selected = false, ignore_object_active = false;
switch (snap_select) {
diff --cc source/blender/gpu/GPU_material.h
index 3413ee0,0d92d22..202e5fd
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@@ -332,7 -337,16 +332,8 @@@ void GPU_mist_update_enable(short enabl
void GPU_mist_update_values(int type, float start, float dist, float inten, float color[3]);
void GPU_horizon_update_color(float color[3]);
void GPU_ambient_update_color(float color[3]);
+ void GPU_zenith_update_color(float color[3]);
-struct GPUParticleInfo
-{
- float scalprops[4];
- float location[3];
- float velocity[3];
- float angular_velocity[3];
-};
-
#ifdef WITH_OPENSUBDIV
struct DerivedMesh;
void GPU_material_update_fvar_offset(GPUMaterial *gpu_material,
More information about the Bf-blender-cvs
mailing list