Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-12-06 13:55:30 +0300
committerTon Roosendaal <ton@blender.org>2005-12-06 13:55:30 +0300
commitd024452ebf97c0926b1601371d2ee802bd754f3c (patch)
treeb6afebbe0b0cb682062bed92acbf33fe33b09aae /source/blender/blenkernel
parent863234481e751ae94dd77b18d65ea76df65ec4b1 (diff)
Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive NLA option in groups... so, cleaned up the old code (removed most) and integrated it back in a more useful way. Usage: - CTRL+G gives menu to add group, add to existing group, or remove from groups. - In Object buttons, a new (should become first) Panel was added, showing not only Object "ID button" and Parent, but also the Groups the Object Belongs to. These buttons also allow rename, assigning or removing. - To indicate Objects are grouped, they're drawn in a (not theme yet, so temporal?) green wire color. - Use ALT+SHIFT mouse-select to (de)select an entire group But, the real power of groups is in the following features: -> Particle Force field and Guide control In the "Particle Motion" Panel, you can indicate a Group name, this then limits force fields or guides to members of that Group. (Note that layers still work on top of that... not sure about that). -> Light Groups In the Material "Shaders" Panel, you can indicate a Group name to limit lighting for the Material to lamps in this group. The Lights in a Group do need to be 'visible' for the Scene to be rendered (as usual). -> Group Duplicator In the Object "Anim" Panel, you can set any Object (use Empty!) to duplicate an entire Group. It will make copies of all Objects in that Group. Also works for animated Objects, but it will copy the current positions or deforms. Control over 'local timing' (so we can do Massive anims!) will be added later. (Note; this commit won't render Group duplicators yet, a fix in bf-blender will enable that, next commit will sync) -> Library Appending In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed. By appending or linking the Group itself, and use the Group Duplicator, you now can animate and position linked Objects. The nice thing is that the local saved file itself will only store the Group name that was linked, so on a next file read, the Group Objects will be re-read as stored (changed) in the Library file. (Note; current implementation also "gives a base" to linked Group Objects, to show them as Objects in the current Scene. Need that now for testing purposes, but probably will be removed later). -> Outliner Outliner now shows Groups as optio too, nice to organize your data a bit too! In General, Groups have a very good potential... for example, it could become default for MetaBall Objects too (jiri, I can help you later on how this works). All current 'layer relationships' in Blender should be dropped in time, I guess...
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_anim.h3
-rw-r--r--source/blender/blenkernel/BKE_effect.h6
-rw-r--r--source/blender/blenkernel/BKE_group.h12
-rw-r--r--source/blender/blenkernel/BKE_scene.h2
-rw-r--r--source/blender/blenkernel/bad_level_call_stubs/stubs.c1
-rw-r--r--source/blender/blenkernel/intern/anim.c47
-rw-r--r--source/blender/blenkernel/intern/effect.c85
-rw-r--r--source/blender/blenkernel/intern/group.c229
-rw-r--r--source/blender/blenkernel/intern/scene.c6
-rw-r--r--source/blender/blenkernel/intern/softbody.c2
10 files changed, 109 insertions, 284 deletions
diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h
index 16e8b5652aa..e4cd8e39aca 100644
--- a/source/blender/blenkernel/BKE_anim.h
+++ b/source/blender/blenkernel/BKE_anim.h
@@ -43,9 +43,6 @@ void free_path(struct Path *path);
void calc_curvepath(struct Object *ob);
int interval_test(int min, int max, int p1, int cycl);
int where_on_path(struct Object *ob, float ctime, float *vec, float *dir);
-void frames_duplilist(struct Object *ob);
-void vertex_duplilist(struct Scene *sce, struct Object *par);
-void particle_duplilist(struct Scene *sce, struct Object *par, struct PartEff *paf);
void free_duplilist(void);
void make_duplilist(struct Scene *sce, struct Object *ob);
int count_duplilist(struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index c68d4b8b10e..d149d2b6e7c 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -38,10 +38,8 @@ struct Effect;
struct ListBase;
struct Object;
struct PartEff;
-struct MTex;
-struct Mesh;
-struct WaveEff;
struct Particle;
+struct Group;
struct Effect *add_effect(int type);
void free_effect(struct Effect *eff);
@@ -57,7 +55,7 @@ void build_particle_system(struct Object *ob);
/* particle deflector */
#define PE_WIND_AS_SPEED 0x00000001
-struct ListBase *pdInitEffectors(struct Object *ob);
+struct ListBase *pdInitEffectors(struct Object *obsrc, struct Group *group);
void pdEndEffectors(struct ListBase *lb);
void pdDoEffectors(struct ListBase *lb, float *opco, float *force, float *speed, float cur_time, float loc_time, unsigned int flags);
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h
index 265d16579c2..4e69f18a238 100644
--- a/source/blender/blenkernel/BKE_group.h
+++ b/source/blender/blenkernel/BKE_group.h
@@ -35,26 +35,16 @@
#define BKE_GROUP_H
struct Group;
-struct GroupKey;
struct GroupObject;
-struct ObjectKey;
struct Object;
-void free_object_key(struct ObjectKey *ok);
void free_group_object(struct GroupObject *go);
void free_group(struct Group *group);
struct Group *add_group(void);
-void object_to_obkey(struct Object *ob, struct ObjectKey *ok);
-void obkey_to_object(struct ObjectKey *ok, struct Object *ob);
-void add_object_key(struct GroupObject *go, struct GroupKey *gk);
void add_to_group(struct Group *group, struct Object *ob);
void rem_from_group(struct Group *group, struct Object *ob);
-void add_group_key(struct Group *group);
-void set_object_key(struct Object *ob, struct ObjectKey *ok);
-void set_group_key(struct Group *group);
struct Group *find_group(struct Object *ob);
-void set_group_key_name(struct Group *group, char *name);
-void set_group_key_frame(struct Group *group, float frame);
+int object_in_group(struct Object *ob, struct Group *group);
#endif
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index 1313ad251e7..a7eea6f6393 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -60,7 +60,7 @@ void free_qtcodecdata(struct QuicktimeCodecData *acd);
void free_scene(struct Scene *me);
struct Scene *add_scene(char *name);
-int object_in_scene(struct Object *ob, struct Scene *sce);
+struct Base *object_in_scene(struct Object *ob, struct Scene *sce);
void set_scene_bg(struct Scene *sce);
void set_scene_name(char *name);
diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c
index 98ecc32ee3f..44997480779 100644
--- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c
+++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c
@@ -211,6 +211,7 @@ void externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg,
void RE_free_envmap(struct EnvMap *env){}
struct EnvMap *RE_copy_envmap(struct EnvMap *env){ return env;}
void RE_free_envmapdata(struct EnvMap *env){}
+void init_render_textures(void){}
int RE_envmaptex(struct Tex *tex, float *texvec, float *dxt, float *dyt){
return 0;
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index b8178dd98cd..b448816589f 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -40,14 +40,15 @@
#include "BLI_arithb.h"
#include "DNA_listBase.h"
-#include "DNA_object_types.h"
#include "DNA_curve_types.h"
-#include "DNA_key_types.h"
-#include "DNA_view3d_types.h"
#include "DNA_effect_types.h"
+#include "DNA_group_types.h"
+#include "DNA_key_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "DNA_view3d_types.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
@@ -271,7 +272,7 @@ int where_on_path(Object *ob, float ctime, float *vec, float *dir) /* returns OK
return 1;
}
-static Object *new_dupli_object(ListBase *lb, Object *ob, Object *par)
+static Object *new_dupli_object(ListBase *lb, Object *ob, Object *par, int clearpar)
{
Object *newob;
@@ -284,7 +285,7 @@ static Object *new_dupli_object(ListBase *lb, Object *ob, Object *par)
/* only basis-ball gets displist */
if(newob->type==OB_MBALL) newob->disp.first= newob->disp.last= NULL;
- if(ob!=par) { // dupliverts, particle
+ if(clearpar) { // dupliverts, particle
newob->parent= NULL;
newob->track= NULL;
}
@@ -293,7 +294,22 @@ static Object *new_dupli_object(ListBase *lb, Object *ob, Object *par)
return newob;
}
-void frames_duplilist(Object *ob)
+static void group_duplilist(Object *ob)
+{
+ Object *newob;
+ GroupObject *go;
+ float mat[4][4];
+
+ if(ob->dup_group==NULL) return;
+
+ for(go= ob->dup_group->gobject.first; go; go= go->next) {
+ newob= new_dupli_object(&duplilist, go->ob, ob, 0);
+ Mat4CpyMat4(mat, newob->obmat);
+ Mat4MulMat4(newob->obmat, mat, ob->obmat);
+ }
+}
+
+static void frames_duplilist(Object *ob)
{
extern int enable_cu_speed; /* object.c */
Object *newob, copyob;
@@ -315,7 +331,7 @@ void frames_duplilist(Object *ob)
else ok= 0;
}
if(ok) {
- newob= new_dupli_object(&duplilist, ob, ob);
+ newob= new_dupli_object(&duplilist, ob, ob, 0);
do_ob_ipo(newob);
where_is_object_time(newob, (float)G.scene->r.cfra);
@@ -343,7 +359,7 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n
VecSubf(vec, vec, vdd->pmat[3]);
VecAddf(vec, vec, vdd->ob->obmat[3]);
- newob= new_dupli_object(&duplilist, vdd->ob, vdd->par);
+ newob= new_dupli_object(&duplilist, vdd->ob, vdd->par, 1);
VECCOPY(newob->obmat[3], vec);
if(vdd->par->transflag & OB_DUPLIROT) {
@@ -359,7 +375,7 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n
}
-void vertex_duplilist(Scene *sce, Object *par)
+static void vertex_duplilist(Scene *sce, Object *par)
{
Object *ob;
Base *base;
@@ -420,8 +436,7 @@ void vertex_duplilist(Scene *sce, Object *par)
dm->release(dm);
}
-
-void particle_duplilist(Scene *sce, Object *par, PartEff *paf)
+static void particle_duplilist(Scene *sce, Object *par, PartEff *paf)
{
Object *ob, *newob;
Base *base;
@@ -462,7 +477,7 @@ void particle_duplilist(Scene *sce, Object *par, PartEff *paf)
mtime= pa->time+pa->lifetime;
for(ctime= pa->time; ctime<mtime; ctime+=paf->staticstep) {
- newob= new_dupli_object(&duplilist, ob, par);
+ newob= new_dupli_object(&duplilist, ob, par, 1);
/* make sure hair grows until the end.. */
if(ctime>pa->time+pa->lifetime) ctime= pa->time+pa->lifetime;
@@ -494,7 +509,7 @@ void particle_duplilist(Scene *sce, Object *par, PartEff *paf)
if((paf->flag & PAF_DIED)==0 && ctime > pa->time+pa->lifetime) continue;
//if(ctime < pa->time+pa->lifetime) {
- newob= new_dupli_object(&duplilist, ob, par);
+ newob= new_dupli_object(&duplilist, ob, par, 1);
/* to give ipos in object correct offset */
where_is_object_time(newob, ctime-pa->time);
@@ -523,7 +538,6 @@ void particle_duplilist(Scene *sce, Object *par, PartEff *paf)
}
}
-
void free_duplilist()
{
Object *ob;
@@ -551,7 +565,10 @@ void make_duplilist(Scene *sce, Object *ob)
font_duplilist(ob);
}
}
- else if(ob->transflag & OB_DUPLIFRAMES) frames_duplilist(ob);
+ else if(ob->transflag & OB_DUPLIFRAMES)
+ frames_duplilist(ob);
+ else if(ob->transflag & OB_DUPLIGROUP)
+ group_duplilist(ob);
}
}
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index b2b52cfda06..e2582c5d86c 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -36,19 +36,21 @@
#include <stdlib.h>
#include "MEM_guardedalloc.h"
-#include "DNA_listBase.h"
+
+#include "DNA_curve_types.h"
#include "DNA_effect_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
+#include "DNA_group_types.h"
+#include "DNA_ipo_types.h"
+#include "DNA_key_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_listBase.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_material_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_key_types.h"
+#include "DNA_object_types.h"
+#include "DNA_object_force.h"
#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_ipo_types.h"
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
@@ -326,42 +328,57 @@ typedef struct pEffectorCache {
Object obcopy; /* for restoring transformation data */
} pEffectorCache;
+static void add_to_effectorcache(ListBase *lb, Object *ob, Object *obsrc)
+{
+ pEffectorCache *ec;
+ PartDeflect *pd= ob->pd;
+
+ if(pd->forcefield == PFIELD_GUIDE) {
+ if(ob->type==OB_CURVE && obsrc->type==OB_MESH) { /* guides only do mesh particles */
+ Curve *cu= ob->data;
+ if(cu->flag & CU_PATH) {
+ if(cu->path==NULL || cu->path->data==NULL)
+ makeDispListCurveTypes(ob, 0);
+ if(cu->path && cu->path->data) {
+ ec= MEM_callocN(sizeof(pEffectorCache), "effector cache");
+ ec->ob= ob;
+ BLI_addtail(lb, ec);
+ }
+ }
+ }
+ }
+ else if(pd->forcefield) {
+ ec= MEM_callocN(sizeof(pEffectorCache), "effector cache");
+ ec->ob= ob;
+ BLI_addtail(lb, ec);
+ }
+}
/* returns ListBase handle with objects taking part in the effecting */
-ListBase *pdInitEffectors(Object *obsrc)
+ListBase *pdInitEffectors(Object *obsrc, Group *group)
{
static ListBase listb={NULL, NULL};
pEffectorCache *ec;
- unsigned int layer= obsrc->lay;
Base *base;
-
- for(base = G.scene->base.first; base; base= base->next) {
- if( (base->lay & layer) && base->object->pd && base->object!=obsrc) {
- Object *ob= base->object;
- PartDeflect *pd= ob->pd;
-
- if(pd->forcefield == PFIELD_GUIDE) {
- if(ob->type==OB_CURVE && obsrc->type==OB_MESH) { /* guides only do mesh particles */
- Curve *cu= ob->data;
- if(cu->flag & CU_PATH) {
- if(cu->path==NULL || cu->path->data==NULL)
- makeDispListCurveTypes(ob, 0);
- if(cu->path && cu->path->data) {
- ec= MEM_callocN(sizeof(pEffectorCache), "effector cache");
- ec->ob= ob;
- BLI_addtail(&listb, ec);
- }
- }
- }
+ unsigned int layer= obsrc->lay;
+
+ if(group) {
+ GroupObject *go;
+
+ for(go= group->gobject.first; go; go= go->next) {
+ if( (go->ob->lay & layer) && go->ob->pd && go->ob!=obsrc) {
+ add_to_effectorcache(&listb, go->ob, obsrc);
}
- else if(pd->forcefield) {
- ec= MEM_callocN(sizeof(pEffectorCache), "effector cache");
- ec->ob= ob;
- BLI_addtail(&listb, ec);
+ }
+ }
+ else {
+ for(base = G.scene->base.first; base; base= base->next) {
+ if( (base->lay & layer) && base->object->pd && base->object!=obsrc) {
+ add_to_effectorcache(&listb, base->object, obsrc);
}
}
}
-
+
/* make a full copy */
for(ec= listb.first; ec; ec= ec->next) {
ec->obcopy= *(ec->ob);
@@ -1667,7 +1684,7 @@ void build_particle_system(Object *ob)
}
/* get the effectors */
- effectorbase= pdInitEffectors(ob);
+ effectorbase= pdInitEffectors(ob, paf->group);
/* init geometry, return is 6 x float * me->totvert in size */
vertexcosnos= (VeNoCo *)mesh_get_mapped_verts_nors(ob);
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 65c4ed42e03..7405f16d9c0 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -1,19 +1,12 @@
-/* group.c sept 2000
- * - cleaned up mar-01 nzc
- *
- *
- * ton roosendaal
+/*
* $Id$
*
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ * ***** BEGIN GPL LICENSE BLOCK *****
*
* 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. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
+ * 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
@@ -31,7 +24,7 @@
*
* Contributor(s): none yet.
*
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ * ***** END GPL LICENSE BLOCK *****
*/
#include <stdio.h>
@@ -57,22 +50,8 @@
#include <config.h>
#endif
-void free_object_key(ObjectKey *ok)
-{
- if(ok->ipo) ok->ipo->id.us--;
-
- MEM_freeN(ok);
-}
-
void free_group_object(GroupObject *go)
{
- ObjectKey *ok;
-
- while(go->okey.first) {
- ok= go->okey.first;
- BLI_remlink(&go->okey, ok);
- free_object_key(ok);
- }
MEM_freeN(go);
}
@@ -82,14 +61,11 @@ void free_group(Group *group)
/* don't free group itself */
GroupObject *go;
- BLI_freelistN(&group->gkey);
-
while(group->gobject.first) {
go= group->gobject.first;
BLI_remlink(&group->gobject, go);
free_group_object(go);
}
-
}
Group *add_group()
@@ -100,97 +76,16 @@ Group *add_group()
return group;
}
-/* assumes 'ok' is unitialized */
-void object_to_obkey(Object *ob, ObjectKey *ok)
-{
- ok->partype= ob->partype;
- ok->par1= ob->par1;
- ok->par2= ob->par2;
- ok->par3= ob->par3;
-
- ok->parent= ob->parent;
- ok->track= ob->track;
-
- ok->ipo= copy_ipo(ob->ipo);
-
- memcpy(ok->loc, ob->loc, 7*3*sizeof(float));
- memcpy(ok->quat, ob->quat, 2*4*sizeof(float));
- memcpy(ok->obmat, ob->obmat, 3*4*4*sizeof(float));
-
- ok->lay= ob->lay;
- ok->transflag= ob->transflag;
- ok->trackflag= ob->transflag;
- ok->upflag= ob->upflag;
- ok->sf= ob->sf;
- ok->ctime= ob->ctime;
-
-
-}
-
-void obkey_to_object(ObjectKey *ok, Object *ob)
-{
- ob->partype= ok->partype;
- ob->par1= ok->par1;
- ob->par2= ok->par2;
- ob->par3= ok->par3;
-
- ob->parent= ok->parent;
- ob->track= ok->track;
-
- /* pretty tricky, this makes ob->ipo blocks with users 'hanging around' */
- if(ob->ipo) {
- free_libblock_us(&G.main->ipo, ob->ipo);
- }
- ob->ipo= copy_ipo(ok->ipo);
-
- memcpy(ob->loc, ok->loc, 7*3*sizeof(float));
- memcpy(ob->quat, ok->quat, 2*4*sizeof(float));
- memcpy(ob->obmat, ok->obmat, 3*4*4*sizeof(float));
-
- ob->lay= ok->lay;
- ob->transflag= ok->transflag;
- ob->trackflag= ok->transflag;
- ob->upflag= ok->upflag;
- ob->sf= ok->sf;
- ob->ctime= ok->ctime;
-}
-
-/* current ob position */
-void add_object_key(GroupObject *go, GroupKey *gk)
-{
- ObjectKey *ok;
-
- /* check if there already is a key */
- ok= go->okey.first;
- while(ok) {
- if(ok->gkey == gk) break;
- ok= ok->next;
- }
-
- if(ok) {
- BLI_remlink(&go->okey, ok);
- free_object_key(ok);
- }
- ok= MEM_mallocN(sizeof(ObjectKey), "objectkey");
- ok->gkey= gk;
-
- object_to_obkey(go->ob, ok);
-
- BLI_addtail(&go->okey, ok);
-
-}
-
/* external */
void add_to_group(Group *group, Object *ob)
{
GroupObject *go;
- GroupKey *gk;
+
+ if(group==NULL || ob==NULL) return;
/* check if the object has been added already */
- go= group->gobject.first;
- while(go) {
+ for(go= group->gobject.first; go; go= go->next) {
if(go->ob==ob) return;
- go= go->next;
}
go= MEM_callocN(sizeof(GroupObject), "groupobject");
@@ -198,18 +93,13 @@ void add_to_group(Group *group, Object *ob)
go->ob= ob;
- /* keys? */
- gk= group->gkey.first;
- while(gk) {
- add_object_key(go, gk);
- gk= gk->next;
- }
}
void rem_from_group(Group *group, Object *ob)
{
GroupObject *go, *gon;
- ObjectKey *ok;
+
+ if(group==NULL || ob==NULL) return;
go= group->gobject.first;
while(go) {
@@ -218,116 +108,31 @@ void rem_from_group(Group *group, Object *ob)
BLI_remlink(&group->gobject, go);
free_group_object(go);
}
- else {
- ok= go->okey.first;
- while(ok) {
- if(ok->parent==ob) ok->parent= NULL;
- if(ok->track==ob) ok->track= NULL;
- ok= ok->next;
- }
- }
go= gon;
}
}
-void add_group_key(Group *group)
+int object_in_group(Object *ob, Group *group)
{
GroupObject *go;
- GroupKey *gk;
- int nr=10;
- extern char colname_array[][20]; /* material.c */
-
- gk= group->gkey.first;
- while(gk) {
- nr++;
- gk= gk->next;
- }
-
- gk= MEM_callocN(sizeof(GroupKey), "groupkey");
- BLI_addtail(&group->gkey, gk);
- strcpy(gk->name, colname_array[ nr % 120 ]);
-
- go= group->gobject.first;
- while(go) {
- add_object_key(go, gk);
- go= go->next;
- }
-
- group->active= gk;
-}
-
-void set_object_key(Object *ob, ObjectKey *ok)
-{
- obkey_to_object(ok, ob);
-}
-
-void set_group_key(Group *group)
-{
- /* sets active */
- GroupObject *go;
- ObjectKey *ok;
- if(group->active==NULL) return;
+ if(group==NULL || ob==NULL) return 0;
- go= group->gobject.first;
- while(go) {
- ok= go->okey.first;
- while(ok) {
- if(ok->gkey==group->active) {
- set_object_key(go->ob, ok);
- break;
- }
- ok= ok->next;
- }
- go= go->next;
+ for(go= group->gobject.first; go; go= go->next) {
+ if(go->ob==ob)
+ return 1;
}
-
+ return 0;
}
Group *find_group(Object *ob)
{
Group *group= G.main->group.first;
- GroupObject *go;
while(group) {
-
- go= group->gobject.first;
- while(go) {
- if(go->ob==ob) return group;
- go= go->next;
- }
+ if(object_in_group(ob, group))
+ return group;
group= group->id.next;
}
return NULL;
}
-
-void set_group_key_name(Group *group, char *name)
-{
- GroupKey *gk;
-
- if(group==NULL) return;
-
- gk= group->gkey.first;
- while(gk) {
- if(strcmp(name, gk->name)==0) break;
- gk= gk->next;
- }
-
- if(gk) {
- group->active= gk;
- set_group_key(group);
- }
-}
-
-void set_group_key_frame(Group *group, float frame)
-{
- GroupObject *go;
-
- if(group==NULL) return;
-
- go= group->gobject.first;
- while(go) {
- where_is_object_time(go->ob, frame);
- go= go->next;
- }
-}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 53b4a09d89b..2cd387d7d93 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -220,16 +220,16 @@ Scene *add_scene(char *name)
return sce;
}
-int object_in_scene(Object *ob, Scene *sce)
+Base *object_in_scene(Object *ob, Scene *sce)
{
Base *base;
base= sce->base.first;
while(base) {
- if(base->object == ob) return 1;
+ if(base->object == ob) return base;
base= base->next;
}
- return 0;
+ return NULL;
}
void set_scene_bg(Scene *sce)
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 5b98a3bf794..d81c0e94944 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -546,7 +546,7 @@ static void softbody_calc_forces(Object *ob, float forcetime)
/* check! */
do_deflector= is_there_deflection(ob->lay);
- do_effector= pdInitEffectors(ob);
+ do_effector= pdInitEffectors(ob, NULL);
iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
bproot= sb->bpoint; /* need this for proper spring addressing */