style cleanup
also fix example for mesh uv's
This commit is contained in:
@@ -28,7 +28,7 @@ This example script prints the vertices and UV's for each polygon, assumes the a
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
me = bpy.context.object.data
|
me = bpy.context.object.data
|
||||||
uv_layer = me.uv.layers.active.data
|
uv_layer = me.uv_layers.active.data
|
||||||
|
|
||||||
for poly in me.polygons:
|
for poly in me.polygons:
|
||||||
print("Polygon index: %d, length: %d" % (poly.index, poly.loop_total))
|
print("Polygon index: %d, length: %d" % (poly.index, poly.loop_total))
|
||||||
|
|||||||
@@ -1166,9 +1166,11 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
|
|||||||
if (fstyle->kerning == 1)
|
if (fstyle->kerning == 1)
|
||||||
BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
|
BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
|
||||||
|
|
||||||
// ui_rasterpos_safe(x, y, but->aspect);
|
#if 0
|
||||||
// if (but->type==IDPOIN) transopts= 0; // no translation, of course!
|
ui_rasterpos_safe(x, y, but->aspect);
|
||||||
// else transopts= ui_translate_buttons();
|
if (but->type == IDPOIN) transopts = 0; // no translation, of course!
|
||||||
|
else transopts = ui_translate_buttons();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* cut string in 2 parts - only for menu entries */
|
/* cut string in 2 parts - only for menu entries */
|
||||||
if ((but->block->flag & UI_BLOCK_LOOP)) {
|
if ((but->block->flag & UI_BLOCK_LOOP)) {
|
||||||
|
|||||||
@@ -1497,7 +1497,8 @@ void OBJECT_OT_skin_loose_mark_clear(wmOperatorType *ot)
|
|||||||
static EnumPropertyItem action_items[] = {
|
static EnumPropertyItem action_items[] = {
|
||||||
{SKIN_LOOSE_MARK, "MARK", 0, "Mark", "Mark selected vertices as loose"},
|
{SKIN_LOOSE_MARK, "MARK", 0, "Mark", "Mark selected vertices as loose"},
|
||||||
{SKIN_LOOSE_CLEAR, "CLEAR", 0, "Clear", "Set selected vertices as not loose"},
|
{SKIN_LOOSE_CLEAR, "CLEAR", 0, "Clear", "Set selected vertices as not loose"},
|
||||||
{0, NULL, 0, NULL, NULL}};
|
{0, NULL, 0, NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
ot->name = "Skin Mark/Clear Loose";
|
ot->name = "Skin Mark/Clear Loose";
|
||||||
ot->description = "Mark/clear selected vertices as loose";
|
ot->description = "Mark/clear selected vertices as loose";
|
||||||
@@ -1649,8 +1650,8 @@ static Object *modifier_skin_armature_create(struct Scene *scene,
|
|||||||
EditBone *bone = NULL;
|
EditBone *bone = NULL;
|
||||||
|
|
||||||
/* Unless the skin root has just one adjacent edge, create
|
/* Unless the skin root has just one adjacent edge, create
|
||||||
a fake root bone (have it going off in the Y direction
|
* a fake root bone (have it going off in the Y direction
|
||||||
(arbitrary) */
|
* (arbitrary) */
|
||||||
if (emap[v].count > 1) {
|
if (emap[v].count > 1) {
|
||||||
bone = MEM_callocN(sizeof(EditBone), "EditBone");
|
bone = MEM_callocN(sizeof(EditBone), "EditBone");
|
||||||
|
|
||||||
|
|||||||
@@ -600,17 +600,17 @@ static SkinNode *build_frames(const MVert *mvert, int totvert,
|
|||||||
|
|
||||||
static void calc_edge_mat(float mat[3][3], const float a[3], const float b[3])
|
static void calc_edge_mat(float mat[3][3], const float a[3], const float b[3])
|
||||||
{
|
{
|
||||||
float Z[3] = {0, 0, 1};
|
const float z_up[3] = {0, 0, 1};
|
||||||
float dot;
|
float dot;
|
||||||
|
|
||||||
/* X = edge direction */
|
/* X = edge direction */
|
||||||
sub_v3_v3v3(mat[0], b, a);
|
sub_v3_v3v3(mat[0], b, a);
|
||||||
normalize_v3(mat[0]);
|
normalize_v3(mat[0]);
|
||||||
|
|
||||||
dot = dot_v3v3(mat[0], Z);
|
dot = dot_v3v3(mat[0], z_up);
|
||||||
if (dot > -1 + FLT_EPSILON && dot < 1 - FLT_EPSILON) {
|
if (dot > -1 + FLT_EPSILON && dot < 1 - FLT_EPSILON) {
|
||||||
/* Y = Z cross x */
|
/* Y = Z cross x */
|
||||||
cross_v3_v3v3(mat[1], Z, mat[0]);
|
cross_v3_v3v3(mat[1], z_up, mat[0]);
|
||||||
normalize_v3(mat[1]);
|
normalize_v3(mat[1]);
|
||||||
|
|
||||||
/* Z = x cross y */
|
/* Z = x cross y */
|
||||||
|
|||||||
Reference in New Issue
Block a user