forked from bartvdbraak/blender
Fix two problems in my code as reported on Forums and in release article thread on frontpage:
* Quaternion action ipos accidently got swapped in the Ipo module * Ipos not editable if not linked to a datablock (was possible in 2.33a) Also fixed a typo in Object.getMatrix(): localespace -> localspace And I add: * channels Key 32 through Key 63 for relative vertex keys
This commit is contained in:
parent
012854ae93
commit
2ea5ce017e
@ -140,7 +140,10 @@ int cu_ar[CU_TOTIPO]= {
|
||||
int key_ar[KEY_TOTIPO]= {
|
||||
KEY_SPEED, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
|
||||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
|
||||
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
|
||||
54, 55, 56, 57, 58, 59, 60, 61, 62, 63
|
||||
};
|
||||
|
||||
int wo_ar[WO_TOTIPO]= {
|
||||
|
@ -578,7 +578,7 @@ void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, float ct
|
||||
{
|
||||
KeyBlock *kb;
|
||||
IpoCurve *icu;
|
||||
float fac[32], fval;
|
||||
float fac[KEY_TOTIPO], fval;
|
||||
int *ofsp, ofs[3], elemsize, a, b;
|
||||
char *cp, *poin, *reffrom, *from, elemstr[8];
|
||||
|
||||
|
@ -219,8 +219,8 @@ typedef short IPO_Channel;
|
||||
|
||||
/* ******************** */
|
||||
|
||||
#define KEY_TOTIPO 32
|
||||
#define KEY_TOTNAM 32
|
||||
#define KEY_TOTIPO 64
|
||||
#define KEY_TOTNAM 64
|
||||
|
||||
#define KEY_SPEED 0
|
||||
#define KEY_NR 1
|
||||
|
@ -207,10 +207,12 @@ M_Ipo_New (PyObject * self, PyObject * args)
|
||||
idcode = ID_TE;
|
||||
if (!strcmp (code, "Lamp"))
|
||||
idcode = ID_LA;
|
||||
/* if (!strcmp (code, "Constraint"))
|
||||
if (!strcmp (code, "Action"))
|
||||
idcode = ID_AC;
|
||||
if (!strcmp (code, "Constraint"))
|
||||
idcode = IPO_CO;
|
||||
if (!strcmp (code, "Sequence"))
|
||||
idcode = ID_SEQ;*/
|
||||
idcode = ID_SEQ;
|
||||
if (!strcmp (code, "Curve"))
|
||||
idcode = ID_CU;
|
||||
if (!strcmp (code, "Key"))
|
||||
@ -741,7 +743,7 @@ int Ipo_keIcuName(char *s, int * param)
|
||||
*param = KEY_SPEED;
|
||||
ok = 1;
|
||||
}
|
||||
for(nr = 1; nr<32; nr++) {
|
||||
for(nr = 1; nr<64; nr++) {
|
||||
sprintf(key, "Key %d", nr);
|
||||
if (!strcmp (s, key)) {
|
||||
*param = nr;
|
||||
@ -1133,153 +1135,6 @@ int Ipo_obIcuName(char * s, int * param)
|
||||
return ok;
|
||||
}
|
||||
|
||||
struct Lamp * Ipo_getIdLa(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->lamp.first;
|
||||
struct Lamp *la = 0;
|
||||
while(link)
|
||||
{
|
||||
la = (struct Lamp *)link;
|
||||
if(la->ipo == ipo) return la;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct Camera * Ipo_getIdCam(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->camera.first;
|
||||
struct Camera *cam = 0;
|
||||
while(link)
|
||||
{
|
||||
cam = (struct Camera *)link;
|
||||
if(cam->ipo == ipo) return cam;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct Tex * Ipo_getIdTex(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->tex.first;
|
||||
struct Tex *tex = 0;
|
||||
while(link)
|
||||
{
|
||||
tex = (struct Tex *)link;
|
||||
if(tex->ipo == ipo) return tex;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct Material * Ipo_getIdMat(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->mat.first;
|
||||
struct Material *mat = 0;
|
||||
while(link)
|
||||
{
|
||||
mat = (struct Material *)link;
|
||||
if(mat->ipo == ipo) return mat;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct World * Ipo_getIdWorld(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->world.first;
|
||||
struct World *wo = 0;
|
||||
while(link)
|
||||
{
|
||||
wo = (struct World *)link;
|
||||
if(wo->ipo == ipo) return wo;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* code unfinished, is c&p! */
|
||||
/*struct Object * Ipo_getIdCo(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->action.first;
|
||||
struct bAction *ac = 0;
|
||||
while(link)
|
||||
{
|
||||
ac = (struct bAction *)link;
|
||||
if(ac->ipo == ipo) return ac;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
struct bAction * Ipo_getIdAc(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->action.first;
|
||||
struct bAction *ac = 0;
|
||||
while(link)
|
||||
{
|
||||
ac = (struct bAction *)link;
|
||||
if(ac->ipo == ipo) return ac;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
struct Key * Ipo_getIdKe(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->key.first;
|
||||
struct Key *ke = 0;
|
||||
while(link)
|
||||
{
|
||||
ke = (struct Key *)link;
|
||||
if(ke->ipo == ipo) return ke;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct Curve * Ipo_getIdCu(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->curve.first;
|
||||
struct Curve *cu = 0;
|
||||
while(link)
|
||||
{
|
||||
cu = (struct Curve *)link;
|
||||
if(cu->ipo == ipo) return cu;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*struct Sequence * Ipo_getIdSeq(Ipo * ipo)
|
||||
{
|
||||
struct Editing *ed = 0;
|
||||
struct Sequence *seq = 0;
|
||||
|
||||
ed = G.scene->ed;
|
||||
if(ed==0) return 0;
|
||||
seq= ed->seqbasep->first;
|
||||
|
||||
while(seq)
|
||||
{
|
||||
if(seq->ipo == ipo) return seq;
|
||||
seq = seq->next;
|
||||
}
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
struct Object * Ipo_getIdObj(Ipo * ipo)
|
||||
{
|
||||
Link * link = G.main->object.first;
|
||||
struct Object *ob = 0;
|
||||
while(link)
|
||||
{
|
||||
ob = (struct Object *)link;
|
||||
if(ob->ipo == ipo) return ob;
|
||||
link = link->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
Ipo_addCurve (BPy_Ipo * self, PyObject * args)
|
||||
{
|
||||
@ -1324,81 +1179,48 @@ Ipo_addCurve (BPy_Ipo * self, PyObject * args)
|
||||
switch(ipo->blocktype) {
|
||||
case ID_OB:
|
||||
ok = Ipo_obIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
ob = Ipo_getIdObj(ipo);
|
||||
if(ob) icu = get_ipocurve (&(ob->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
case ID_CA:
|
||||
ok = Ipo_caIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
ca = Ipo_getIdCam(ipo);
|
||||
if(ca) icu = get_ipocurve (&(ca->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
case ID_LA:
|
||||
ok = Ipo_laIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
la = Ipo_getIdLa(ipo);
|
||||
if(la) icu = get_ipocurve (&(la->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
case ID_TE:
|
||||
ok = Ipo_texIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
tex = Ipo_getIdTex(ipo);
|
||||
if(tex) icu = get_ipocurve (&(tex->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
case ID_WO:
|
||||
ok = Ipo_woIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
wo = Ipo_getIdWorld(ipo);
|
||||
if(wo) icu = get_ipocurve (&(wo->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
case ID_MA:
|
||||
ok = Ipo_maIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
mat = Ipo_getIdMat(ipo);
|
||||
if(mat) icu = get_ipocurve (&(mat->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
/*case ID_AC:
|
||||
case ID_AC:
|
||||
ok = Ipo_acIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
ac = Ipo_getIdAc(ipo);
|
||||
if(ac) icu = get_ipocurve (&(ac->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
case IPO_CO:
|
||||
ok = Ipo_coIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
co = Ipo_getIdCo(ipo);
|
||||
if(co) icu = get_ipocurve (&(ac->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
break;*/
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
case ID_CU:
|
||||
ok = Ipo_cuIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
cu = Ipo_getIdCu(ipo);
|
||||
if(cu) icu = get_ipocurve (&(cu->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
case ID_KE:
|
||||
ok = Ipo_keIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
ke = Ipo_getIdKe(ipo);
|
||||
if(ke) icu = get_ipocurve (&(ke->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
/*case ID_SEQ:
|
||||
case ID_SEQ:
|
||||
ok = Ipo_seqIcuName(s, ¶m);
|
||||
if(ok) {
|
||||
seq = Ipo_getIdSeq(ipo);
|
||||
if(seq) icu = get_ipocurve (&(seq->id), ipo->blocktype, param, self->ipo );
|
||||
}
|
||||
break;*/
|
||||
icu = get_ipocurve (NULL, ipo->blocktype, param, self->ipo );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -952,7 +952,7 @@ static PyObject *Object_getMatrix (BPy_Object *self, PyObject *args)
|
||||
object_to_mat4(self->object, *((MatrixObject*)matrix)->matrix);
|
||||
} else {
|
||||
return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
|
||||
"correct spaces are 'worldspace' and 'localspace', none defaults to localespace"));
|
||||
"correct spaces are 'worldspace' and 'localspace', none defaults to 'localspace'"));
|
||||
}
|
||||
return matrix;
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ char *ob_ic_names[OB_TOTNAM] = { "LocX", "LocY", "LocZ", "dLocX", "dLocY", "dLoc
|
||||
"RotX", "RotY", "RotZ", "dRotX", "dRotY", "dRotZ",
|
||||
"SizeX", "SizeY", "SizeZ", "dSizeX", "dSizeY", "dSizeZ",
|
||||
"Layer", "Time", "ColR", "ColG", "ColB", "ColA",
|
||||
"FStreng", "FFall", "Damping", "RDamp", "Perm" };
|
||||
"FStreng", "FFall", "RDamp", "Damping", "Perm" };
|
||||
char *obeff_ic_names[3] = { "EffX", "EffY", "EffZ" };
|
||||
char *co_ic_names[CO_TOTNAM] = { "Inf" };
|
||||
char *mtex_ic_names[TEX_TOTNAM] = { "OfsX", "OfsY", "OfsZ", "SizeX", "SizeY", "SizeZ",
|
||||
@ -168,7 +168,13 @@ char *key_ic_names[KEY_TOTNAM] = { "Speed", "Key 1", "Key 2", "Key 3", "Key 4",
|
||||
"Key 16", "Key 17", "Key 18", "Key 19", "Key 20",
|
||||
"Key 21", "Key 22", "Key 23", "Key 24", "Key 25",
|
||||
"Key 26", "Key 27", "Key 28", "Key 29", "Key 30",
|
||||
"Key 31" };
|
||||
"Key 31", "Key 32", "Key 33", "Key 34", "Key 35",
|
||||
"Key 36", "Key 37", "Key 38", "Key 39", "Key 40",
|
||||
"Key 41", "Key 42", "Key 43", "Key 44", "Key 45",
|
||||
"Key 46", "Key 47", "Key 48", "Key 49", "Key 50",
|
||||
"Key 51", "Key 52", "Key 53", "Key 54", "Key 55",
|
||||
"Key 56", "Key 57", "Key 58", "Key 59", "Key 60",
|
||||
"Key 61", "Key 62", "Key 63"};
|
||||
char *wo_ic_names[WO_TOTNAM] = { "HorR", "HorG", "HorB", "ZenR", "ZenG", "ZenB", "Expos",
|
||||
"Misi", "MisDi", "MisSta", "MisHi", "StarR", "StarB",
|
||||
"StarG", "StarDi", "StarSi" };
|
||||
@ -177,7 +183,7 @@ char *la_ic_names[LA_TOTNAM] = { "Energ", "R", "G", "B", "Dist", "SpoSi", "SpoBl
|
||||
char *cam_ic_names[CAM_TOTNAM] = { "Lens", "ClSta", "ClEnd" };
|
||||
char *snd_ic_names[SND_TOTNAM] = { "Vol", "Pitch", "Pan", "Atten" };
|
||||
char *ac_ic_names[AC_TOTNAM] = {"LocX", "LocY", "LocZ", "SizeX", "SizeY",
|
||||
"SizeZ", "QuatX", "QuatY", "QuatZ", "QuatW"};
|
||||
"SizeZ", "QuatW", "QuatX", "QuatY", "QuatZ"};
|
||||
char *ic_name_empty[1] ={ "" };
|
||||
|
||||
char *getname_ac_ei(int nr) {
|
||||
@ -265,7 +271,7 @@ char *getname_cu_ei(int nr)
|
||||
|
||||
char *getname_key_ei(int nr)
|
||||
{
|
||||
if(nr>=KEY_SPEED && nr<=31) return key_ic_names[nr];
|
||||
if(nr>=KEY_SPEED && nr<KEY_TOTNAM) return key_ic_names[nr];
|
||||
return ic_name_empty[0];
|
||||
}
|
||||
|
||||
@ -382,10 +388,10 @@ void editipo_changed(SpaceIpo *si, int doredraw)
|
||||
KeyBlock *kb;
|
||||
int a, first=1;
|
||||
|
||||
|
||||
ei= si->editipo;
|
||||
if(ei==0)
|
||||
return;
|
||||
|
||||
|
||||
for(a=0; a<si->totipo; a++, ei++) {
|
||||
|
||||
@ -407,6 +413,7 @@ void editipo_changed(SpaceIpo *si, int doredraw)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
v2d= &(si->v2d);
|
||||
|
||||
@ -421,7 +428,6 @@ void editipo_changed(SpaceIpo *si, int doredraw)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* is there no curve? */
|
||||
if(first) {
|
||||
v2d->tot.xmin= 0.0;
|
||||
@ -2044,7 +2050,7 @@ void add_vert_ipo()
|
||||
/* to be sure: if icu was 0, or only 1 curve visible */
|
||||
ei->flag |= IPO_SELECT;
|
||||
ei->icu->flag= ei->flag;
|
||||
|
||||
|
||||
editipo_changed(G.sipo, 1);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,11 @@
|
||||
extern ListBase editNurb; /* in editcurve.c */
|
||||
|
||||
/* temporary storage for slider values */
|
||||
float meshslidervals[32] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
float meshslidervals[64] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
|
||||
@ -254,7 +258,11 @@ void make_rvk_slider(uiBlock *block, Key *key, int keynum,
|
||||
static int keynums[] = {0,1,2,3,4,5,6,7,
|
||||
8,9,10,11,12,13,14,15,
|
||||
16,17,18,19,20,21,22,23,
|
||||
24,25,26,27,28,29,30,31};
|
||||
24,25,26,27,28,29,30,31,
|
||||
32,33,34,35,36,37,38,39,
|
||||
40,41,42,43,44,45,46,47,
|
||||
48,49,50,51,52,53,54,55,
|
||||
56,57,58,59,60,61,62,63};
|
||||
|
||||
meshslidervals[keynum] = getrvkval(key, keynum);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user