adding a python function for cleaning strings (for filenames and export names) BPySys.py - used fotr obj and fbx export.
view.c - missed one smoothview/camera. Brigg's hide object patch didnt change the object selection flag, other minor changes also.
This commit is contained in:
@@ -5457,33 +5457,42 @@ void hookmenu(void)
|
||||
|
||||
void hide_objects(int select)
|
||||
{
|
||||
Base *b;
|
||||
int swap;
|
||||
for(b = G.scene->base.first; b; b=b->next){
|
||||
if(TESTBASE(b)==select){
|
||||
b->flag &= ~SELECT;
|
||||
b->object->restrictflag |= OB_RESTRICT_VIEW;
|
||||
DAG_object_flush_update(G.scene, b->object, OB_RECALC_DATA);
|
||||
Base *base;
|
||||
int changed = 0;
|
||||
for(base = FIRSTBASE; base; base=base->next){
|
||||
if(TESTBASE(base)==select){
|
||||
base->flag &= ~SELECT;
|
||||
base->object->flag = base->flag;
|
||||
base->object->restrictflag |= OB_RESTRICT_VIEW;
|
||||
DAG_object_flush_update(G.scene, base->object, OB_RECALC_DATA);
|
||||
changed = 1;
|
||||
if (base==BASACT) BASACT= NULL;
|
||||
}
|
||||
}
|
||||
G.scene->basact = NULL;
|
||||
allqueue(REDRAWVIEW3D,0);
|
||||
allqueue(REDRAWOOPS,0);
|
||||
if(select) BIF_undo_push("Hide Selected Objects");
|
||||
else if(select) BIF_undo_push("Hide Unselected Objects");
|
||||
if (changed) {
|
||||
allqueue(REDRAWVIEW3D,0);
|
||||
allqueue(REDRAWOOPS,0);
|
||||
if(select) BIF_undo_push("Hide Selected Objects");
|
||||
else if(select) BIF_undo_push("Hide Unselected Objects");
|
||||
}
|
||||
}
|
||||
|
||||
void show_objects(void)
|
||||
{
|
||||
Base *b;
|
||||
for(b = G.scene->base.first; b; b=b->next){
|
||||
if((b->lay & G.vd->lay) && b->object->restrictflag & OB_RESTRICT_VIEW){
|
||||
b->flag |= SELECT;
|
||||
b->object->restrictflag &= ~OB_RESTRICT_VIEW;
|
||||
DAG_object_flush_update(G.scene, b->object, OB_RECALC_DATA);
|
||||
Base *base;
|
||||
int changed = 0;
|
||||
for(base = FIRSTBASE; base; base=base->next){
|
||||
if((base->lay & G.vd->lay) && base->object->restrictflag & OB_RESTRICT_VIEW) {
|
||||
base->flag |= SELECT;
|
||||
base->object->flag = base->flag;
|
||||
base->object->restrictflag &= ~OB_RESTRICT_VIEW;
|
||||
DAG_object_flush_update(G.scene, base->object, OB_RECALC_DATA);
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
BIF_undo_push("Unhide Objects");
|
||||
allqueue(REDRAWVIEW3D,0);
|
||||
allqueue(REDRAWOOPS,0);
|
||||
if (changed) {
|
||||
BIF_undo_push("Unhide Objects");
|
||||
allqueue(REDRAWVIEW3D,0);
|
||||
allqueue(REDRAWOOPS,0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1414,23 +1414,30 @@ void centerview() /* like a localview without local! */
|
||||
|
||||
new_dist = size;
|
||||
|
||||
// correction for window aspect ratio
|
||||
/* correction for window aspect ratio */
|
||||
if(curarea->winy>2 && curarea->winx>2) {
|
||||
size= (float)curarea->winx/(float)curarea->winy;
|
||||
if(size<1.0) size= 1.0/size;
|
||||
new_dist*= size;
|
||||
}
|
||||
|
||||
if(G.vd->persp>1) {
|
||||
G.vd->persp= 1;
|
||||
}
|
||||
|
||||
G.vd->cursor[0]= -new_ofs[0];
|
||||
G.vd->cursor[1]= -new_ofs[1];
|
||||
G.vd->cursor[2]= -new_ofs[2];
|
||||
|
||||
smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL);
|
||||
|
||||
if (G.vd->persp==2 && G.vd->camera) {
|
||||
float orig_lens= G.vd->lens;
|
||||
|
||||
G.vd->persp=1;
|
||||
G.vd->dist= 0.0;
|
||||
view_settings_from_ob(G.vd->camera, G.vd->ofs, NULL, NULL, &G.vd->lens);
|
||||
smooth_view(G.vd, new_ofs, NULL, &new_dist, &orig_lens);
|
||||
} else {
|
||||
if(G.vd->persp>=2)
|
||||
G.vd->persp= 1;
|
||||
|
||||
smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL);
|
||||
}
|
||||
scrarea_queue_winredraw(curarea);
|
||||
BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user