2.5: Various
* Weight paint: brush strength was changed to both define weight and strength, this can't work, made them separate buttons. * Allow adding particle system as modifier (fix crash). * 3D view modal ops (zoom ..) could not be ended when invoked from a button. * Fix some warnings. * Fix spelling in particle RNA property.
This commit is contained in:
@@ -9009,14 +9009,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
//do_versions_ipos_to_animato(main);
|
||||
|
||||
/* toolsettings */
|
||||
for(scene= main->scene.first; scene; scene= scene->id.next) {
|
||||
for(scene= main->scene.first; scene; scene= scene->id.next)
|
||||
scene->r.audio = scene->audio;
|
||||
|
||||
if(!scene->toolsettings->uv_selectmode) {
|
||||
scene->toolsettings->uv_selectmode= UV_SELECT_VERTEX;
|
||||
scene->toolsettings->vgroup_weight= 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
/* shader, composit and texture node trees have id.name empty, put something in
|
||||
* to have them show in RNA viewer and accessible otherwise.
|
||||
@@ -9152,10 +9146,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
|
||||
for(sce = main->scene.first; sce; sce = sce->id.next) {
|
||||
ts= sce->toolsettings;
|
||||
if(ts->normalsize == 0.0) {
|
||||
if(ts->normalsize == 0.0 || !ts->uv_selectmode || ts->vgroup_weight == 0.0) {
|
||||
ts->normalsize= 0.1f;
|
||||
ts->selectmode= SCE_SELECT_VERTEX;
|
||||
ts->autokey_mode= U.autokey_mode;
|
||||
ts->uv_selectmode= UV_SELECT_VERTEX;
|
||||
ts->vgroup_weight= 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,33 +83,38 @@ int ED_object_modifier_add(ReportList *reports, Scene *scene, Object *ob, int ty
|
||||
}
|
||||
}
|
||||
|
||||
if(mti->flags&eModifierTypeFlag_RequiresOriginalData) {
|
||||
md = ob->modifiers.first;
|
||||
|
||||
while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform)
|
||||
md = md->next;
|
||||
|
||||
BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type));
|
||||
if(type == eModifierType_ParticleSystem) {
|
||||
object_add_particle_system(scene, ob);
|
||||
}
|
||||
else
|
||||
BLI_addtail(&ob->modifiers, modifier_new(type));
|
||||
|
||||
/* special cases */
|
||||
if(type == eModifierType_Softbody) {
|
||||
if(!ob->soft) {
|
||||
ob->soft= sbNew(scene);
|
||||
ob->softflag |= OB_SB_GOAL|OB_SB_EDGES;
|
||||
else {
|
||||
if(mti->flags&eModifierTypeFlag_RequiresOriginalData) {
|
||||
md = ob->modifiers.first;
|
||||
|
||||
while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform)
|
||||
md = md->next;
|
||||
|
||||
BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type));
|
||||
}
|
||||
}
|
||||
else if(type == eModifierType_Collision) {
|
||||
if(!ob->pd)
|
||||
ob->pd= object_add_collision_fields();
|
||||
else
|
||||
BLI_addtail(&ob->modifiers, modifier_new(type));
|
||||
|
||||
/* special cases */
|
||||
if(type == eModifierType_Softbody) {
|
||||
if(!ob->soft) {
|
||||
ob->soft= sbNew(scene);
|
||||
ob->softflag |= OB_SB_GOAL|OB_SB_EDGES;
|
||||
}
|
||||
}
|
||||
else if(type == eModifierType_Collision) {
|
||||
if(!ob->pd)
|
||||
ob->pd= object_add_collision_fields();
|
||||
|
||||
ob->pd->deflect= 1;
|
||||
DAG_scene_sort(scene);
|
||||
ob->pd->deflect= 1;
|
||||
DAG_scene_sort(scene);
|
||||
}
|
||||
else if(type == eModifierType_Surface)
|
||||
DAG_scene_sort(scene);
|
||||
}
|
||||
else if(type == eModifierType_Surface)
|
||||
DAG_scene_sort(scene);
|
||||
|
||||
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
|
||||
|
||||
|
||||
@@ -424,8 +424,9 @@ void clear_vpaint_selectedfaces(Scene *scene)
|
||||
/* fills in the selected faces with the current weight and vertex group */
|
||||
void clear_wpaint_selectedfaces(Scene *scene)
|
||||
{
|
||||
VPaint *wp= scene->toolsettings->wpaint;
|
||||
float paintweight= wp->brush->alpha;
|
||||
ToolSettings *ts= scene->toolsettings;
|
||||
VPaint *wp= ts->wpaint;
|
||||
float paintweight= ts->vgroup_weight;
|
||||
Mesh *me;
|
||||
MFace *mface;
|
||||
Object *ob;
|
||||
@@ -909,7 +910,7 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float
|
||||
void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode)
|
||||
{
|
||||
ViewContext vc;
|
||||
VPaint *wp= scene->toolsettings->wpaint;
|
||||
ToolSettings *ts= scene->toolsettings;
|
||||
Object *ob= OBACT;
|
||||
Mesh *me= get_mesh(ob);
|
||||
int index;
|
||||
@@ -1019,20 +1020,20 @@ void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode)
|
||||
fac= MIN4(w1, w2, w3, w4);
|
||||
if(w1==fac) {
|
||||
dw= get_defweight(me->dvert+mface->v1, ob->actdef-1);
|
||||
if(dw) wp->brush->alpha= dw->weight; else wp->brush->alpha= 0.0f;
|
||||
if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f;
|
||||
}
|
||||
else if(w2==fac) {
|
||||
dw= get_defweight(me->dvert+mface->v2, ob->actdef-1);
|
||||
if(dw) wp->brush->alpha= dw->weight; else wp->brush->alpha= 0.0f;
|
||||
if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f;
|
||||
}
|
||||
else if(w3==fac) {
|
||||
dw= get_defweight(me->dvert+mface->v3, ob->actdef-1);
|
||||
if(dw) wp->brush->alpha= dw->weight; else wp->brush->alpha= 0.0f;
|
||||
if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f;
|
||||
}
|
||||
else if(w4==fac) {
|
||||
if(mface->v4) {
|
||||
dw= get_defweight(me->dvert+mface->v4, ob->actdef-1);
|
||||
if(dw) wp->brush->alpha= dw->weight; else wp->brush->alpha= 0.0f;
|
||||
if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1308,7 +1309,7 @@ static int wpaint_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
Object *ob= vc->obact;
|
||||
Mesh *me= ob->data;
|
||||
float mat[4][4];
|
||||
float paintweight= wp->brush->alpha;
|
||||
float paintweight= ts->vgroup_weight;
|
||||
int *indexar= wpd->indexar;
|
||||
int totindex, index, alpha, totw;
|
||||
short mval[2];
|
||||
@@ -1365,7 +1366,7 @@ static int wpaint_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
if(wp->mode==VP_BLUR)
|
||||
paintweight= 0.0f;
|
||||
else
|
||||
paintweight= wp->brush->alpha;
|
||||
paintweight= ts->vgroup_weight;
|
||||
|
||||
for(index=0; index<totindex; index++) {
|
||||
if(indexar[index] && indexar[index]<=me->totface) {
|
||||
|
||||
@@ -770,4 +770,5 @@ void FILE_OT_filenum(struct wmOperatorType *ot)
|
||||
|
||||
/* props */
|
||||
RNA_def_int(ot->srna, "increment", 1, 0, 100, "Increment", "", 0,100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,4 +160,5 @@ void file_panels_register(ARegionType *art)
|
||||
strcpy(pt->label, "Operator");
|
||||
pt->draw= file_panel_operator;
|
||||
BLI_addtail(&art->paneltypes, pt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1107,6 +1107,7 @@ static int view3d_panel_brush_poll(const bContext *C, PanelType *pt)
|
||||
static void view3d_panel_brush(const bContext *C, Panel *pa)
|
||||
{
|
||||
uiBlock *block;
|
||||
ToolSettings *ts= CTX_data_tool_settings(C);
|
||||
Brush **brp = current_brush_source(CTX_data_scene(C)), *br;
|
||||
short w = 268, h = 400, cx = 10, cy = h;
|
||||
rctf rect;
|
||||
@@ -1143,6 +1144,10 @@ static void view3d_panel_brush(const bContext *C, Panel *pa)
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButI(block,NUMSLI,B_NOP,"Size: ",cx,cy,w,19,&br->size,1.0,200.0,0,0,"Set brush radius in pixels");
|
||||
cy-= 20;
|
||||
if(G.f & G_WEIGHTPAINT) {
|
||||
uiDefButF(block,NUMSLI,B_NOP,"Weight: ",cx,cy,w,19,&ts->vgroup_weight,0,1.0,0,0,"Set vertex weight");
|
||||
cy-= 20;
|
||||
}
|
||||
uiDefButF(block,NUMSLI,B_NOP,"Strength: ",cx,cy,w,19,&br->alpha,0,1.0,0,0,"Set brush strength");
|
||||
cy-= 25;
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
@@ -503,7 +503,8 @@ static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
break;
|
||||
|
||||
default:
|
||||
if(event->type==vod->origkey && event->val==0) {
|
||||
/* origkey may be zero when invoked from a button */
|
||||
if(ELEM3(event->type, ESCKEY, LEFTMOUSE, RIGHTMOUSE) || (event->type==vod->origkey && event->val==0)) {
|
||||
request_depth_update(CTX_wm_region_view3d(C));
|
||||
|
||||
MEM_freeN(vod);
|
||||
@@ -603,7 +604,8 @@ static int viewmove_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
break;
|
||||
|
||||
default:
|
||||
if(event->type==vod->origkey && event->val==0) {
|
||||
/* origkey may be zero when invoked from a button */
|
||||
if(ELEM3(event->type, ESCKEY, LEFTMOUSE, RIGHTMOUSE) || (event->type==vod->origkey && event->val==0)) {
|
||||
request_depth_update(CTX_wm_region_view3d(C));
|
||||
|
||||
MEM_freeN(vod);
|
||||
@@ -763,7 +765,8 @@ static int viewzoom_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
break;
|
||||
|
||||
default:
|
||||
if(event->type==vod->origkey && event->val==0) {
|
||||
/* origkey may be zero when invoked from a button */
|
||||
if(ELEM3(event->type, ESCKEY, LEFTMOUSE, RIGHTMOUSE) || (event->type==vod->origkey && event->val==0)) {
|
||||
request_depth_update(CTX_wm_region_view3d(C));
|
||||
|
||||
MEM_freeN(vod);
|
||||
|
||||
@@ -270,7 +270,7 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
|
||||
break;
|
||||
case INPUT_TRACKBALL:
|
||||
/* factor has to become setting or so */
|
||||
mi->factor = 0.02f;
|
||||
mi->factor = 0.01f;
|
||||
mi->apply = InputTrackBall;
|
||||
t->helpline = HLP_TRACKBALL;
|
||||
break;
|
||||
|
||||
@@ -107,7 +107,7 @@ static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
PointCache *cache = (PointCache*)ptr->data;
|
||||
PTCacheID *pid = NULL, *pid2;
|
||||
PTCacheID *pid = NULL, *pid2= NULL;
|
||||
ListBase pidlist;
|
||||
int new_name = 1;
|
||||
char name[80];
|
||||
|
||||
@@ -1249,7 +1249,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
|
||||
RNA_def_property_float_sdna(prop, NULL, "acc");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_range(prop, -200.0f, 200.0f);
|
||||
RNA_def_property_ui_text(prop, "Accelaration", "Constant acceleration");
|
||||
RNA_def_property_ui_text(prop, "Acceleration", "Constant acceleration");
|
||||
RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
|
||||
|
||||
prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE);
|
||||
|
||||
Reference in New Issue
Block a user