forked from bartvdbraak/blender
remove redundant assignments & unused vars.
also minor functional changes - OBJECT_OT_make_links_data() type property is now assigned to the operator property (so popup menu can find it) - removing BG image now returns cancelled if no image is removed.
This commit is contained in:
parent
21fc4cabaf
commit
63018144ba
@ -140,7 +140,7 @@ int BLF_load(const char *name)
|
||||
/* check if we already load this font. */
|
||||
i= blf_search(name);
|
||||
if (i >= 0) {
|
||||
font= global_font[i];
|
||||
/*font= global_font[i];*/ /*UNUSED*/
|
||||
return(i);
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
|
||||
|
||||
i= blf_search(name);
|
||||
if (i >= 0) {
|
||||
font= global_font[i];
|
||||
/*font= global_font[i];*/ /*UNUSED*/
|
||||
return(i);
|
||||
}
|
||||
|
||||
|
@ -1795,7 +1795,6 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
|
||||
dl->rt= nu->flag & ~CU_2D;
|
||||
|
||||
dl->bevelSplitFlag= MEM_callocN(sizeof(*dl->col2)*((bl->nr+0x1F)>>5), "bevelSplitFlag");
|
||||
bevp= (BevPoint *)(bl+1);
|
||||
|
||||
/* for each point of poly make a bevel piece */
|
||||
bevp= (BevPoint *)(bl+1);
|
||||
|
@ -696,7 +696,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
|
||||
|
||||
// Create unicode string
|
||||
utf8len = utf8slen(cu->str);
|
||||
tmp = mem = MEM_callocN(((utf8len + 1) * sizeof(wchar_t)), "convertedmem");
|
||||
mem = MEM_callocN(((utf8len + 1) * sizeof(wchar_t)), "convertedmem");
|
||||
|
||||
utf8towchar(mem, cu->str);
|
||||
|
||||
|
@ -914,10 +914,10 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix)
|
||||
}
|
||||
|
||||
if (scene->r.stamp & R_STAMP_TIME) {
|
||||
int h, m, s, f;
|
||||
h= m= s= f= 0;
|
||||
f = (int)(scene->r.cfra % scene->r.frs_sec);
|
||||
s = (int)(scene->r.cfra / scene->r.frs_sec);
|
||||
int f = (int)(scene->r.cfra % scene->r.frs_sec);
|
||||
int s = (int)(scene->r.cfra / scene->r.frs_sec);
|
||||
int h= 0;
|
||||
int m= 0;
|
||||
|
||||
if (s) {
|
||||
m = (int)(s / 60);
|
||||
|
@ -1229,7 +1229,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
|
||||
float vel[3];
|
||||
float k = 0.0f;
|
||||
float L = s->restlen;
|
||||
float cb = clmd->sim_parms->structural;
|
||||
float cb; /* = clmd->sim_parms->structural; */ /*UNUSED*/
|
||||
|
||||
float nullf[3] = {0,0,0};
|
||||
float stretch_force[3] = {0,0,0};
|
||||
@ -1566,7 +1566,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
|
||||
float tm2[3][3] = {{0}};
|
||||
MFace *mfaces = cloth->mfaces;
|
||||
unsigned int numverts = cloth->numverts;
|
||||
LinkNode *search = cloth->springs;
|
||||
LinkNode *search;
|
||||
lfVector *winvec;
|
||||
EffectedPoint epoint;
|
||||
|
||||
|
@ -2847,7 +2847,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
|
||||
ParticleEditSettings *pset = &sim->scene->toolsettings->particle;
|
||||
ParticleSystem *psys = sim->psys;
|
||||
ParticleSettings *part = psys->part;
|
||||
ParticleCacheKey *ca, **cache= psys->pathcache;
|
||||
ParticleCacheKey *ca, **cache;
|
||||
|
||||
DerivedMesh *hair_dm = (psys->part->type==PART_HAIR && psys->flag & PSYS_HAIR_DYNAMICS) ? psys->hair_out_dm : NULL;
|
||||
|
||||
|
@ -2025,8 +2025,6 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
|
||||
PTCacheMem *pm= pid->cache->mem_cache.first;
|
||||
PTCacheMem *link= NULL;
|
||||
|
||||
pm= pid->cache->mem_cache.first;
|
||||
|
||||
if(mode == PTCACHE_CLEAR_ALL) {
|
||||
/*we want startframe if the cache starts before zero*/
|
||||
pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
|
||||
@ -2207,8 +2205,6 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
|
||||
else {
|
||||
PTCacheMem *pm= pid->cache->mem_cache.first;
|
||||
|
||||
pm= pid->cache->mem_cache.first;
|
||||
|
||||
while(pm) {
|
||||
if(pm->frame >= sta && pm->frame <= end)
|
||||
cache->cached_frames[pm->frame-sta] = 1;
|
||||
|
@ -410,7 +410,7 @@ int BLI_isGraphCyclic(BGraph *graph)
|
||||
|
||||
BArc * BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v)
|
||||
{
|
||||
BArc *nextArc = arc->next;
|
||||
BArc *nextArc;
|
||||
|
||||
for(nextArc = graph->arcs.first; nextArc; nextArc = nextArc->next)
|
||||
{
|
||||
|
@ -1691,7 +1691,7 @@ void generateMissingArcsFromNode(RigGraph *rigg, ReebNode *node, int multi_level
|
||||
|
||||
void generateMissingArcs(RigGraph *rigg)
|
||||
{
|
||||
ReebGraph *reebg = rigg->link_mesh;
|
||||
ReebGraph *reebg;
|
||||
int multi_level_limit = 5;
|
||||
|
||||
for (reebg = rigg->link_mesh; reebg; reebg = reebg->link_up)
|
||||
|
@ -2194,7 +2194,7 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
/* loop over selection segments of a curve, smooth each */
|
||||
|
||||
/* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
|
||||
start_sel = end_sel = -1;
|
||||
start_sel = -1;
|
||||
for(bezt=nu->bezt+last_sel, a=last_sel; a<nu->pntsu; a++, bezt++) {
|
||||
if(bezt->f2 & SELECT) {
|
||||
start_sel = a;
|
||||
@ -2256,7 +2256,7 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
/* loop over selection segments of a curve, smooth each */
|
||||
|
||||
/* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
|
||||
start_sel = end_sel = -1;
|
||||
start_sel = -1;
|
||||
for(bp=nu->bp+last_sel, a=last_sel; a<nu->pntsu; a++, bp++) {
|
||||
if(bp->f1 & SELECT) {
|
||||
start_sel = a;
|
||||
|
@ -3461,7 +3461,7 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
|
||||
if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
|
||||
CurveMapping *cumap= (CurveMapping*)but->poin;
|
||||
CurveMap *cuma= cumap->cm+cumap->cur;
|
||||
CurveMapPoint *cmp= cuma->curve;
|
||||
CurveMapPoint *cmp;
|
||||
float fx, fy, zoomx, zoomy, offsx, offsy;
|
||||
float dist, mindist= 200.0f; // 14 pixels radius
|
||||
int sel= -1;
|
||||
|
@ -2334,7 +2334,6 @@ static void do_running_jobs(bContext *C, void *UNUSED(arg), int event)
|
||||
void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
|
||||
{
|
||||
bScreen *screen= CTX_wm_screen(C);
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
wmWindowManager *wm= CTX_wm_manager(C);
|
||||
ScrArea *sa= CTX_wm_area(C);
|
||||
uiBlock *block;
|
||||
@ -2352,6 +2351,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
|
||||
handle_event= B_STOPCOMPO;
|
||||
}
|
||||
else {
|
||||
Scene *scene;
|
||||
/* another scene can be rendering too, for example via compositor */
|
||||
for(scene= CTX_data_main(C)->scene.first; scene; scene= scene->id.next)
|
||||
if(WM_jobs_test(wm, scene))
|
||||
|
@ -466,7 +466,7 @@ static void ui_theme_init_new(bTheme *btheme)
|
||||
*/
|
||||
void ui_theme_init_default(void)
|
||||
{
|
||||
bTheme *btheme= U.themes.first;
|
||||
bTheme *btheme;
|
||||
|
||||
/* we search for the theme with name Default */
|
||||
for(btheme= U.themes.first; btheme; btheme= btheme->next) {
|
||||
|
@ -86,8 +86,6 @@ void make_editLatt(Object *obedit)
|
||||
|
||||
free_editLatt(obedit);
|
||||
|
||||
lt= obedit->data;
|
||||
|
||||
actkey= ob_get_keyblock(obedit);
|
||||
if(actkey)
|
||||
key_to_latt(actkey, lt);
|
||||
|
@ -1338,8 +1338,6 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot)
|
||||
{MAKE_LINKS_MODIFIERS, "MODIFIERS", 0, "Modifiers", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* identifiers */
|
||||
ot->name= "Link Data";
|
||||
ot->description = "Make links from the active object to other selected objects";
|
||||
@ -1353,7 +1351,7 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
prop= RNA_def_enum(ot->srna, "type", make_links_items, 0, "Type", "");
|
||||
ot->prop= RNA_def_enum(ot->srna, "type", make_links_items, 0, "Type", "");
|
||||
}
|
||||
|
||||
|
||||
@ -1464,7 +1462,8 @@ void single_obdata_users(Main *bmain, Scene *scene, int flag)
|
||||
ob->data= copy_camera(ob->data);
|
||||
break;
|
||||
case OB_MESH:
|
||||
me= ob->data= copy_mesh(ob->data);
|
||||
ob->data= copy_mesh(ob->data);
|
||||
//me= ob->data;
|
||||
//if(me && me->key)
|
||||
// ipo_idnew(me->key->ipo); /* drivers */
|
||||
break;
|
||||
|
@ -639,9 +639,8 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float
|
||||
}
|
||||
}
|
||||
else {
|
||||
xi = (int)((uv[0]*ibuf->x) + 0.5f);
|
||||
yi = (int)((uv[1]*ibuf->y) + 0.5f);
|
||||
|
||||
//xi = (int)((uv[0]*ibuf->x) + 0.5f);
|
||||
//yi = (int)((uv[1]*ibuf->y) + 0.5f);
|
||||
//if (xi<0 || xi>=ibuf->x || yi<0 || yi>=ibuf->y) return 0;
|
||||
|
||||
/* wrap */
|
||||
|
@ -1430,7 +1430,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
|
||||
Object *ob;
|
||||
Mesh *me;
|
||||
float mat[4][4];
|
||||
float paintweight= ts->vgroup_weight;
|
||||
float paintweight;
|
||||
int *indexar;
|
||||
int totindex, index, totw, flip;
|
||||
float alpha;
|
||||
|
@ -442,7 +442,6 @@ static void insert_action_keys(bAnimContext *ac, short mode)
|
||||
|
||||
ReportList *reports = ac->reports;
|
||||
Scene *scene= ac->scene;
|
||||
float cfra= (float)CFRA;
|
||||
short flag = 0;
|
||||
|
||||
/* filter data */
|
||||
@ -459,6 +458,7 @@ static void insert_action_keys(bAnimContext *ac, short mode)
|
||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
||||
FCurve *fcu= (FCurve *)ale->key_data;
|
||||
float cfra;
|
||||
|
||||
/* adjust current frame for NLA-scaling */
|
||||
if (adt)
|
||||
|
@ -280,12 +280,12 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon,
|
||||
{
|
||||
uiBut *but;
|
||||
float x,y;
|
||||
float alpha=1.0f;
|
||||
/*float alpha=1.0f;*/
|
||||
|
||||
x = (float)(sx);
|
||||
y = (float)(sy-height);
|
||||
|
||||
if (icon == ICON_FILE_BLANK) alpha = 0.375f;
|
||||
/*if (icon == ICON_FILE_BLANK) alpha = 0.375f;*/
|
||||
|
||||
but= uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiButSetDragPath(but, path);
|
||||
|
@ -410,7 +410,6 @@ static void insert_graph_keys(bAnimContext *ac, short mode)
|
||||
|
||||
ReportList *reports = ac->reports;
|
||||
Scene *scene= ac->scene;
|
||||
float cfra= (float)CFRA;
|
||||
short flag = 0;
|
||||
|
||||
/* filter data */
|
||||
@ -426,6 +425,7 @@ static void insert_graph_keys(bAnimContext *ac, short mode)
|
||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
||||
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
|
||||
FCurve *fcu= (FCurve *)ale->key_data;
|
||||
float cfra;
|
||||
|
||||
/* adjust current frame for NLA-mapping */
|
||||
if (adt)
|
||||
|
@ -438,7 +438,6 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
SpaceImage *sima;
|
||||
ARegion *ar;
|
||||
Scene *scene;
|
||||
Object *obedit;
|
||||
float aspx, aspy, zoomx, zoomy, w, h;
|
||||
int width, height;
|
||||
@ -446,7 +445,6 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
/* retrieve state */
|
||||
sima= CTX_wm_space_image(C);
|
||||
ar= CTX_wm_region(C);
|
||||
scene= (Scene*)CTX_data_scene(C);
|
||||
obedit= CTX_data_edit_object(C);
|
||||
|
||||
ED_space_image_size(sima, &width, &height);
|
||||
@ -2030,7 +2028,7 @@ static int record_composite_exec(bContext *C, wmOperator *op)
|
||||
|
||||
static int record_composite_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
|
||||
{
|
||||
RecordCompositeData *rcd= op->customdata;
|
||||
RecordCompositeData *rcd;
|
||||
|
||||
if(!record_composite_init(C, op))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
@ -586,13 +586,13 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
|
||||
MTFace *tf;
|
||||
|
||||
if(em && EM_texFaceCheck(em)) {
|
||||
sima->image= ima= NULL;
|
||||
sima->image= NULL;
|
||||
|
||||
tf = EM_get_active_mtface(em, NULL, NULL, 1); /* partially selected face is ok */
|
||||
|
||||
if(tf && (tf->mode & TF_TEX)) {
|
||||
/* don't need to check for pin here, see above */
|
||||
sima->image= ima= tf->tpage;
|
||||
sima->image= tf->tpage;
|
||||
|
||||
if(sima->flag & SI_EDITTILE);
|
||||
else sima->curtile= tf->tile;
|
||||
|
@ -201,7 +201,6 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
|
||||
|
||||
Sequence *seq; /* generic strip vars */
|
||||
Strip *strip;
|
||||
StripElem *se;
|
||||
|
||||
int start_frame, channel; /* operator props */
|
||||
|
||||
@ -227,7 +226,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
|
||||
strip->len = seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1;
|
||||
strip->us= 1;
|
||||
|
||||
strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
|
||||
strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
|
||||
|
||||
strcpy(seq->name+2, sce_seq->id.name+2);
|
||||
seqbase_unique_name_recursive(&ed->seqbase, seq);
|
||||
@ -559,7 +558,6 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
|
||||
|
||||
Sequence *seq; /* generic strip vars */
|
||||
Strip *strip;
|
||||
StripElem *se;
|
||||
struct SeqEffectHandle sh;
|
||||
|
||||
int start_frame, end_frame, channel, type; /* operator props */
|
||||
@ -614,7 +612,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
|
||||
strip->len = seq->len;
|
||||
strip->us= 1;
|
||||
if(seq->len>0)
|
||||
strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
|
||||
strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
|
||||
|
||||
if (seq->type==SEQ_PLUGIN) {
|
||||
char path[FILE_MAX];
|
||||
|
@ -1029,10 +1029,8 @@ static TextLine *first_visible_line(SpaceText *st, ARegion *ar, int *wrap_top)
|
||||
Text *text= st->text;
|
||||
TextLine* pline= text->lines.first;
|
||||
int i= st->top, lineno= 0;
|
||||
DrawCache *drawcache;
|
||||
|
||||
text_update_drawcache(st, ar);
|
||||
drawcache= (DrawCache *)st->drawcache;
|
||||
|
||||
if(wrap_top) *wrap_top= 0;
|
||||
|
||||
|
@ -630,7 +630,7 @@ static float co[16] ={
|
||||
/* smat, imat = mat & imat to draw screenaligned */
|
||||
static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel *pchan, EditBone *ebone)
|
||||
{
|
||||
float head, tail, length, dist;
|
||||
float head, tail, dist /*, length*/;
|
||||
float *headvec, *tailvec, dirvec[3];
|
||||
|
||||
/* figure out the sizes of spheres */
|
||||
@ -638,7 +638,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
|
||||
/* this routine doesn't call get_matrix_editbone() that calculates it */
|
||||
ebone->length = len_v3v3(ebone->head, ebone->tail);
|
||||
|
||||
length= ebone->length;
|
||||
/*length= ebone->length;*/ /*UNUSED*/
|
||||
tail= ebone->rad_tail;
|
||||
dist= ebone->dist;
|
||||
if (ebone->parent && (ebone->flag & BONE_CONNECTED))
|
||||
@ -649,7 +649,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
|
||||
tailvec= ebone->tail;
|
||||
}
|
||||
else {
|
||||
length= pchan->bone->length;
|
||||
/*length= pchan->bone->length;*/ /*UNUSED*/
|
||||
tail= pchan->bone->rad_tail;
|
||||
dist= pchan->bone->dist;
|
||||
if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED))
|
||||
|
@ -93,12 +93,9 @@ static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
|
||||
EdgeHash *eh = BLI_edgehash_new();
|
||||
int i;
|
||||
MFace *mf;
|
||||
MTFace *tf = NULL;
|
||||
|
||||
for (i=0; i<me->totface; i++) {
|
||||
mf = &me->mface[i];
|
||||
if (me->mtface)
|
||||
tf = &me->mtface[i];
|
||||
|
||||
if (mf->v3) {
|
||||
if (!(mf->flag&ME_HIDE)) {
|
||||
|
@ -3448,7 +3448,6 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
|
||||
static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, ParticleSystem *psys, int ob_dt)
|
||||
{
|
||||
Object *ob=base->object;
|
||||
ParticleSystemModifierData *psmd;
|
||||
ParticleEditSettings *pset = PE_settings(scene);
|
||||
ParticleSettings *part;
|
||||
ParticleData *pars, *pa;
|
||||
@ -3460,7 +3459,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
|
||||
float vel[3], imat[4][4];
|
||||
float timestep, pixsize=1.0, pa_size, r_tilt, r_length;
|
||||
float pa_time, pa_birthtime, pa_dietime, pa_health;
|
||||
float cfra= bsystem_time(scene, ob,(float)CFRA,0.0);
|
||||
float cfra;
|
||||
float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f;
|
||||
int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0;
|
||||
int select=ob->flag&SELECT, create_cdata=0, need_v=0;
|
||||
@ -3496,7 +3495,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
|
||||
sim.scene= scene;
|
||||
sim.ob= ob;
|
||||
sim.psys= psys;
|
||||
sim.psmd = psmd = psys_get_modifier(ob,psys);
|
||||
sim.psmd = psys_get_modifier(ob,psys);
|
||||
|
||||
if(part->phystype==PART_PHYS_KEYED){
|
||||
if(psys->flag&PSYS_KEYED){
|
||||
|
@ -2314,20 +2314,21 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot)
|
||||
/* ***** remove image operator ******* */
|
||||
static int background_image_remove_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
BGpic *bgpic_rem = CTX_data_pointer_get_type(C, "bgpic", &RNA_BackgroundImage).data;
|
||||
View3D *vd = CTX_wm_view3d(C);
|
||||
int index = RNA_int_get(op->ptr, "index");
|
||||
BGpic *bgpic_rem= BLI_findlink(&vd->bgpicbase, index);
|
||||
|
||||
bgpic_rem = BLI_findlink(&vd->bgpicbase, index);
|
||||
if(bgpic_rem) {
|
||||
BLI_remlink(&vd->bgpicbase, bgpic_rem);
|
||||
if(bgpic_rem->ima) bgpic_rem->ima->id.us--;
|
||||
MEM_freeN(bgpic_rem);
|
||||
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, vd);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
else {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, vd);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_background_image_remove(wmOperatorType *ot)
|
||||
|
@ -1743,7 +1743,6 @@ int ED_view3d_context_activate(bContext *C)
|
||||
bScreen *sc= CTX_wm_screen(C);
|
||||
ScrArea *sa= CTX_wm_area(C);
|
||||
ARegion *ar;
|
||||
RegionView3D *rv3d;
|
||||
|
||||
/* sa can be NULL when called from python */
|
||||
if(sa==NULL || sa->spacetype != SPACE_VIEW3D)
|
||||
@ -1764,7 +1763,6 @@ int ED_view3d_context_activate(bContext *C)
|
||||
// bad context switch ..
|
||||
CTX_wm_area_set(C, sa);
|
||||
CTX_wm_region_set(C, ar);
|
||||
rv3d= ar->regiondata;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -4849,18 +4849,16 @@ int doEdgeSlide(TransInfo *t, float perc)
|
||||
LinkNode *vertlist=sld->vertlist, *look;
|
||||
GHash *vertgh = sld->vhash;
|
||||
TransDataSlideVert *tempsv;
|
||||
float len = 0.0f;
|
||||
float len;
|
||||
int prop=1, flip=0;
|
||||
/* UV correction vars */
|
||||
GHash **uvarray= sld->uvhash;
|
||||
int uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
|
||||
int uvlay_idx;
|
||||
TransDataSlideUv *suv=sld->slideuv;
|
||||
TransDataSlideUv *suv;
|
||||
float uv_tmp[2];
|
||||
LinkNode *fuv_link;
|
||||
|
||||
len = 0.0f;
|
||||
|
||||
tempsv = BLI_ghash_lookup(vertgh,nearest);
|
||||
|
||||
centerVert = editedge_getSharedVert(tempsv->up, tempsv->down);
|
||||
|
@ -838,31 +838,31 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
|
||||
switch(spaceid)
|
||||
{
|
||||
case SPACE_VIEW3D:
|
||||
km = WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_WARP, WKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, OP_WARP, WKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_TOSPHERE, SKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, OP_TOSPHERE, SKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_SHEAR, SKEY, KM_PRESS, KM_ALT|KM_CTRL|KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, OP_SHEAR, SKEY, KM_PRESS, KM_ALT|KM_CTRL|KM_SHIFT, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_select_orientation", SPACEKEY, KM_PRESS, KM_ALT, 0);
|
||||
WM_keymap_add_item(keymap, "TRANSFORM_OT_select_orientation", SPACEKEY, KM_PRESS, KM_ALT, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_create_orientation", SPACEKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
|
||||
RNA_boolean_set(km->ptr, "use", 1);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap");
|
||||
|
||||
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_TRANSLATION, TKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_boolean_set(km->ptr, "texture_space", 1);
|
||||
@ -870,7 +870,6 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
|
||||
km = WM_keymap_add_item(keymap, OP_RESIZE, TKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
|
||||
RNA_boolean_set(km->ptr, "texture_space", 1);
|
||||
|
||||
|
||||
break;
|
||||
case SPACE_ACTION:
|
||||
km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
|
||||
@ -889,16 +888,16 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
|
||||
RNA_int_set(km->ptr, "mode", TFM_TIME_SLIDE);
|
||||
break;
|
||||
case SPACE_IPO:
|
||||
km= WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
|
||||
km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
|
||||
RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
|
||||
break;
|
||||
case SPACE_NLA:
|
||||
km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
|
||||
@ -914,35 +913,35 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
|
||||
RNA_int_set(km->ptr, "mode", TFM_TIME_SCALE);
|
||||
break;
|
||||
case SPACE_NODE:
|
||||
km= WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0);
|
||||
RNA_enum_set(km->ptr, "release_confirm", 1);
|
||||
km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
RNA_enum_set(km->ptr, "release_confirm", 1);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
|
||||
break;
|
||||
case SPACE_SEQ:
|
||||
km= WM_keymap_add_item(keymap, OP_SEQ_SLIDE, GKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_SEQ_SLIDE, GKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km= WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
|
||||
km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
|
||||
RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
|
||||
break;
|
||||
case SPACE_IMAGE:
|
||||
km = WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap");
|
||||
|
@ -290,7 +290,7 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[],
|
||||
|
||||
void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target) {
|
||||
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
|
||||
TransformOrientation *ts = transform_spaces->first;
|
||||
TransformOrientation *ts;
|
||||
int i;
|
||||
|
||||
for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
|
||||
@ -341,7 +341,7 @@ void BIF_removeTransformOrientationIndex(bContext *C, int index) {
|
||||
void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target) {
|
||||
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
TransformOrientation *ts = transform_spaces->first;
|
||||
TransformOrientation *ts;
|
||||
int i;
|
||||
|
||||
for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
|
||||
|
@ -426,7 +426,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
|
||||
DerivedMesh *finaldm, *cagedm;
|
||||
unsigned char col1[4], col2[4];
|
||||
float pointsize;
|
||||
int drawfaces, interpedges, lastsel, sel;
|
||||
int drawfaces, interpedges;
|
||||
Image *ima= sima->image;
|
||||
|
||||
em= BKE_mesh_get_editmesh(me);
|
||||
@ -627,8 +627,8 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
|
||||
glColor4ubv((unsigned char *)col2);
|
||||
|
||||
if(me->drawflag & ME_DRAWEDGES) {
|
||||
int lastsel= 0, sel;
|
||||
UI_GetThemeColor4ubv(TH_VERTEX_SELECT, col1);
|
||||
lastsel = sel = 0;
|
||||
|
||||
if(interpedges) {
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
@ -228,13 +228,9 @@ static void imb_float_from_rect_linear(struct ImBuf *ibuf, float *fbuf)
|
||||
void IMB_float_from_rect(struct ImBuf *ibuf)
|
||||
{
|
||||
/* quick method to convert byte to floatbuf */
|
||||
float *tof = ibuf->rect_float;
|
||||
|
||||
unsigned char *to = (unsigned char *) ibuf->rect;
|
||||
if(to==NULL) return;
|
||||
if(tof==NULL) {
|
||||
if(ibuf->rect==NULL) return;
|
||||
if(ibuf->rect_float==NULL) {
|
||||
if (imb_addrectfloatImBuf(ibuf) == 0) return;
|
||||
tof = ibuf->rect_float;
|
||||
}
|
||||
|
||||
/* Float bufs should be stored linear */
|
||||
|
@ -85,7 +85,7 @@ static void deformVerts(ModifierData *md, Object *ob,
|
||||
int UNUSED(isFinalCalc))
|
||||
{
|
||||
SmokeModifierData *smd = (SmokeModifierData*) md;
|
||||
DerivedMesh *dm = dm= get_cddm(ob, NULL, derivedData, vertexCos);
|
||||
DerivedMesh *dm = get_cddm(ob, NULL, derivedData, vertexCos);
|
||||
|
||||
smokeModifier_do(smd, md->scene, ob, dm);
|
||||
|
||||
|
@ -118,7 +118,7 @@ static void write_history(void);
|
||||
*/
|
||||
static void wm_window_match_init(bContext *C, ListBase *wmlist)
|
||||
{
|
||||
wmWindowManager *wm= G.main->wm.first;
|
||||
wmWindowManager *wm;
|
||||
wmWindow *win, *active_win;
|
||||
|
||||
*wmlist= G.main->wm;
|
||||
|
@ -277,7 +277,6 @@ static void wm_gesture_draw_lasso(wmGesture *gt)
|
||||
glColor3ub(96, 96, 96);
|
||||
glLineStipple(1, 0xAAAA);
|
||||
glBegin(GL_LINE_STRIP);
|
||||
lasso= (short *)gt->customdata;
|
||||
for(i=0; i<gt->points; i++, lasso+=2)
|
||||
glVertex2sv(lasso);
|
||||
if(gt->type==WM_GESTURE_LASSO)
|
||||
|
Loading…
Reference in New Issue
Block a user