[Bf-blender-cvs] [07e45ea] fracture_modifier: merge compile fixes
Martin Felke
noreply at git.blender.org
Wed Sep 28 00:03:47 CEST 2016
Commit: 07e45ea86c6e90ba7a77def67fb8f4b3a509a517
Author: Martin Felke
Date: Tue Sep 27 21:46:59 2016 +0200
Branches: fracture_modifier
https://developer.blender.org/rB07e45ea86c6e90ba7a77def67fb8f4b3a509a517
merge compile fixes
===================================================================
M source/blender/blenkernel/intern/rigidbody.c
M source/blender/blenloader/intern/writefile.c
M source/blender/editors/include/UI_interface.h
M source/blender/editors/object/object_modifier.c
M source/blender/editors/physics/rigidbody_constraint.c
===================================================================
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 37c185c..6c0fbb0 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -76,9 +76,6 @@
#include "BKE_scene.h"
#include "PIL_time.h"
-#include "WM_types.h"
-#include "WM_api.h"
-
#ifdef WITH_BULLET
static void resetDynamic(RigidBodyWorld *rbw, bool do_reset_always);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 93050b7..14e59d1 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1695,10 +1695,10 @@ static void write_shard(WriteData* wd, Shard* s)
CustomDataLayer *llayers = NULL, llayers_buff[CD_TEMP_CHUNK_SIZE];
CustomDataLayer *players = NULL, players_buff[CD_TEMP_CHUNK_SIZE];
- writestruct(wd, DATA, "Shard", 1, s);
- writestruct(wd, DATA, "MVert", s->totvert, s->mvert);
- writestruct(wd, DATA, "MPoly", s->totpoly, s->mpoly);
- writestruct(wd, DATA, "MLoop", s->totloop, s->mloop);
+ writestruct(wd, DATA, Shard, 1, s);
+ writestruct(wd, DATA, MVert, s->totvert, s->mvert);
+ writestruct(wd, DATA, MPoly, s->totpoly, s->mpoly);
+ writestruct(wd, DATA, MLoop, s->totloop, s->mloop);
CustomData_file_write_prepare(&s->vertData, &vlayers, vlayers_buff, ARRAY_SIZE(vlayers_buff));
CustomData_file_write_prepare(&s->loopData, &llayers, llayers_buff, ARRAY_SIZE(llayers_buff));
@@ -1726,13 +1726,13 @@ static void write_shard(WriteData* wd, Shard* s)
static void write_meshIsland(WriteData* wd, MeshIsland* mi)
{
- writestruct(wd, DATA, "MeshIsland", 1, mi);
+ writestruct(wd, DATA, MeshIsland, 1, mi);
writedata(wd, DATA, sizeof(float) * 3 * mi->vertex_count, mi->vertco);
writedata(wd, DATA, sizeof(short) * 3 * mi->vertex_count, mi->vertno);
- writestruct(wd, DATA, "RigidBodyOb", 1, mi->rigidbody);
+ writestruct(wd, DATA, RigidBodyOb, 1, mi->rigidbody);
writedata(wd, DATA, sizeof(int) * mi->neighbor_count, mi->neighbor_ids);
- writestruct(wd, DATA, "BoundBox", 1, mi->bb);
+ writestruct(wd, DATA, BoundBox, 1, mi->bb);
writedata(wd, DATA, sizeof(int) * mi->vertex_count, mi->vertex_indices);
writedata(wd, DATA, sizeof(float) * 3 * mi->frame_count, mi->locs);
@@ -1891,7 +1891,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
{
if (mode)
{
- writestruct(wd, DATA, "FracMesh", 1, fm);
+ writestruct(wd, DATA, FracMesh, 1, fm);
for (s = fm->shard_map.first; s; s = s->next) {
write_shard(wd, s);
@@ -1907,7 +1907,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
for (con = fmd->meshConstraints.first; con; con = con->next)
{
- writestruct(wd, DATA, "RigidBodyShardCon", 1, con);
+ writestruct(wd, DATA, RigidBodyShardCon, 1, con);
}
}
}
@@ -1919,8 +1919,8 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
for (ssq = fmd->shard_sequence.first; ssq; ssq = ssq->next)
{
- writestruct(wd, DATA, "ShardSequence", 1, ssq);
- writestruct(wd, DATA, "FracMesh", 1, ssq->frac_mesh);
+ writestruct(wd, DATA, ShardSequence, 1, ssq);
+ writestruct(wd, DATA, FracMesh, 1, ssq->frac_mesh);
for (s = ssq->frac_mesh->shard_map.first; s; s = s->next) {
write_shard(wd, s);
}
@@ -1928,7 +1928,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
for (msq = fmd->meshIsland_sequence.first; msq; msq = msq->next)
{
- writestruct(wd, DATA, "MeshIslandSequence", 1, msq);
+ writestruct(wd, DATA, MeshIslandSequence, 1, msq);
for (mi = msq->meshIslands.first; mi; mi = mi->next) {
write_meshIsland(wd, mi);
}
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 231958d..49e5845 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -182,7 +182,6 @@ enum {
UI_BUT_UPDATE_DELAY = (1 << 28), /* don't run updates while dragging (needed in rare cases). */
UI_BUT_TEXTEDIT_UPDATE = (1 << 29), /* when widget is in textedit mode, update value on each char stroke */
UI_BUT_SEARCH_UNLINK = (1 << 30), /* show unlink for search button */
- UI_BUT_UPDATE_DELAY = (1 << 31), /* don't run updates while dragging (needed in rare cases). */
};
#define UI_PANEL_WIDTH 340
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index b2428e4..b67f0bd 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -66,6 +66,7 @@
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
+#include "BKE_library_remap.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
@@ -2565,9 +2566,6 @@ static int fracture_refresh_invoke(bContext *C, wmOperator *op, const wmEvent *U
Scene* scene = CTX_data_scene(C);
Object* ob = CTX_data_active_object(C);
- if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_OBJECT_FRACTURE))
- return OPERATOR_CANCELLED;
-
if (edit_modifier_invoke_properties(C, op))
{
apply_scale(ob, scene);
@@ -2869,7 +2867,9 @@ static void do_restore_scene_link(Scene* scene, int count, Scene **bgscene, Base
MEM_freeN(*basarray_old);
*basarray_old = NULL;
- BKE_scene_unlink(G.main, *bgscene, scene);
+ BKE_libblock_remap(G.main, *bgscene, scene, ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_NEVER_NULL_USAGE);
+ BKE_libblock_free(G.main, *bgscene);
+
*bgscene = NULL;
}
@@ -3198,7 +3198,7 @@ static bAnimContext* make_anim_context(Scene* scene, Object* ob)
static Object* do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi, Group* gr, Object* ob, Scene* scene,
int start, int end, int count, Object* parent, bool is_baked,
PTCacheID* pid, PointCache *cache, float obloc[3], float diff[3], int *j, Base **base,
- float threshold, bool clean_chan)
+ float threshold, bool clean_chan, ReportList* reports)
{
int i = 0;
Object* ob_new = NULL;
@@ -3236,7 +3236,7 @@ static Object* do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
DM_to_mesh(mi->physics_mesh, me, ob_new, CD_MASK_MESH, false);
- ED_rigidbody_object_add(scene, ob_new, RBO_TYPE_ACTIVE, NULL);
+ ED_rigidbody_object_add(G.main, scene, ob_new, RBO_TYPE_ACTIVE, reports);
ob_new->rigidbody_object->flag |= RBO_FLAG_KINEMATIC;
ob_new->rigidbody_object->mass = mi->rigidbody->mass;
@@ -3272,7 +3272,7 @@ static Object* do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
if (is_baked)
{
BKE_ptcache_id_time(pid, scene, (float)i, NULL, NULL, NULL);
- if (BKE_ptcache_read(pid, (float)i))
+ if (BKE_ptcache_read(pid, (float)i, false))
{
BKE_ptcache_validate(cache, i);
copy_v3_v3(loc, mi->rigidbody->pos);
@@ -3314,17 +3314,17 @@ static Object* do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
copy_v3_v3(ob_new->size, size);
}
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Location", "location", 0, i, flag);
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Location", "location", 1, i, flag);
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Location", "location", 2, i, flag);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Location", "location", 0, i, flag, BEZT_KEYTYPE_KEYFRAME);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Location", "location", 1, i, flag, BEZT_KEYTYPE_KEYFRAME);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Location", "location", 2, i, flag, BEZT_KEYTYPE_KEYFRAME);
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Rotation", "rotation_euler", 0, i, flag);
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Rotation", "rotation_euler", 1, i, flag);
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Rotation", "rotation_euler", 2, i, flag);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Rotation", "rotation_euler", 0, i, flag, BEZT_KEYTYPE_KEYFRAME);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Rotation", "rotation_euler", 1, i, flag, BEZT_KEYTYPE_KEYFRAME);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Rotation", "rotation_euler", 2, i, flag, BEZT_KEYTYPE_KEYFRAME);
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", "scale", 0, i, flag);
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", "scale", 1, i, flag);
- insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", "scale", 2, i, flag);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", "scale", 0, i, flag, BEZT_KEYTYPE_KEYFRAME);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", "scale", 1, i, flag, BEZT_KEYTYPE_KEYFRAME);
+ insert_keyframe(NULL, (ID*)ob_new, NULL, "Scale", "scale", 2, i, flag, BEZT_KEYTYPE_KEYFRAME);
}
if (i == end)
@@ -3354,7 +3354,7 @@ static Object* do_convert_meshIsland(FractureModifierData* fmd, MeshIsland *mi,
}
static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr, Object* ob, Scene* scene, int start, int end,
- float threshold, bool clean_chan)
+ float threshold, bool clean_chan, ReportList *reports)
{
bool is_baked = false;
PointCache* cache = NULL;
@@ -3397,7 +3397,7 @@ static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr,
{
Object *obj = do_convert_meshIsland(fmd, mi, gr, ob, scene, start, end, count,
parent, is_baked, &pid, cache, obloc, diff, &k, &basarray_old[i],
- threshold, clean_chan);
+ threshold, clean_chan, reports);
if (!obj) {
return false;
}
@@ -3524,49 +3524,7 @@ static int rigidbody_convert_keyframes_exec(bContext *C, wmOperator *op)
}
gr = BKE_group_add(G.main, "Converted");
-
-#if 0
- if (rmd->execute_threaded)
- {
- PointerRNA *ptr;
- /* what a dirty hack.... disable poll function */
- wmOperatorType *ot = WM_operatortype_find("ANIM_OT_keyframe_insert_menu",
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list