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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-03-25 12:20:19 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-03-25 12:20:19 +0400
commit3b711a6ed009b35bb69cd0ca878eeb8d55fa0e77 (patch)
treeb3fdb366cb49bdea5b57dfa6ba4a82635c68d0ee /source/blender/blenkernel/intern/group.c
parenta2ebfc82dbe954acc432ae017ac62a30a11b6a16 (diff)
parente99a23fc6b33b5097eab44aac19c2a089ddebce6 (diff)
Merged changes in the trunk up to revision 45133.
Conflicts resolved: source/blender/blenloader/intern/readfile.c source/blender/blenloader/intern/writefile.c source/blender/bmesh/intern/bmesh_construct.c source/blender/bmesh/intern/bmesh_mesh_conv.c source/blender/bmesh/intern/bmesh_mesh_conv.h source/blender/editors/interface/interface_templates.c source/blender/editors/interface/resources.c source/blender/editors/mesh/bmesh_select.c source/blender/editors/mesh/bmesh_tools.c source/blender/editors/space_view3d/drawobject.c source/blender/render/intern/source/shadeoutput.c
Diffstat (limited to 'source/blender/blenkernel/intern/group.c')
-rw-r--r--source/blender/blenkernel/intern/group.c136
1 files changed, 68 insertions, 68 deletions
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 00ec9ba0345..cf0538b4395 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -66,7 +66,7 @@ void free_group_objects(Group *group)
/* don't free group itself */
GroupObject *go;
- while(group->gobject.first) {
+ while (group->gobject.first) {
go= group->gobject.first;
BLI_remlink(&group->gobject, go);
free_group_object(go);
@@ -83,26 +83,26 @@ void unlink_group(Group *group)
FreestyleLineSet *lineset;
ParticleSystem *psys;
- for(ma= bmain->mat.first; ma; ma= ma->id.next) {
- if(ma->group==group)
+ for (ma= bmain->mat.first; ma; ma= ma->id.next) {
+ if (ma->group==group)
ma->group= NULL;
}
- for(ma= bmain->mat.first; ma; ma= ma->id.next) {
- if(ma->group==group)
+ for (ma= bmain->mat.first; ma; ma= ma->id.next) {
+ if (ma->group==group)
ma->group= NULL;
}
for (sce= bmain->scene.first; sce; sce= sce->id.next) {
Base *base= sce->base.first;
/* ensure objects are not in this group */
- for(; base; base= base->next) {
- if(rem_from_group(group, base->object, sce, base) && find_group(base->object, NULL)==NULL) {
+ for (; base; base= base->next) {
+ if (rem_from_group(group, base->object, sce, base) && find_group(base->object, NULL)==NULL) {
base->object->flag &= ~OB_FROMGROUP;
base->flag &= ~OB_FROMGROUP;
}
}
- for(srl= sce->r.layers.first; srl; srl= srl->next) {
+ for (srl= sce->r.layers.first; srl; srl= srl->next) {
if (srl->light_override==group)
srl->light_override= NULL;
@@ -113,27 +113,27 @@ void unlink_group(Group *group)
}
}
- for(ob= bmain->object.first; ob; ob= ob->id.next) {
+ for (ob= bmain->object.first; ob; ob= ob->id.next) {
- if(ob->dup_group==group) {
+ if (ob->dup_group==group) {
ob->dup_group= NULL;
#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */
{
bActionStrip *strip;
/* duplicator strips use a group object, we remove it */
- for(strip= ob->nlastrips.first; strip; strip= strip->next) {
- if(strip->object)
+ for (strip= ob->nlastrips.first; strip; strip= strip->next) {
+ if (strip->object)
strip->object= NULL;
}
}
#endif
}
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->part->dup_group==group)
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
+ if (psys->part->dup_group==group)
psys->part->dup_group= NULL;
#if 0 /* not used anymore, only keps for readfile.c, no need to account for this */
- if(psys->part->eff_group==group)
+ if (psys->part->eff_group==group)
psys->part->eff_group= NULL;
#endif
}
@@ -168,11 +168,11 @@ static int add_to_group_internal(Group *group, Object *ob)
{
GroupObject *go;
- if(group==NULL || ob==NULL) return 0;
+ if (group==NULL || ob==NULL) return 0;
/* check if the object has been added already */
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob==ob) return 0;
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob==ob) return 0;
}
go= MEM_callocN(sizeof(GroupObject), "groupobject");
@@ -185,15 +185,15 @@ static int add_to_group_internal(Group *group, Object *ob)
int add_to_group(Group *group, Object *object, Scene *scene, Base *base)
{
- if(add_to_group_internal(group, object)) {
- if((object->flag & OB_FROMGROUP)==0) {
+ if (add_to_group_internal(group, object)) {
+ if ((object->flag & OB_FROMGROUP)==0) {
- if(scene && base==NULL)
+ if (scene && base==NULL)
base= object_in_scene(object, scene);
object->flag |= OB_FROMGROUP;
- if(base)
+ if (base)
base->flag |= OB_FROMGROUP;
}
return 1;
@@ -208,12 +208,12 @@ static int rem_from_group_internal(Group *group, Object *ob)
{
GroupObject *go, *gon;
int removed = 0;
- if(group==NULL) return 0;
+ if (group==NULL) return 0;
go= group->gobject.first;
- while(go) {
+ while (go) {
gon= go->next;
- if(go->ob==ob) {
+ if (go->ob==ob) {
BLI_remlink(&group->gobject, go);
free_group_object(go);
removed = 1;
@@ -226,15 +226,15 @@ static int rem_from_group_internal(Group *group, Object *ob)
int rem_from_group(Group *group, Object *object, Scene *scene, Base *base)
{
- if(rem_from_group_internal(group, object)) {
+ if (rem_from_group_internal(group, object)) {
/* object can be NULL */
- if(object && find_group(object, NULL) == NULL) {
- if(scene && base==NULL)
+ if (object && find_group(object, NULL) == NULL) {
+ if (scene && base==NULL)
base= object_in_scene(object, scene);
object->flag &= ~OB_FROMGROUP;
- if(base)
+ if (base)
base->flag &= ~OB_FROMGROUP;
}
return 1;
@@ -248,10 +248,10 @@ int object_in_group(Object *ob, Group *group)
{
GroupObject *go;
- if(group==NULL || ob==NULL) return 0;
+ if (group==NULL || ob==NULL) return 0;
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob==ob)
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob==ob)
return 1;
}
return 0;
@@ -264,8 +264,8 @@ Group *find_group(Object *ob, Group *group)
else
group= G.main->group.first;
- while(group) {
- if(object_in_group(ob, group))
+ while (group) {
+ if (object_in_group(ob, group))
return group;
group= group->id.next;
}
@@ -276,10 +276,10 @@ void group_tag_recalc(Group *group)
{
GroupObject *go;
- if(group==NULL) return;
+ if (group==NULL) return;
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob)
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob)
go->ob->recalc= go->recalc;
}
}
@@ -289,12 +289,12 @@ int group_is_animated(Object *UNUSED(parent), Group *group)
GroupObject *go;
#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */
- if(parent->nlastrips.first)
+ if (parent->nlastrips.first)
return 1;
#endif
- for(go= group->gobject.first; go; go= go->next)
- if(go->ob && go->ob->proxy)
+ for (go= group->gobject.first; go; go= go->next)
+ if (go->ob && go->ob->proxy)
return 1;
return 0;
@@ -310,11 +310,11 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
static int done= 0;
bActionStrip *strip, *nstrip;
- if(mode=='s') {
+ if (mode=='s') {
- for(strip= parent->nlastrips.first; strip; strip= strip->next) {
- if(strip->object==target) {
- if(done==0) {
+ for (strip= parent->nlastrips.first; strip; strip= strip->next) {
+ if (strip->object==target) {
+ if (done==0) {
/* clear nla & action from object */
nlastrips= target->nlastrips;
target->nlastrips.first= target->nlastrips.last= NULL;
@@ -328,8 +328,8 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
}
}
}
- else if(mode=='e') {
- if(done) {
+ else if (mode=='e') {
+ if (done) {
BLI_freelistN(&target->nlastrips);
target->nlastrips= nlastrips;
target->action= action;
@@ -350,21 +350,21 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group
{
GroupObject *go;
-#if 0 /* warning, isnt clearing the recalc flag on the object which causes it to run all the time,
+#if 0 /* warning, isn't clearing the recalc flag on the object which causes it to run all the time,
* not just on frame change.
- * This isnt working because the animation data is only re-evalyated on frame change so commenting for now
+ * This isn't working because the animation data is only re-evalyated on frame change so commenting for now
* but when its enabled at some point it will need to be changed so as not to update so much - campbell */
/* if animated group... */
- if(parent->nlastrips.first) {
+ if (parent->nlastrips.first) {
int cfrao;
/* switch to local time */
cfrao= scene->r.cfra;
/* we need a DAG per group... */
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob && go->recalc) {
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob && go->recalc) {
go->ob->recalc= go->recalc;
group_replaces_nla(parent, go->ob, 's');
@@ -383,9 +383,9 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group
#endif
{
/* only do existing tags, as set by regular depsgraph */
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob) {
- if(go->ob->recalc) {
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob) {
+ if (go->ob->recalc) {
object_handle_update(scene, go->ob);
}
}
@@ -398,17 +398,17 @@ Object *group_get_member_with_action(Group *group, bAction *act)
{
GroupObject *go;
- if(group==NULL || act==NULL) return NULL;
+ if (group==NULL || act==NULL) return NULL;
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob) {
- if(go->ob->action==act)
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob) {
+ if (go->ob->action==act)
return go->ob;
- if(go->ob->nlastrips.first) {
+ if (go->ob->nlastrips.first) {
bActionStrip *strip;
- for(strip= go->ob->nlastrips.first; strip; strip= strip->next) {
- if(strip->act==act)
+ for (strip= go->ob->nlastrips.first; strip; strip= strip->next) {
+ if (strip->act==act)
return go->ob;
}
}
@@ -425,18 +425,18 @@ void group_relink_nla_objects(Object *ob)
GroupObject *go;
bActionStrip *strip;
- if(ob==NULL || ob->dup_group==NULL) return;
+ if (ob==NULL || ob->dup_group==NULL) return;
group= ob->dup_group;
- for(strip= ob->nlastrips.first; strip; strip= strip->next) {
- if(strip->object) {
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob) {
- if(strcmp(go->ob->id.name, strip->object->id.name)==0)
+ for (strip= ob->nlastrips.first; strip; strip= strip->next) {
+ if (strip->object) {
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob) {
+ if (strcmp(go->ob->id.name, strip->object->id.name)==0)
break;
}
}
- if(go)
+ if (go)
strip->object= go->ob;
else
strip->object= NULL;