return 0;
}
- else if(ob->constraints.first) ob->recalc |= OB_RECALC_OB;
+static void dag_object_time_update_flags(Object *ob)
+{
+
+ if(ob->ipo) ob->recalc |= OB_RECALC_OB;
++ else if(ob->constraints.first) {
++ bConstraint *con;
++ for (con = ob->constraints.first; con; con=con->next){
++ if (constraint_has_target(con)) {
++ ob->recalc |= OB_RECALC_OB;
++ break;
++ }
++ }
++ }
+ else if(ob->scriptlink.totscript) ob->recalc |= OB_RECALC_OB;
+ else if(ob->parent) {
+ /* motion path or bone child */
+ if(ob->parent->type==OB_CURVE || ob->parent->type==OB_ARMATURE) ob->recalc |= OB_RECALC_OB;
+ }
+
+ if(ob->action || ob->nlastrips.first) {
+ /* since actions now are mixed, we set the recalcs on the safe side */
+ ob->recalc |= OB_RECALC_OB;
+ if(ob->type==OB_ARMATURE)
+ ob->recalc |= OB_RECALC_DATA;
+ else if(exists_channel(ob, "Shape"))
+ ob->recalc |= OB_RECALC_DATA;
+ else if(ob->dup_group) {
+ bActionStrip *strip;
+ /* this case is for groups with nla, whilst nla target has no action or nla */
+ for(strip= ob->nlastrips.first; strip; strip= strip->next) {
+ if(strip->object)
+ strip->object->recalc |= OB_RECALC;
+ }
+ }
+ }
+ else if(modifiers_isSoftbodyEnabled(ob)) ob->recalc |= OB_RECALC_DATA;
+ else if(object_modifiers_use_time(ob)) ob->recalc |= OB_RECALC_DATA;
+ else {
+ Mesh *me;
+ Curve *cu;
+ Lattice *lt;
+
+ switch(ob->type) {
+ case OB_MESH:
+ me= ob->data;
+ if(me->key) {
+ if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
+ ob->recalc |= OB_RECALC_DATA;
+ ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
+ }
+ }
+ else if(ob->effect.first) {
+ Effect *eff= ob->effect.first;
+ PartEff *paf= give_parteff(ob);
+
+ if(eff->type==EFF_WAVE)
+ ob->recalc |= OB_RECALC_DATA;
+ if(paf && paf->keys==NULL)
+ ob->recalc |= OB_RECALC_DATA;
+ }
+ if((ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (ob->fluidsimSettings)) {
+ // fluidsimSettings might not be initialized during load...
+ if(ob->fluidsimSettings->type & OB_FLUIDSIM_DOMAIN) {
+ ob->recalc |= OB_RECALC_DATA; // NT
+ }
+ }
+ break;
+ case OB_CURVE:
+ case OB_SURF:
+ cu= ob->data;
+ if(cu->key) {
+ if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
+ ob->recalc |= OB_RECALC_DATA;
+ ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
+ }
+ }
+ break;
+ case OB_LATTICE:
+ lt= ob->data;
+ if(lt->key) {
+ if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
+ ob->recalc |= OB_RECALC_DATA;
+ ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
+ }
+ }
+ break;
+ case OB_MBALL:
+ if(ob->transflag & OB_DUPLI) ob->recalc |= OB_RECALC_DATA;
+ break;
+ }
+ }
+}
+
/* flag all objects that need recalc, for changes in time for example */
void DAG_scene_update_flags(Scene *sce, unsigned int lay)
{
ma->strand_sta= ma->strand_end= 1.0f;
ma->mode |= MA_TANGENT_STR;
}
- /* remove this test before 2.41! pad is set to denote check was done */
- if(ma->pad==0) {
- if(ma->mode & MA_TRACEBLE) ma->mode |= MA_SHADBUF;
- ma->pad= 1;
- }
+ if(ma->mode & MA_TRACEBLE) ma->mode |= MA_SHADBUF;
-
- /* orange stuff, so should be done for 2.40 too */
- if(ma->layers.first==NULL) {
- ma->ml_flag= ML_RENDER;
- }
}
}
#define BIF_MESHTOOLS_H
struct Object;
+struct EditVert;
- extern void join_mesh(void);
+ extern int join_mesh(void);
extern void fasterdraw(void);
extern void slowerdraw(void);
extern void set_rects_butspace(struct SpaceButs *buts);
extern void test_butspace(void);
extern void start_game(void);
-extern void select_group_menu(void);
+extern void select_grouped(short nr);
+ extern void join_menu(void);
-extern void select_group(short nr);
extern void BIF_undo_push(char *str);
extern void BIF_undo(void);
#include "BKE_curve.h"
#include "BKE_global.h"
#include "BKE_main.h"
-#include "BIF_editview.h"
+ #include "BKE_scene.h"
+
#include "BSE_editipo.h"
#include "BSE_edit.h"
+
#include "BIF_space.h"
-#include "DNA_oops_types.h"
+#include "BIF_editview.h"
+ #include "BIF_drawscene.h"
+ #include "BIF_meshtools.h"
+ #include "BIF_editarmature.h"
+
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
+
#include "BDR_editobject.h"
-#include "BDR_editcurve.h"
+
#include "MEM_guardedalloc.h"
+
#include "mydevice.h"
#include "blendef.h"
#include "Scene.h"
fact= Tnor*tex->norfac;
if(fact>1.0) fact= 1.0; else if(fact<-1.0) fact= -1.0;
facm= 1.0- fact;
- shi->vn[0]= facm*shi->vn[0] + fact*texres.nor[0];
- shi->vn[1]= facm*shi->vn[1] + fact*texres.nor[1];
- shi->vn[2]= facm*shi->vn[2] + fact*texres.nor[2];
+ if(shi->mat->mode & MA_TANGENT_V) {
+ shi->tang[0]= facm*shi->tang[0] + fact*texres.nor[0];
+ shi->tang[1]= facm*shi->tang[1] + fact*texres.nor[1];
+ shi->tang[2]= facm*shi->tang[2] + fact*texres.nor[2];
+ }
+ else {
+ shi->vn[0]= facm*shi->vn[0] + fact*texres.nor[0];
+ shi->vn[1]= facm*shi->vn[1] + fact*texres.nor[1];
+ shi->vn[2]= facm*shi->vn[2] + fact*texres.nor[2];
+ }
}
else {
- float nor[3], dot;
-
- /* prevent bump to become negative normal */
- nor[0]= Tnor*tex->norfac*texres.nor[0];
- nor[1]= Tnor*tex->norfac*texres.nor[1];
- nor[2]= Tnor*tex->norfac*texres.nor[2];
-
- dot= 0.5f + 0.5f*INPR(nor, shi->vn);
+ if(shi->mat->mode & MA_TANGENT_V) {
+ shi->tang[0]+= Tnor*tex->norfac*texres.nor[0];
+ shi->tang[1]+= Tnor*tex->norfac*texres.nor[1];
+ shi->tang[2]+= Tnor*tex->norfac*texres.nor[2];
+ }
+ else {
- shi->vn[0]+= Tnor*tex->norfac*texres.nor[0];
- shi->vn[1]+= Tnor*tex->norfac*texres.nor[1];
- shi->vn[2]+= Tnor*tex->norfac*texres.nor[2];
++ float nor[3], dot;
+
- shi->vn[0]+= dot*nor[0];
- shi->vn[1]+= dot*nor[1];
- shi->vn[2]+= dot*nor[2];
++ /* prevent bump to become negative normal */
++ nor[0]= Tnor*tex->norfac*texres.nor[0];
++ nor[1]= Tnor*tex->norfac*texres.nor[1];
++ nor[2]= Tnor*tex->norfac*texres.nor[2];
++
++ dot= 0.5f + 0.5f*INPR(nor, shi->vn);
++
++ shi->vn[0]+= dot*nor[0];
++ shi->vn[1]+= dot*nor[1];
++ shi->vn[2]+= dot*nor[2];
+ }
}
Normalise(shi->vn);
nr= pupmenu(str);
MEM_freeN(str);
- select_group(nr);
+ select_grouped(nr);
}
+ void join_menu(void)
+ {
+ Object *ob= OBACT;
+ if (ob && !G.obedit) {
+ if(ob->type == OB_MESH) {
+ if(okee("Join selected meshes")==0) return;
+ join_mesh();
+ } else if(ob->type == OB_CURVE) {
+ if(okee("Join selected curves")==0) return;
+ join_curve(OB_CURVE);
+ } else if(ob->type == OB_SURF) {
+ if(okee("Join selected NURBS")==0) return;
+ join_curve(OB_SURF);
+ } else if(ob->type == OB_ARMATURE) {
+ /* Make sure the user wants to continue*/
+ if(okee("Join selected armatures")==0) return;
+ join_armature ();
+ }
+ }
+ }
-void select_group(short nr)
-{
- Base *base;
-
- if(nr==4) {
- base= FIRSTBASE;
- while(base) {
- if (base->lay & OBACT->lay) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- }
- base= base->next;
- }
- }
- else if(nr==2) select_children(OBACT, 0);
- else if(nr==1) select_children(OBACT, 1);
- else if(nr==3) select_parent();
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-
-
-
-
-
static unsigned short convert_for_nonumpad(unsigned short event)
{
if (event>=ZEROKEY && event<=NINEKEY) {