code cleanup: unnecessary shadowing and some minor pep8 edits.
This commit is contained in:
@@ -106,9 +106,9 @@ class AddTorus(Operator, object_utils.AddObjectHelper):
|
|||||||
)
|
)
|
||||||
mode = bpy.props.EnumProperty(
|
mode = bpy.props.EnumProperty(
|
||||||
name="Torus Dimensions",
|
name="Torus Dimensions",
|
||||||
items=(("MAJOR_MINOR", "Major/Minor",
|
items=(("MAJOR_MINOR", "Major/Minor",
|
||||||
"Use the major/minor radii for torus dimensions"),
|
"Use the major/minor radii for torus dimensions"),
|
||||||
("EXT_INT", "Exterior/Interior",
|
("EXT_INT", "Exterior/Interior",
|
||||||
"Use the exterior/interior radii for torus dimensions")),
|
"Use the exterior/interior radii for torus dimensions")),
|
||||||
update=mode_update_callback,
|
update=mode_update_callback,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2614,7 +2614,7 @@ class VIEW3D_PT_view3d_shading(Panel):
|
|||||||
bl_region_type = 'UI'
|
bl_region_type = 'UI'
|
||||||
bl_label = "Shading"
|
bl_label = "Shading"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
view = context.space_data
|
view = context.space_data
|
||||||
|
|||||||
@@ -913,7 +913,7 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
|
|||||||
row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
|
row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
|
||||||
row.prop(brush, "jitter_absolute")
|
row.prop(brush, "jitter_absolute")
|
||||||
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
||||||
|
|
||||||
if brush.sculpt_capabilities.has_smooth_stroke:
|
if brush.sculpt_capabilities.has_smooth_stroke:
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.separator()
|
col.separator()
|
||||||
@@ -945,9 +945,8 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
|
|||||||
sub.active = brush.use_smooth_stroke
|
sub.active = brush.use_smooth_stroke
|
||||||
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
|
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
|
||||||
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
|
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
|
||||||
|
|
||||||
layout.prop(settings, "input_samples")
|
|
||||||
|
|
||||||
|
layout.prop(settings, "input_samples")
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
|
class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
|
||||||
@@ -1217,7 +1216,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
|
|||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(ipaint, "use_normal_falloff")
|
row.prop(ipaint, "use_normal_falloff")
|
||||||
|
|
||||||
sub = row.row()
|
sub = row.row()
|
||||||
sub.active = (ipaint.use_normal_falloff)
|
sub.active = (ipaint.use_normal_falloff)
|
||||||
sub.prop(ipaint, "normal_angle", text="")
|
sub.prop(ipaint, "normal_angle", text="")
|
||||||
|
|||||||
@@ -3449,7 +3449,6 @@ KDTree *BKE_object_as_kdtree(Object *ob, int *r_tot)
|
|||||||
{
|
{
|
||||||
KDTree *tree = NULL;
|
KDTree *tree = NULL;
|
||||||
unsigned int tot = 0;
|
unsigned int tot = 0;
|
||||||
float co[3];
|
|
||||||
|
|
||||||
switch (ob->type) {
|
switch (ob->type) {
|
||||||
case OB_MESH:
|
case OB_MESH:
|
||||||
@@ -3471,6 +3470,7 @@ KDTree *BKE_object_as_kdtree(Object *ob, int *r_tot)
|
|||||||
/* we don't how how many verts from the DM we can use */
|
/* we don't how how many verts from the DM we can use */
|
||||||
for (i = 0; i < totvert; i++) {
|
for (i = 0; i < totvert; i++) {
|
||||||
if (index[i] != ORIGINDEX_NONE) {
|
if (index[i] != ORIGINDEX_NONE) {
|
||||||
|
float co[3];
|
||||||
mul_v3_m4v3(co, ob->obmat, mvert[i].co);
|
mul_v3_m4v3(co, ob->obmat, mvert[i].co);
|
||||||
BLI_kdtree_insert(tree, index[i], co, NULL);
|
BLI_kdtree_insert(tree, index[i], co, NULL);
|
||||||
tot++;
|
tot++;
|
||||||
@@ -3484,6 +3484,7 @@ KDTree *BKE_object_as_kdtree(Object *ob, int *r_tot)
|
|||||||
tree = BLI_kdtree_new(tot);
|
tree = BLI_kdtree_new(tot);
|
||||||
|
|
||||||
for (i = 0; i < tot; i++) {
|
for (i = 0; i < tot; i++) {
|
||||||
|
float co[3];
|
||||||
mul_v3_m4v3(co, ob->obmat, mvert[i].co);
|
mul_v3_m4v3(co, ob->obmat, mvert[i].co);
|
||||||
BLI_kdtree_insert(tree, i, co, NULL);
|
BLI_kdtree_insert(tree, i, co, NULL);
|
||||||
}
|
}
|
||||||
@@ -3513,6 +3514,7 @@ KDTree *BKE_object_as_kdtree(Object *ob, int *r_tot)
|
|||||||
bezt = nu->bezt;
|
bezt = nu->bezt;
|
||||||
a = nu->pntsu;
|
a = nu->pntsu;
|
||||||
while (a--) {
|
while (a--) {
|
||||||
|
float co[3];
|
||||||
mul_v3_m4v3(co, ob->obmat, bezt->vec[1]);
|
mul_v3_m4v3(co, ob->obmat, bezt->vec[1]);
|
||||||
BLI_kdtree_insert(tree, i++, co, NULL);
|
BLI_kdtree_insert(tree, i++, co, NULL);
|
||||||
bezt++;
|
bezt++;
|
||||||
@@ -3524,6 +3526,7 @@ KDTree *BKE_object_as_kdtree(Object *ob, int *r_tot)
|
|||||||
bp = nu->bp;
|
bp = nu->bp;
|
||||||
a = nu->pntsu * nu->pntsv;
|
a = nu->pntsu * nu->pntsv;
|
||||||
while (a--) {
|
while (a--) {
|
||||||
|
float co[3];
|
||||||
mul_v3_m4v3(co, ob->obmat, bp->vec);
|
mul_v3_m4v3(co, ob->obmat, bp->vec);
|
||||||
BLI_kdtree_insert(tree, i++, co, NULL);
|
BLI_kdtree_insert(tree, i++, co, NULL);
|
||||||
bp++;
|
bp++;
|
||||||
|
|||||||
@@ -165,8 +165,6 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
|
|||||||
int cd_edge_crease_offset = use_crease ? CustomData_get_offset(&bm->edata, CD_CREASE) : -1;
|
int cd_edge_crease_offset = use_crease ? CustomData_get_offset(&bm->edata, CD_CREASE) : -1;
|
||||||
const float crease_weight = 1.0f;
|
const float crease_weight = 1.0f;
|
||||||
|
|
||||||
//CustomData_has_layer(&bm->edata, CD_CREASE);
|
|
||||||
|
|
||||||
const int totvert_orig = bm->totvert;
|
const int totvert_orig = bm->totvert;
|
||||||
|
|
||||||
BMOIter oiter;
|
BMOIter oiter;
|
||||||
|
|||||||
@@ -3618,7 +3618,6 @@ static int viewroll_exec(bContext *C, wmOperator *op)
|
|||||||
View3D *v3d;
|
View3D *v3d;
|
||||||
RegionView3D *rv3d;
|
RegionView3D *rv3d;
|
||||||
ARegion *ar;
|
ARegion *ar;
|
||||||
float mousevec[3];
|
|
||||||
|
|
||||||
if (op->customdata) {
|
if (op->customdata) {
|
||||||
ViewOpsData *vod = op->customdata;
|
ViewOpsData *vod = op->customdata;
|
||||||
@@ -3630,9 +3629,6 @@ static int viewroll_exec(bContext *C, wmOperator *op)
|
|||||||
v3d = CTX_wm_view3d(C);
|
v3d = CTX_wm_view3d(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
negate_v3_v3(mousevec, ((RegionView3D *)ar->regiondata)->viewinv[2]);
|
|
||||||
normalize_v3(mousevec);
|
|
||||||
|
|
||||||
rv3d = ar->regiondata;
|
rv3d = ar->regiondata;
|
||||||
if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d)) {
|
if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d)) {
|
||||||
const float angle = RNA_float_get(op->ptr, "angle");
|
const float angle = RNA_float_get(op->ptr, "angle");
|
||||||
|
|||||||
@@ -2600,7 +2600,7 @@ static void rna_def_space_text(BlenderRNA *brna)
|
|||||||
prop = RNA_def_property(srna, "top", PROP_INT, PROP_NONE);
|
prop = RNA_def_property(srna, "top", PROP_INT, PROP_NONE);
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
RNA_def_property_int_sdna(prop, NULL, "top");
|
RNA_def_property_int_sdna(prop, NULL, "top");
|
||||||
RNA_def_property_ui_text(prop, "Top Line", "Top line visible.");
|
RNA_def_property_ui_text(prop, "Top Line", "Top line visible");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "visible_lines", PROP_INT, PROP_NONE);
|
prop = RNA_def_property(srna, "visible_lines", PROP_INT, PROP_NONE);
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|||||||
@@ -264,7 +264,6 @@ void wm_event_do_notifiers(bContext *C)
|
|||||||
if (note->category == NC_SCREEN) {
|
if (note->category == NC_SCREEN) {
|
||||||
if (note->data == ND_SCREENBROWSE) {
|
if (note->data == ND_SCREENBROWSE) {
|
||||||
/* free popup handlers only [#35434] */
|
/* free popup handlers only [#35434] */
|
||||||
wmWindow *win = CTX_wm_window(C);
|
|
||||||
UI_remove_popup_handlers_all(C, &win->modalhandlers);
|
UI_remove_popup_handlers_all(C, &win->modalhandlers);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user