forked from bartvdbraak/blender
added mesh mirror flag, now store this per mesh
button in mesh interface also dont register operators that change context
This commit is contained in:
parent
1847f6198e
commit
4ef0ef1927
@ -157,9 +157,6 @@ class WM_OT_context_set(bpy.types.Operator):
|
||||
'''Set a context value.'''
|
||||
__idname__ = "wm.context_set"
|
||||
__label__ = "Context Set"
|
||||
__register__ = True
|
||||
__undo__ = True
|
||||
|
||||
__props__ = [
|
||||
bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= ""),
|
||||
bpy.props.StringProperty(attr="value", name="Value", description="Assignment value (as a string)", maxlen= 1024, default= "")
|
||||
@ -173,9 +170,6 @@ class WM_OT_context_toggle(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
__idname__ = "wm.context_toggle"
|
||||
__label__ = "Context Toggle"
|
||||
__register__ = True
|
||||
__undo__ = True
|
||||
|
||||
__props__ = [
|
||||
bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= ""),
|
||||
]
|
||||
@ -188,9 +182,6 @@ class WM_OT_context_toggle_values(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
__idname__ = "wm.context_toggle_values"
|
||||
__label__ = "Context Toggle Values"
|
||||
__register__ = True
|
||||
__undo__ = True
|
||||
|
||||
__props__ = [
|
||||
bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= ""),
|
||||
bpy.props.StringProperty(attr="value_1", name="Value", description="Toggle value (as a string)", maxlen= 1024, default= ""),
|
||||
@ -205,9 +196,6 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
__idname__ = "wm.context_cycle_enum"
|
||||
__label__ = "Context Enum Cycle"
|
||||
__register__ = True
|
||||
__undo__ = True
|
||||
|
||||
__props__ = [
|
||||
bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= ""),
|
||||
bpy.props.BoolProperty(attr="reverse", name="Reverse", description="Cycle backwards", default= False)
|
||||
|
@ -60,6 +60,9 @@ class DATA_PT_settings(DataButtonsPanel):
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mesh, "texture_mesh")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mesh, "use_mirror_x")
|
||||
|
||||
class DATA_PT_vertex_groups(DataButtonsPanel):
|
||||
__label__ = "Vertex Groups"
|
||||
|
@ -66,7 +66,7 @@ struct Object;
|
||||
#define B_AUTOFGON 0x20
|
||||
#define B_KNIFE 0x80
|
||||
#define B_PERCENTSUBD 0x40
|
||||
#define B_MESH_X_MIRROR 0x100
|
||||
//#define B_MESH_X_MIRROR 0x100 // deprecated, use mesh
|
||||
#define B_JOINTRIA_UV 0x200
|
||||
#define B_JOINTRIA_VCOL 0X400
|
||||
#define B_JOINTRIA_SHARP 0X800
|
||||
|
@ -4291,7 +4291,7 @@ static int smooth_vertex(bContext *C, wmOperator *op)
|
||||
if(eve->f & SELECT) {
|
||||
if(eve->f1) {
|
||||
|
||||
if (ts->editbutflag & B_MESH_X_MIRROR) {
|
||||
if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
|
||||
eve_mir= editmesh_get_x_mirror_vert(obedit, em, eve->co);
|
||||
}
|
||||
|
||||
|
@ -974,7 +974,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
// Need stuff to take it from edit mesh or whatnot here
|
||||
else
|
||||
{
|
||||
if (t->obedit && t->obedit->type == OB_MESH && ts->editbutflag & B_MESH_X_MIRROR)
|
||||
if (t->obedit && t->obedit->type == OB_MESH && (((Mesh *)t->obedit->data)->editflag & ME_EDIT_MIRROR_X))
|
||||
{
|
||||
t->flag |= T_MIRROR;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ typedef struct Mesh {
|
||||
* the face does not need to be selected, -1 is inactive */
|
||||
int act_face;
|
||||
|
||||
int texflag;
|
||||
short texflag, editflag;
|
||||
|
||||
/* texture space, copied as one block in editobject.c */
|
||||
float loc[3];
|
||||
@ -116,6 +116,11 @@ typedef struct TFace {
|
||||
/* texflag */
|
||||
#define AUTOSPACE 1
|
||||
|
||||
/* me->editflag */
|
||||
#define ME_EDIT_MIRROR_X (1 << 0)
|
||||
#define ME_EDIT_MIRROR_Y (1 << 1) // unused so far
|
||||
#define ME_EDIT_MIRROR_Z (1 << 2) // unused so far
|
||||
|
||||
/* me->flag */
|
||||
#define ME_ISDONE 1
|
||||
#define ME_NOPUNOFLIP 2
|
||||
|
@ -1600,6 +1600,21 @@ static void rna_def_mesh(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces");
|
||||
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
||||
|
||||
/* editflag */
|
||||
prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
|
||||
RNA_def_property_ui_text(prop, "X Mirror", "X Axis mirror editing");
|
||||
|
||||
/*
|
||||
prop= RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Y);
|
||||
RNA_def_property_ui_text(prop, "Y Mirror", "Y Axis mirror editing");
|
||||
|
||||
prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Z);
|
||||
RNA_def_property_ui_text(prop, "Z Mirror", "Z Axis mirror editing");
|
||||
*/
|
||||
|
||||
rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
|
||||
|
||||
RNA_api_mesh(srna);
|
||||
|
Loading…
Reference in New Issue
Block a user