sub.menu("VIEW3D_MT_object")
row = layout.row()
+ # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
row.template_header_3D()
- # do in C for now since these buttons cant be both toggle AND exclusive.
- '''
- if obj and obj.mode == 'EDIT' and obj.type == 'MESH':
- row_sub = row.row(align=True)
- row_sub.prop(toolsettings, "mesh_select_mode", text="", index=0, icon='VERTEXSEL')
- row_sub.prop(toolsettings, "mesh_select_mode", text="", index=1, icon='EDGESEL')
- row_sub.prop(toolsettings, "mesh_select_mode", text="", index=2, icon='FACESEL')
- '''
-
if obj:
# Particle edit
if obj.mode == 'PARTICLE_EDIT':
- row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True, toggle=True)
+ row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
# Occlude geometry
if view.viewport_shade in {'SOLID', 'SHADED', 'TEXTURED'} and (obj.mode == 'PARTICLE_EDIT' or (obj.mode == 'EDIT' and obj.type == 'MESH')):
row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
# Snap
+ snap_element = toolsettings.snap_element
row = layout.row(align=True)
row.prop(toolsettings, "use_snap", text="")
row.prop(toolsettings, "snap_element", text="", icon_only=True)
- if toolsettings.snap_element != 'INCREMENT':
+ if snap_element != 'INCREMENT':
row.prop(toolsettings, "snap_target", text="")
- if obj and obj.mode == 'OBJECT':
- row.prop(toolsettings, "use_snap_align_rotation", text="")
- if toolsettings.snap_element == 'VOLUME':
+ if obj:
+ if obj.mode == 'OBJECT':
+ row.prop(toolsettings, "use_snap_align_rotation", text="")
+ elif obj.mode == 'EDIT':
+ row.prop(toolsettings, "use_snap_self", text="")
+
+ if snap_element == 'VOLUME':
row.prop(toolsettings, "use_snap_peel_object", text="")
- elif toolsettings.snap_element == 'FACE':
+ elif snap_element == 'FACE':
row.prop(toolsettings, "use_snap_project", text="")
- if toolsettings.use_snap_project and obj.mode == 'EDIT':
- row.prop(toolsettings, "use_snap_project_self", text="")
# OpenGL render
row = layout.row(align=True)
layout.operator("object.vertex_group_invert", text="Invert")
layout.operator("object.vertex_group_clean", text="Clean")
layout.operator("object.vertex_group_levels", text="Levels")
+ #Jason
+ layout.operator("object.vertex_group_fix", text="Fix Deforms")
layout.separator()
row = col.row()
row.prop(context.tool_settings, "use_grease_pencil_sessions")
+
# ********** default tools for objectmode ****************
class VIEW3D_PT_tools_objectmode(View3DPanel, bpy.types.Panel):
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
- col.operator("transform.shrink_fatten", text="Along Normal")
+ col.operator("transform.shrink_fatten", text="Shrink/Fatten")
+ col.operator("transform.push_pull", text="Push/Pull")
col = layout.column(align=True)
col.label(text="Deform:")
elif context.weight_paint_object and brush:
layout.prop(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
layout.prop(context.tool_settings, "use_auto_normalize", text="Auto Normalize")
+ # Jason was here
+ layout.prop(context.tool_settings, "use_multipaint", text="Multi-Paint")
col = layout.column()
col.operator("object.vertex_group_invert", text="Invert")
col.operator("object.vertex_group_clean", text="Clean")
col.operator("object.vertex_group_levels", text="Levels")
+ col.operator("object.vertex_group_fix", text="Fix Deforms")
class VIEW3D_PT_tools_weightpaint_options(View3DPanel, bpy.types.Panel):
BLI_pbvh_update(cddm->pbvh, PBVH_UpdateNormals, face_nors);
}
+// Jason
+static void cdDM_drawSelectedVerts(DerivedMesh *dm)
+{
+ CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
+ MVert *mv = cddm->mvert;
+ int i;
+ if( GPU_buffer_legacy(dm) ) {
+ char prev_sel= 0; /* always invalid */;
+
+ glBegin(GL_POINTS);
+ for(i = 0; i < dm->numVertData; i++, mv++) {
+ if(!(mv->flag & ME_HIDE)) {
+ const char sel= mv->flag & 1;
+ if(prev_sel != sel) {
+ prev_sel= sel;
+
+ // TODO define selected color
+ if(sel) {
+ glColor3f(1.0f, 1.0f, 0.0f);
+ }else {
+ glColor3f(0.0f, 0.0f, 0.0f);
+ }
+ }
+
+ glVertex3fv(mv->co);
+ }
+ }
+ glEnd();
+ }
+ else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
+ GPU_vertex_setup(dm);
+ if( !GPU_buffer_legacy(dm) ) {
+ if(dm->drawObject->tot_triangle_point) glDrawArrays(GL_POINTS,0, dm->drawObject->tot_triangle_point);
+ else glDrawArrays(GL_POINTS,0, dm->drawObject->tot_loose_point);
+ }
+ GPU_buffer_unbind();
+ }
+}
static void cdDM_drawVerts(DerivedMesh *dm)
{
QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
offset += sizeof(float)*4;
}
+ (void)offset;
}
curface++;
if(mface->v4) {
QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
offset += sizeof(float)*4;
}
+ (void)offset;
}
curface++;
i++;
dm->getFaceMap = cdDM_getFaceMap;
dm->drawVerts = cdDM_drawVerts;
+ // Jason
+ dm->drawSelectedVerts = cdDM_drawSelectedVerts;
dm->drawUVEdges = cdDM_drawUVEdges;
dm->drawEdges = cdDM_drawEdges;
bArmature *arm;
EditBone *bone, *curBone, *next;
int extend= RNA_boolean_get(op->ptr, "extend");
- ARegion *ar;
Object *obedit= CTX_data_edit_object(C);
arm= obedit->data;
- ar= CTX_wm_region(C);
view3d_operator_needs_opengl(C);
return count;
}
+// Jason
+Bone* get_other_selected_bone(Object *ob) {
+ Bone *bone;
+ int i;
+ bone = get_indexed_bone(ob, 0);
+ for(i = 0; bone;){
+ if(bone->flag & BONE_SELECTED) {
+ return bone;
+ }
+ i++;
+ bone = get_indexed_bone(ob, i);
+ }
+ return NULL;
+}
/* called from editview.c, for mode-less pose selection */
/* assumes scene obact and basact is still on old situation */
int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, short hits, short extend)
{
Object *ob= base->object;
Bone *nearBone;
-
+ // Jason
+ Bone *new_act_bone;
+
if (!ob || !ob->pose) return 0;
nearBone= get_bone_from_selectbuffer(scene, base, buffer, hits, 1);
-
+
/* if the bone cannot be affected, don't do anything */
if ((nearBone) && !(nearBone->flag & BONE_UNSELECTABLE)) {
bArmature *arm= ob->data;
/* since we do unified select, we don't shift+select a bone if the armature object was not active yet */
- if (!(extend) || (base != scene->basact)) {
- ED_pose_deselectall(ob, 0);
- nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- arm->act_bone= nearBone;
-
+ /* Jason was here, I'm doing a select for multibone painting */
+ if ((base != scene->basact)) {//if (!(extend) || (base != scene->basact)) {
+ /* Jason was here */
+ /* only deselect all if they aren't using 'shift' */
+ if(!extend) {
+ ED_pose_deselectall(ob, 0);
+ nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ arm->act_bone= nearBone;
+ ED_vgroup_select_by_name(OBACT, nearBone->name);
+ }
+ else {
+ // Jason deselect this bone specifically if it is selected already
+ if (nearBone->flag & BONE_SELECTED) {
+ nearBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ if(nearBone == arm->act_bone) {
+ // make a different bone the active one if it exists
+ new_act_bone = get_other_selected_bone(ob);
+ if(new_act_bone) {
+ new_act_bone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ arm->act_bone = new_act_bone;
+ ED_vgroup_select_by_name(OBACT, new_act_bone->name);
+ }
+ }
+ // or select the bone if they are using shift
+ } else {
+ nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ arm->act_bone= nearBone;
+ }
+ }
+ DAG_id_tag_update(&OBACT->id, OB_RECALC_DATA);
// XXX old cruft! use notifiers instead
//select_actionchannel_by_name(ob->action, nearBone->name, 1);
}
static int pose_de_select_all_exec(bContext *C, wmOperator *op)
{
int action = RNA_enum_get(op->ptr, "action");
+ //Jason
+ Object *ob = NULL;
+ Scene *scene= CTX_data_scene(C);
+ int multipaint = scene->toolsettings->multipaint;
if (action == SEL_TOGGLE) {
action= CTX_DATA_COUNT(C, selected_pose_bones) ? SEL_DESELECT : SEL_SELECT;
CTX_DATA_END;
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, NULL);
-
+ // Jason
+ if(multipaint) {
+ ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ }
+
return OPERATOR_FINISHED;
}
/* verify we have valid data */
if(!RNA_struct_is_a(ptr->type, &RNA_Modifier)) {
- RNA_warning("uiTemplateModifier: expected modifier on object.\n");
+ RNA_warning("uiTemplateModifier: Expected modifier on object.\n");
return NULL;
}
md= ptr->data;
if(!ob || !(GS(ob->id.name) == ID_OB)) {
- RNA_warning("uiTemplateModifier: expected modifier on object.\n");
+ RNA_warning("uiTemplateModifier: Expected modifier on object.\n");
return NULL;
}
block= uiLayoutGetBlock(box);
/* Draw constraint header */
-
- /* rounded header */
- // rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20; // UNUSED
/* open/close */
uiBlockSetEmboss(block, UI_EMBOSSN);
/* verify we have valid data */
if(!RNA_struct_is_a(ptr->type, &RNA_Constraint)) {
- RNA_warning("uiTemplateConstraint: expected constraint on object.\n");
+ RNA_warning("uiTemplateConstraint: Expected constraint on object.\n");
return NULL;
}
con= ptr->data;
if(!ob || !(GS(ob->id.name) == ID_OB)) {
- RNA_warning("uiTemplateConstraint: expected constraint on object.\n");
+ RNA_warning("uiTemplateConstraint: Expected constraint on object.\n");
return NULL;
}
PointerRNA texture_ptr;
if(id && !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) {
- RNA_warning("uiTemplatePreview: expected ID of type material, texture, lamp or world.\n");
+ RNA_warning("uiTemplatePreview: Expected ID of type material, texture, lamp or world.\n");
return;
}
//uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
uiBlockSetEmboss(block, UI_EMBOSS);
}
+ /* Jason was here: I need the RNA struct for vertex groups */
+ else if(RNA_struct_is_a(itemptr->type, &RNA_VertexGroup)) {
+ uiItemL(sub, name, icon);
+ uiBlockSetEmboss(block, UI_EMBOSS);
+ uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "flag", 0, 0, 0, 0, 0, NULL);
+ }
else
uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
if(prop) {
type= RNA_property_type(prop);
if(type != PROP_COLLECTION) {
- RNA_warning("uiTemplateList: expected collection property.\n");
+ RNA_warning("uiTemplateList: Expected collection property.\n");
return;
}
}
activetype= RNA_property_type(activeprop);
if(activetype != PROP_INT) {
- RNA_warning("uiTemplateList: expected integer property.\n");
+ RNA_warning("uiTemplateList: Expected integer property.\n");
return;
}
/* create list items */
RNA_PROP_BEGIN(ptr, itemptr, prop) {
/* create button */
- if(i == 9)
+ if(!(i % 9))
row= uiLayoutRow(col, 0);
icon= list_item_icon_get(C, &itemptr, rnaicon, 1);
}
else if(listtype == 'c') {
/* compact layout */
- found= 0;
row= uiLayoutRow(layout, 1);
/* Manipulators aren't used in weight paint mode */
PointerRNA meshptr;
-
RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
- uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) {
+ uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ } else {
+ // Jason
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(row, &meshptr, "wp_vert_sel", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ }
} else {
const char *str_menu;
uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
- /* NDOF */
- /* Not implemented yet
- if (G.ndofdevice ==0 ) {
- uiDefIconTextButC(block, ICONTEXTROW,B_NDOF, ICON_NDOF_TURN, ndof_pup(), 0,0,UI_UNIT_X+10,UI_UNIT_Y, &(v3d->ndofmode), 0, 3.0, 0, 0, "Ndof mode");
-
- uiDefIconButC(block, TOG, B_NDOF, ICON_NDOF_DOM,
- 0,0,UI_UNIT_X,UI_UNIT_Y,
- &v3d->ndoffilter, 0, 1, 0, 0, "dominant axis");
- }
- */
-
/* Transform widget / manipulators */
row= uiLayoutRow(layout, 1);
uiItemR(row, &v3dptr, "show_manipulator", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
short snap_flag, snap_target;
short proportional, prop_mode;
char proportional_objects; /* proportional edit, object mode */
- char pad[3];
+ char pad[7];
int auto_normalize; /*auto normalizing mode in wpaint*/
+ //Jason
+ int multipaint; /* paint multiple bones in wpaint */
+
short sculpt_paint_settings; /* user preferences for sculpt and paint */
short pad1;
int sculpt_paint_unified_size; /* unified radius of brush in pixels */
#define SCE_SNAP_ROTATE 2
#define SCE_SNAP_PEEL_OBJECT 4
#define SCE_SNAP_PROJECT 8
- #define SCE_SNAP_PROJECT_NO_SELF 16
+ #define SCE_SNAP_NO_SELF 16
/* toolsettings->snap_target */
#define SCE_SNAP_TARGET_CLOSEST 0
#define SCE_SNAP_TARGET_CENTER 1
#define PROP_SHARP 3
#define PROP_LIN 4
#define PROP_CONST 5
- #define PROP_RANDOM 6
+ #define PROP_RANDOM 6
+ #define PROP_MODE_MAX 7
/* toolsettings->proportional */
#define PROP_EDIT_OFF 0
#endif
{R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", "Output video in AVI JPEG format"},
{R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"},
+ #ifdef WITH_FRAMESERVER
{R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", "Output image to a frameserver"},
+ #endif
#ifdef WITH_FFMPEG
{R_H264, "H264", ICON_FILE_MOVIE, "H.264", "Output video in H.264 format"},
{R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", "Output video in MPEG format"},
RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
"Ensure all bone-deforming vertex groups add up to 1.0 while "
"weight painting");
+ RNA_def_property_update(prop, 0, "rna_update_active_object");
+
+ prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "multipaint", 1);
+ RNA_def_property_ui_text(prop, "WPaint Multi-Paint",
+ "Paint across all selected bones while "
+ "weight painting");
+ RNA_def_property_update(prop, 0, "rna_update_active_object");
prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "use_snap_project_self", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT_NO_SELF);
- RNA_def_property_ui_text(prop, "Project to Self", "Project into its self (editmode)");
+ prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
+ RNA_def_property_ui_text(prop, "Project to Self", "Snap onto its self (editmode)");
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bake_filter");
- RNA_def_property_range(prop, 0, 32);
+ RNA_def_property_range(prop, 0, 64);
RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);