Remove Armature Sketching & Retarget

While the feature is interesting, it's not much from what we can tell.

Retargeting is an important feature but needs
to fit in better with typical animation work-flows.

See: T52809
This commit is contained in:
Campbell Barton 2018-04-20 10:18:25 +02:00
parent 98422c36ab
commit 36773e35f6
Notes: blender-bot 2023-02-14 08:47:25 +01:00
Referenced by issue #52809, Proposal: Remove Skeleton Sketching
33 changed files with 7 additions and 11500 deletions

View File

@ -2278,17 +2278,6 @@ kmi.properties.value_2 = 'CONNECTED'
# Map Armature
km = kc.keymaps.new('Armature', space_type='EMPTY', region_type='WINDOW', modal=False)
kmi = km.keymap_items.new('sketch.delete', 'X', 'PRESS')
kmi = km.keymap_items.new('sketch.delete', 'DEL', 'PRESS')
kmi = km.keymap_items.new('sketch.finish_stroke', 'RIGHTMOUSE', 'PRESS')
kmi = km.keymap_items.new('sketch.cancel_stroke', 'ESC', 'PRESS')
kmi = km.keymap_items.new('sketch.gesture', 'LEFTMOUSE', 'PRESS', shift=True)
kmi = km.keymap_items.new('sketch.draw_stroke', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('sketch.draw_stroke', 'LEFTMOUSE', 'PRESS', ctrl=True)
kmi.properties.snap = True
kmi = km.keymap_items.new('sketch.draw_preview', 'MOUSEMOVE', 'ANY')
kmi = km.keymap_items.new('sketch.draw_preview', 'MOUSEMOVE', 'ANY', ctrl=True)
kmi.properties.snap = True
kmi = km.keymap_items.new('armature.hide', 'H', 'PRESS')
kmi.properties.unselected = False
kmi = km.keymap_items.new('armature.hide', 'H', 'PRESS', shift=True)

View File

@ -770,17 +770,6 @@ kmi.properties.value_2 = 'CONNECTED'
# Map Armature
km = kc.keymaps.new('Armature', space_type='EMPTY', region_type='WINDOW', modal=False)
kmi = km.keymap_items.new('sketch.delete', 'BACK_SPACE', 'PRESS')
kmi = km.keymap_items.new('sketch.delete', 'DEL', 'PRESS')
kmi = km.keymap_items.new('sketch.finish_stroke', 'RIGHTMOUSE', 'PRESS')
kmi = km.keymap_items.new('sketch.cancel_stroke', 'ESC', 'PRESS')
kmi = km.keymap_items.new('sketch.gesture', 'LEFTMOUSE', 'PRESS', shift=True)
kmi = km.keymap_items.new('sketch.draw_stroke', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('sketch.draw_stroke', 'LEFTMOUSE', 'PRESS', ctrl=True)
kmi.properties.snap = True
kmi = km.keymap_items.new('sketch.draw_preview', 'MOUSEMOVE', 'ANY')
kmi = km.keymap_items.new('sketch.draw_preview', 'MOUSEMOVE', 'ANY', ctrl=True)
kmi.properties.snap = True
kmi = km.keymap_items.new('armature.hide', 'H', 'PRESS', ctrl=True)
kmi.properties.unselected = False
kmi = km.keymap_items.new('armature.hide', 'H', 'PRESS', alt=True)

View File

@ -3716,63 +3716,6 @@ class VIEW3D_PT_transform_orientations(Panel):
row.operator("transform.delete_orientation", text="", icon='X')
class VIEW3D_PT_etch_a_ton(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Skeleton Sketching"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
scene = context.space_data
ob = context.active_object
return scene and ob and ob.type == 'ARMATURE' and ob.mode == 'EDIT'
def draw_header(self, context):
layout = self.layout
toolsettings = context.scene.tool_settings
layout.prop(toolsettings, "use_bone_sketching", text="")
def draw(self, context):
layout = self.layout
toolsettings = context.scene.tool_settings
col = layout.column()
col.prop(toolsettings, "use_etch_quick")
col.prop(toolsettings, "use_etch_overdraw")
col.separator()
col.prop(toolsettings, "etch_convert_mode")
if toolsettings.etch_convert_mode == 'LENGTH':
col.prop(toolsettings, "etch_length_limit")
elif toolsettings.etch_convert_mode == 'ADAPTIVE':
col.prop(toolsettings, "etch_adaptive_limit")
elif toolsettings.etch_convert_mode == 'FIXED':
col.prop(toolsettings, "etch_subdivision_number")
elif toolsettings.etch_convert_mode == 'RETARGET':
col.prop(toolsettings, "etch_template")
col.prop(toolsettings, "etch_roll_mode")
col.separator()
colsub = col.column(align=True)
colsub.prop(toolsettings, "use_etch_autoname")
sub = colsub.column(align=True)
sub.enabled = not toolsettings.use_etch_autoname
sub.prop(toolsettings, "etch_number")
sub.prop(toolsettings, "etch_side")
col.separator()
col.operator("sketch.convert", text="Convert to Bones")
col.operator("sketch.delete", text="Delete Strokes")
class VIEW3D_PT_context_properties(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
@ -3948,7 +3891,6 @@ classes = (
VIEW3D_PT_view3d_meshstatvis,
VIEW3D_PT_view3d_curvedisplay,
VIEW3D_PT_transform_orientations,
VIEW3D_PT_etch_a_ton,
VIEW3D_PT_context_properties,
)

View File

@ -1,149 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BKE_SKETCH_H__
#define __BKE_SKETCH_H__
/** \file BKE_sketch.h
* \ingroup bke
*/
typedef enum SK_PType {
PT_CONTINUOUS,
PT_EXACT,
} SK_PType;
typedef enum SK_PMode {
PT_SNAP,
PT_PROJECT,
} SK_PMode;
typedef struct SK_Point {
float p[3];
short p2d[2];
float no[3];
float size;
SK_PType type;
SK_PMode mode;
} SK_Point;
typedef struct SK_Stroke {
struct SK_Stroke *next, *prev;
SK_Point *points;
int nb_points;
int buf_size;
int selected;
} SK_Stroke;
#define SK_OVERDRAW_LIMIT 5
typedef struct SK_Overdraw {
SK_Stroke *target;
int start, end;
int count;
} SK_Overdraw;
#define SK_Stroke_BUFFER_INIT_SIZE 20
typedef struct SK_DrawData {
int mval[2];
int previous_mval[2];
SK_PType type;
} SK_DrawData;
typedef struct SK_Intersection {
struct SK_Intersection *next, *prev;
SK_Stroke *stroke;
int before;
int after;
int gesture_index;
float p[3];
float lambda; /* used for sorting intersection points */
} SK_Intersection;
typedef struct SK_Sketch {
ListBase strokes;
SK_Stroke *active_stroke;
SK_Stroke *gesture;
SK_Point next_point;
SK_Overdraw over;
} SK_Sketch;
typedef struct SK_Gesture {
SK_Stroke *stk;
SK_Stroke *segments;
ListBase intersections;
ListBase self_intersections;
int nb_self_intersections;
int nb_intersections;
int nb_segments;
} SK_Gesture;
/************************************************/
void freeSketch(SK_Sketch *sketch);
SK_Sketch *createSketch(void);
void sk_removeStroke(SK_Sketch *sketch, SK_Stroke *stk);
void sk_freeStroke(SK_Stroke *stk);
SK_Stroke *sk_createStroke(void);
SK_Point *sk_lastStrokePoint(SK_Stroke *stk);
void sk_allocStrokeBuffer(SK_Stroke *stk);
void sk_shrinkStrokeBuffer(SK_Stroke *stk);
void sk_growStrokeBuffer(SK_Stroke *stk);
void sk_growStrokeBufferN(SK_Stroke *stk, int n);
void sk_replaceStrokePoint(SK_Stroke *stk, SK_Point *pt, int n);
void sk_insertStrokePoint(SK_Stroke *stk, SK_Point *pt, int n);
void sk_appendStrokePoint(SK_Stroke *stk, SK_Point *pt);
void sk_insertStrokePoints(SK_Stroke *stk, SK_Point *pts, int len, int start, int end);
void sk_trimStroke(SK_Stroke *stk, int start, int end);
void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], float p_end[3]);
void sk_polygonizeStroke(SK_Stroke *stk, int start, int end);
void sk_flattenStroke(SK_Stroke *stk, int start, int end);
void sk_reverseStroke(SK_Stroke *stk);
void sk_filterLastContinuousStroke(SK_Stroke *stk);
void sk_filterStroke(SK_Stroke *stk, int start, int end);
void sk_initPoint(SK_Point *pt, SK_DrawData *dd, const float no[3]);
void sk_copyPoint(SK_Point *dst, SK_Point *src);
int sk_stroke_filtermval(SK_DrawData *dd);
void sk_endContinuousStroke(SK_Stroke *stk);
void sk_updateNextPoint(SK_Sketch *sketch, SK_Stroke *stk);
void sk_initDrawData(SK_DrawData *dd, const int mval[2]);
void sk_deleteSelectedStrokes(SK_Sketch *sketch);
void sk_selectAllSketch(SK_Sketch *sketch, int mode);
#endif

View File

@ -176,7 +176,6 @@ set(SRC
intern/seqmodifier.c
intern/sequencer.c
intern/shrinkwrap.c
intern/sketch.c
intern/smoke.c
intern/softbody.c
intern/sound.c
@ -296,7 +295,6 @@ set(SRC
BKE_screen.h
BKE_sequencer.h
BKE_shrinkwrap.h
BKE_sketch.h
BKE_smoke.h
BKE_softbody.h
BKE_sound.h

View File

@ -73,7 +73,6 @@
#include "BKE_scene.h"
#include "BIK_api.h"
#include "BKE_sketch.h"
/* **************** Generic Functions, data level *************** */
@ -135,12 +134,6 @@ void BKE_armature_free(bArmature *arm)
MEM_freeN(arm->edbo);
arm->edbo = NULL;
}
/* free sketch */
if (arm->sketch) {
freeSketch(arm->sketch);
arm->sketch = NULL;
}
}
void BKE_armature_make_local(Main *bmain, bArmature *arm, const bool lib_local)
@ -204,7 +197,6 @@ void BKE_armature_copy_data(Main *UNUSED(bmain), bArmature *arm_dst, const bArma
arm_dst->edbo = NULL;
arm_dst->act_edbone = NULL;
arm_dst->sketch = NULL;
}
bArmature *BKE_armature_copy(Main *bmain, const bArmature *arm)

View File

@ -445,8 +445,6 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
}
if (toolsett) {
CALLBACK_INVOKE(toolsett->skgen_template, IDWALK_CB_NOP);
CALLBACK_INVOKE(toolsett->particle.scene, IDWALK_CB_NOP);
CALLBACK_INVOKE(toolsett->particle.object, IDWALK_CB_NOP);
CALLBACK_INVOKE(toolsett->particle.shape_object, IDWALK_CB_NOP);

View File

@ -659,21 +659,6 @@ void BKE_scene_init(Scene *sce)
sce->toolsettings->snap_node_mode = SCE_SNAP_MODE_GRID;
sce->toolsettings->skgen_resolution = 100;
sce->toolsettings->skgen_threshold_internal = 0.01f;
sce->toolsettings->skgen_threshold_external = 0.01f;
sce->toolsettings->skgen_angle_limit = 45.0f;
sce->toolsettings->skgen_length_ratio = 1.3f;
sce->toolsettings->skgen_length_limit = 1.5f;
sce->toolsettings->skgen_correlation_limit = 0.98f;
sce->toolsettings->skgen_symmetry_limit = 0.1f;
sce->toolsettings->skgen_postpro = SKGEN_SMOOTH;
sce->toolsettings->skgen_postpro_passes = 1;
sce->toolsettings->skgen_options = SKGEN_FILTER_INTERNAL | SKGEN_FILTER_EXTERNAL | SKGEN_FILTER_SMART | SKGEN_HARMONIC | SKGEN_SUB_CORRELATION | SKGEN_STICK_TO_EMBEDDING;
sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
sce->toolsettings->curve_paint_settings.curve_type = CU_BEZIER;
sce->toolsettings->curve_paint_settings.flag |= CURVE_PAINT_FLAG_CORNERS_DETECT;
sce->toolsettings->curve_paint_settings.error_threshold = 8;

View File

@ -1,555 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/blenkernel/intern/sketch.c
* \ingroup bke
*/
#include <string.h>
#include <math.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_sketch.h"
#include "DNA_userdef_types.h"
void freeSketch(SK_Sketch *sketch)
{
SK_Stroke *stk, *next;
for (stk = sketch->strokes.first; stk; stk = next) {
next = stk->next;
sk_freeStroke(stk);
}
MEM_freeN(sketch);
}
SK_Sketch *createSketch(void)
{
SK_Sketch *sketch;
sketch = MEM_callocN(sizeof(SK_Sketch), "SK_Sketch");
sketch->active_stroke = NULL;
sketch->gesture = NULL;
BLI_listbase_clear(&sketch->strokes);
return sketch;
}
void sk_initPoint(SK_Point *pt, SK_DrawData *dd, const float no[3])
{
if (no) {
normalize_v3_v3(pt->no, no);
}
else {
pt->no[0] = 0.0f;
pt->no[1] = 0.0f;
pt->no[2] = 1.0f;
}
pt->p2d[0] = dd->mval[0];
pt->p2d[1] = dd->mval[1];
pt->size = 0.0f;
pt->type = PT_CONTINUOUS;
pt->mode = PT_SNAP;
/* more init code here */
}
void sk_copyPoint(SK_Point *dst, SK_Point *src)
{
memcpy(dst, src, sizeof(SK_Point));
}
void sk_allocStrokeBuffer(SK_Stroke *stk)
{
stk->points = MEM_callocN(sizeof(SK_Point) * stk->buf_size, "SK_Point buffer");
}
void sk_freeStroke(SK_Stroke *stk)
{
MEM_freeN(stk->points);
MEM_freeN(stk);
}
SK_Stroke *sk_createStroke(void)
{
SK_Stroke *stk;
stk = MEM_callocN(sizeof(SK_Stroke), "SK_Stroke");
stk->selected = 0;
stk->nb_points = 0;
stk->buf_size = SK_Stroke_BUFFER_INIT_SIZE;
sk_allocStrokeBuffer(stk);
return stk;
}
void sk_shrinkStrokeBuffer(SK_Stroke *stk)
{
if (stk->nb_points < stk->buf_size) {
SK_Point *old_points = stk->points;
stk->buf_size = stk->nb_points;
sk_allocStrokeBuffer(stk);
memcpy(stk->points, old_points, sizeof(SK_Point) * stk->nb_points);
MEM_freeN(old_points);
}
}
void sk_growStrokeBuffer(SK_Stroke *stk)
{
if (stk->nb_points == stk->buf_size) {
SK_Point *old_points = stk->points;
stk->buf_size *= 2;
sk_allocStrokeBuffer(stk);
memcpy(stk->points, old_points, sizeof(SK_Point) * stk->nb_points);
MEM_freeN(old_points);
}
}
void sk_growStrokeBufferN(SK_Stroke *stk, int n)
{
if (stk->nb_points + n > stk->buf_size) {
SK_Point *old_points = stk->points;
while (stk->nb_points + n > stk->buf_size) {
stk->buf_size *= 2;
}
sk_allocStrokeBuffer(stk);
memcpy(stk->points, old_points, sizeof(SK_Point) * stk->nb_points);
MEM_freeN(old_points);
}
}
void sk_replaceStrokePoint(SK_Stroke *stk, SK_Point *pt, int n)
{
memcpy(stk->points + n, pt, sizeof(SK_Point));
}
void sk_insertStrokePoint(SK_Stroke *stk, SK_Point *pt, int n)
{
int size = stk->nb_points - n;
sk_growStrokeBuffer(stk);
memmove(stk->points + n + 1, stk->points + n, size * sizeof(SK_Point));
memcpy(stk->points + n, pt, sizeof(SK_Point));
stk->nb_points++;
}
void sk_appendStrokePoint(SK_Stroke *stk, SK_Point *pt)
{
sk_growStrokeBuffer(stk);
memcpy(stk->points + stk->nb_points, pt, sizeof(SK_Point));
stk->nb_points++;
}
void sk_insertStrokePoints(SK_Stroke *stk, SK_Point *pts, int len, int start, int end)
{
int size = end - start;
sk_growStrokeBufferN(stk, len - size);
if (len != size) {
int tail_size = stk->nb_points - end;
memmove(stk->points + start + len, stk->points + end, tail_size * sizeof(SK_Point));
}
memcpy(stk->points + start, pts, len * sizeof(SK_Point));
stk->nb_points += len - size;
}
void sk_trimStroke(SK_Stroke *stk, int start, int end)
{
int size = end - start + 1;
if (start > 0) {
memmove(stk->points, stk->points + start, size * sizeof(SK_Point));
}
stk->nb_points = size;
}
void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], float p_end[3])
{
SK_Point pt1, pt2;
SK_Point *prev, *next;
float delta_p[3];
int i, total;
total = end - start;
sub_v3_v3v3(delta_p, p_end, p_start);
prev = stk->points + start;
next = stk->points + end;
copy_v3_v3(pt1.p, p_start);
copy_v3_v3(pt1.no, prev->no);
pt1.mode = prev->mode;
pt1.type = prev->type;
copy_v3_v3(pt2.p, p_end);
copy_v3_v3(pt2.no, next->no);
pt2.mode = next->mode;
pt2.type = next->type;
sk_insertStrokePoint(stk, &pt1, start + 1); /* insert after start */
sk_insertStrokePoint(stk, &pt2, end + 1); /* insert before end (since end was pushed back already) */
for (i = 1; i < total; i++) {
float delta = (float)i / (float)total;
float *p = stk->points[start + 1 + i].p;
mul_v3_v3fl(p, delta_p, delta);
add_v3_v3(p, p_start);
}
}
void sk_polygonizeStroke(SK_Stroke *stk, int start, int end)
{
int offset;
int i;
/* find first exact points outside of range */
for (; start > 0; start--) {
if (stk->points[start].type == PT_EXACT) {
break;
}
}
for (; end < stk->nb_points - 1; end++) {
if (stk->points[end].type == PT_EXACT) {
break;
}
}
offset = start + 1;
for (i = start + 1; i < end; i++) {
if (stk->points[i].type == PT_EXACT) {
if (offset != i) {
memcpy(stk->points + offset, stk->points + i, sizeof(SK_Point));
}
offset++;
}
}
/* some points were removes, move end of array */
if (offset < end) {
int size = stk->nb_points - end;
memmove(stk->points + offset, stk->points + end, size * sizeof(SK_Point));
stk->nb_points = offset + size;
}
}
void sk_flattenStroke(SK_Stroke *stk, int start, int end)
{
float normal[3], distance[3];
float limit;
int i, total;
total = end - start + 1;
copy_v3_v3(normal, stk->points[start].no);
sub_v3_v3v3(distance, stk->points[end].p, stk->points[start].p);
project_v3_v3v3(normal, distance, normal);
limit = normalize_v3(normal);
for (i = 1; i < total - 1; i++) {
float d = limit * i / total;
float offset[3];
float *p = stk->points[start + i].p;
sub_v3_v3v3(distance, p, stk->points[start].p);
project_v3_v3v3(distance, distance, normal);
copy_v3_v3(offset, normal);
mul_v3_fl(offset, d);
sub_v3_v3(p, distance);
add_v3_v3(p, offset);
}
}
void sk_removeStroke(SK_Sketch *sketch, SK_Stroke *stk)
{
if (sketch->active_stroke == stk) {
sketch->active_stroke = NULL;
}
BLI_remlink(&sketch->strokes, stk);
sk_freeStroke(stk);
}
void sk_reverseStroke(SK_Stroke *stk)
{
SK_Point *old_points = stk->points;
int i = 0;
sk_allocStrokeBuffer(stk);
for (i = 0; i < stk->nb_points; i++) {
sk_copyPoint(stk->points + i, old_points + stk->nb_points - 1 - i);
}
MEM_freeN(old_points);
}
/* Ramer-Douglas-Peucker algorithm for line simplification */
void sk_filterStroke(SK_Stroke *stk, int start, int end)
{
SK_Point *old_points = stk->points;
int nb_points = stk->nb_points;
char *marked = NULL;
char work;
int i;
if (start == -1) {
start = 0;
end = stk->nb_points - 1;
}
sk_allocStrokeBuffer(stk);
stk->nb_points = 0;
/* adding points before range */
for (i = 0; i < start; i++) {
sk_appendStrokePoint(stk, old_points + i);
}
marked = MEM_callocN(nb_points, "marked array");
marked[start] = 1;
marked[end] = 1;
work = 1;
/* while still reducing */
while (work) {
int ls, le;
work = 0;
ls = start;
le = start + 1;
/* while not over interval */
while (ls < end) {
int max_i = 0;
short v1[2];
float max_dist = 16; /* more than 4 pixels */
/* find the next marked point */
while (marked[le] == 0) {
le++;
}
/* perpendicular vector to ls-le */
v1[1] = old_points[le].p2d[0] - old_points[ls].p2d[0];
v1[0] = old_points[ls].p2d[1] - old_points[le].p2d[1];
for (i = ls + 1; i < le; i++) {
float mul;
float dist;
short v2[2];
v2[0] = old_points[i].p2d[0] - old_points[ls].p2d[0];
v2[1] = old_points[i].p2d[1] - old_points[ls].p2d[1];
if (v2[0] == 0 && v2[1] == 0) {
continue;
}
mul = (float)(v1[0] * v2[0] + v1[1] * v2[1]) / (float)(v2[0] * v2[0] + v2[1] * v2[1]);
dist = mul * mul * (v2[0] * v2[0] + v2[1] * v2[1]);
if (dist > max_dist) {
max_dist = dist;
max_i = i;
}
}
if (max_i != 0) {
work = 1;
marked[max_i] = 1;
}
ls = le;
le = ls + 1;
}
}
/* adding points after range */
for (i = start; i <= end; i++) {
if (marked[i]) {
sk_appendStrokePoint(stk, old_points + i);
}
}
MEM_freeN(marked);
/* adding points after range */
for (i = end + 1; i < nb_points; i++) {
sk_appendStrokePoint(stk, old_points + i);
}
MEM_freeN(old_points);
sk_shrinkStrokeBuffer(stk);
}
void sk_filterLastContinuousStroke(SK_Stroke *stk)
{
int start, end;
end = stk->nb_points - 1;
for (start = end - 1; start > 0 && stk->points[start].type == PT_CONTINUOUS; start--) {
/* nothing to do here*/
}
if (end - start > 1) {
sk_filterStroke(stk, start, end);
}
}
SK_Point *sk_lastStrokePoint(SK_Stroke *stk)
{
SK_Point *pt = NULL;
if (stk->nb_points > 0) {
pt = stk->points + (stk->nb_points - 1);
}
return pt;
}
void sk_endContinuousStroke(SK_Stroke *stk)
{
stk->points[stk->nb_points - 1].type = PT_EXACT;
}
void sk_updateNextPoint(SK_Sketch *sketch, SK_Stroke *stk)
{
if (stk) {
memcpy(&(sketch->next_point), &(stk->points[stk->nb_points - 1]), sizeof(SK_Point));
}
}
int sk_stroke_filtermval(SK_DrawData *dd)
{
int retval = 0;
if (ABS(dd->mval[0] - dd->previous_mval[0]) + ABS(dd->mval[1] - dd->previous_mval[1]) > U.gp_manhattendist) {
retval = 1;
}
return retval;
}
void sk_initDrawData(SK_DrawData *dd, const int mval[2])
{
dd->mval[0] = mval[0];
dd->mval[1] = mval[1];
dd->previous_mval[0] = -1;
dd->previous_mval[1] = -1;
dd->type = PT_EXACT;
}
void sk_deleteSelectedStrokes(SK_Sketch *sketch)
{
SK_Stroke *stk, *next;
for (stk = sketch->strokes.first; stk; stk = next) {
next = stk->next;
if (stk->selected == 1) {
sk_removeStroke(sketch, stk);
}
}
}
void sk_selectAllSketch(SK_Sketch *sketch, int mode)
{
SK_Stroke *stk = NULL;
if (mode == -1) {
for (stk = sketch->strokes.first; stk; stk = stk->next) {
stk->selected = 0;
}
}
else if (mode == 0) {
for (stk = sketch->strokes.first; stk; stk = stk->next) {
stk->selected = 1;
}
}
else if (mode == 1) {
int selected = 1;
for (stk = sketch->strokes.first; stk; stk = stk->next) {
selected &= stk->selected;
}
selected ^= 1;
for (stk = sketch->strokes.first; stk; stk = stk->next) {
stk->selected = selected;
}
}
}

View File

@ -1,185 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
* Contributor(s): Joshua Leung
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BLI_GRAPH_H__
#define __BLI_GRAPH_H__
/** \file BLI_graph.h
* \ingroup bli
*/
#include "DNA_listBase.h"
struct BGraph;
struct BNode;
struct BArc;
struct RadialArc;
typedef void (*FreeArc)(struct BArc *);
typedef void (*FreeNode)(struct BNode *);
typedef void (*RadialSymmetry)(struct BNode *root_node, struct RadialArc *ring, int total);
typedef void (*AxialSymmetry)(struct BNode *root_node, struct BNode *node1, struct BNode *node2, struct BArc *arc1, struct BArc *arc2);
/* IF YOU MODIFY THOSE TYPES, YOU NEED TO UPDATE ALL THOSE THAT "INHERIT" FROM THEM
*
* RigGraph, ReebGraph
*
* */
typedef struct BGraph {
ListBase arcs;
ListBase nodes;
float length;
/* function pointer to deal with custom fonctionnality */
FreeArc free_arc;
FreeNode free_node;
RadialSymmetry radial_symmetry;
AxialSymmetry axial_symmetry;
} BGraph;
typedef struct BNode {
void *next, *prev;
float p[3];
int flag;
int degree;
struct BArc **arcs;
int subgraph_index;
int symmetry_level;
int symmetry_flag;
float symmetry_axis[3];
} BNode;
typedef struct BArc {
void *next, *prev;
struct BNode *head, *tail;
int flag;
float length;
int symmetry_level;
int symmetry_group;
int symmetry_flag;
} BArc;
struct BArcIterator;
void *IT_head(void *iter);
void *IT_tail(void *iter);
void *IT_peek(void *iter, int n);
void *IT_next(void *iter);
void *IT_nextN(void *iter, int n);
void *IT_previous(void *iter);
int IT_stopped(void *iter);
typedef void * (*HeadFct)(void *iter);
typedef void * (*TailFct)(void *iter);
typedef void * (*PeekFct)(void *iter, int n);
typedef void * (*NextFct)(void *iter);
typedef void * (*NextNFct)(void *iter, int n);
typedef void * (*PreviousFct)(void *iter);
typedef int (*StoppedFct)(void *iter);
typedef struct BArcIterator {
HeadFct head;
TailFct tail;
PeekFct peek;
NextFct next;
NextNFct nextN;
PreviousFct previous;
StoppedFct stopped;
float *p, *no;
float size;
int length;
int index;
} BArcIterator;
/* Helper structure for radial symmetry */
typedef struct RadialArc {
struct BArc *arc;
float n[3]; /* normalized vector joining the nodes of the arc */
} RadialArc;
BNode *BLI_otherNode(BArc *arc, BNode *node);
void BLI_freeNode(BGraph *graph, BNode *node);
void BLI_removeNode(BGraph *graph, BNode *node);
void BLI_removeArc(BGraph *graph, BArc *arc);
void BLI_flagNodes(BGraph *graph, int flag);
void BLI_flagArcs(BGraph *graph, int flag);
bool BLI_hasAdjacencyList(BGraph *rg);
void BLI_buildAdjacencyList(BGraph *rg);
void BLI_rebuildAdjacencyListForNode(BGraph *rg, BNode *node);
void BLI_freeAdjacencyList(BGraph *rg);
int BLI_FlagSubgraphs(BGraph *graph);
void BLI_ReflagSubgraph(BGraph *graph, int old_subgraph, int new_subgraph);
#define SHAPE_RADIX 10 /* each shape level is encoded this base */
int BLI_subtreeShape(BGraph *graph, BNode *node, BArc *rootArc, int include_root);
float BLI_subtreeLength(BNode *node);
void BLI_calcGraphLength(BGraph *graph);
void BLI_replaceNode(BGraph *graph, BNode *node_src, BNode *node_replaced);
void BLI_replaceNodeInArc(BGraph *graph, BArc *arc, BNode *node_src, BNode *node_replaced);
void BLI_removeDoubleNodes(BGraph *graph, float limit);
BNode *BLI_FindNodeByPosition(BGraph *graph, const float p[3], const float limit);
BArc *BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v);
bool BLI_isGraphCyclic(BGraph *graph);
/*------------ Symmetry handling ------------*/
void BLI_markdownSymmetry(BGraph *graph, BNode *root_node, float limit);
void BLI_mirrorAlongAxis(float v[3], float center[3], float axis[3]);
/* BNode symmetry flags */
#define SYM_TOPOLOGICAL 1
#define SYM_PHYSICAL 2
/* the following two are exclusive */
#define SYM_AXIAL 4
#define SYM_RADIAL 8
/* BArc symmetry flags
*
* axial symmetry sides */
#define SYM_SIDE_POSITIVE 1
#define SYM_SIDE_NEGATIVE 2
/* Anything higher is the order in radial symmetry */
#define SYM_SIDE_RADIAL 3
#endif /*__BLI_GRAPH_H__*/

View File

@ -71,7 +71,6 @@ set(SRC
intern/fileops.c
intern/fnmatch.c
intern/freetypefont.c
intern/graph.c
intern/gsqueue.c
intern/hash_md5.c
intern/hash_mm2a.c
@ -154,7 +153,6 @@ set(SRC
BLI_fileops_types.h
BLI_fnmatch.h
BLI_ghash.h
BLI_graph.h
BLI_gsqueue.h
BLI_hash.h
BLI_hash_md5.h

File diff suppressed because it is too large Load Diff

View File

@ -3556,7 +3556,6 @@ static void direct_link_armature(FileData *fd, bArmature *arm)
link_list(fd, &arm->bonebase);
arm->edbo = NULL;
arm->sketch = NULL;
arm->adt = newdataadr(fd, arm->adt);
direct_link_animdata(fd, arm->adt);
@ -5680,8 +5679,6 @@ static void lib_link_scene(FileData *fd, Main *main)
sce->toolsettings->imapaint.canvas =
newlibadr_us(fd, sce->id.lib, sce->toolsettings->imapaint.canvas);
sce->toolsettings->skgen_template = newlibadr(fd, sce->id.lib, sce->toolsettings->skgen_template);
sce->toolsettings->particle.shape_object = newlibadr(fd, sce->id.lib, sce->toolsettings->particle.shape_object);
for (Base *base_legacy_next, *base_legacy = sce->base.first; base_legacy; base_legacy = base_legacy_next) {

View File

@ -2176,22 +2176,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
/* sanity check for skgen */
{
Scene *sce;
for (sce = main->scene.first; sce; sce = sce->id.next) {
if (sce->toolsettings->skgen_subdivisions[0] == sce->toolsettings->skgen_subdivisions[1] ||
sce->toolsettings->skgen_subdivisions[0] == sce->toolsettings->skgen_subdivisions[2] ||
sce->toolsettings->skgen_subdivisions[1] == sce->toolsettings->skgen_subdivisions[2])
{
sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
}
}
}
if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 2)) {
Image *ima;
@ -2569,31 +2553,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
for (sce = main->scene.first; sce; sce = sce->id.next) {
sce->toolsettings->imapaint.seam_bleed = 2;
sce->toolsettings->imapaint.normal_angle = 80;
/* initialize skeleton generation toolsettings */
sce->toolsettings->skgen_resolution = 250;
sce->toolsettings->skgen_threshold_internal = 0.1f;
sce->toolsettings->skgen_threshold_external = 0.1f;
sce->toolsettings->skgen_angle_limit = 30.0f;
sce->toolsettings->skgen_length_ratio = 1.3f;
sce->toolsettings->skgen_length_limit = 1.5f;
sce->toolsettings->skgen_correlation_limit = 0.98f;
sce->toolsettings->skgen_symmetry_limit = 0.1f;
sce->toolsettings->skgen_postpro = SKGEN_SMOOTH;
sce->toolsettings->skgen_postpro_passes = 3;
sce->toolsettings->skgen_options = SKGEN_FILTER_INTERNAL|SKGEN_FILTER_EXTERNAL|SKGEN_FILTER_SMART|SKGEN_SUB_CORRELATION|SKGEN_HARMONIC;
sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
sce->toolsettings->skgen_retarget_angle_weight = 1.0f;
sce->toolsettings->skgen_retarget_length_weight = 1.0f;
sce->toolsettings->skgen_retarget_distance_weight = 1.0f;
/* Skeleton Sketching */
sce->toolsettings->bone_sketching = 0;
sce->toolsettings->skgen_retarget_roll = SK_RETARGET_ROLL_VIEW;
}
}

View File

@ -1,49 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/armature/BIF_generate.h
* \ingroup edarmature
*/
#ifndef __BIF_GENERATE_H__
#define __BIF_GENERATE_H__
struct ToolSettings;
struct EditBone;
struct BArcIterator;
struct bArmature;
struct ListBase;
typedef int (NextSubdivisionFunc)(struct ToolSettings *, struct BArcIterator *, int, int, float[3], float[3]);
float calcArcCorrelation(struct BArcIterator *iter, int start, int end, float v0[3], float n[3]);
int nextFixedSubdivision(struct ToolSettings *toolsettings, struct BArcIterator *iter, int start, int end, float head[3], float p[3]);
int nextLengthSubdivision(struct ToolSettings *toolsettings, struct BArcIterator *iter, int start, int end, float head[3], float p[3]);
int nextAdaptativeSubdivision(struct ToolSettings *toolsettings, struct BArcIterator *iter, int start, int end, float head[3], float p[3]);
struct EditBone *subdivideArcBy(struct ToolSettings *toolsettings, struct bArmature *arm, ListBase *editbones, struct BArcIterator *iter,
float invmat[4][4], float tmat[3][3], NextSubdivisionFunc next_subdividion);
void setBoneRollFromNormal(struct EditBone *bone, const float no[3], float invmat[4][4], float tmat[3][3]);
#endif /* __BIF_GENERATE_H__ */

View File

@ -1,171 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/armature/BIF_retarget.h
* \ingroup edarmature
*/
#ifndef __BIF_RETARGET_H__
#define __BIF_RETARGET_H__
#include "DNA_listBase.h"
#include "BLI_graph.h"
#include "BLI_ghash.h"
#include "BLI_task.h"
#include "BLI_threads.h"
#include "reeb.h"
struct Object;
struct bArmature;
struct bContext;
struct EditBone;
struct RigGraph;
struct RigNode;
struct RigArc;
struct RigEdge;
#define USE_THREADS
typedef struct RigGraph {
ListBase arcs;
ListBase nodes;
float length;
FreeArc free_arc;
FreeNode free_node;
RadialSymmetry radial_symmetry;
AxialSymmetry axial_symmetry;
/*********************************/
int flag;
ListBase controls;
ListBase *editbones;
struct RigNode *head;
ReebGraph *link_mesh;
TaskScheduler *task_scheduler;
TaskPool *task_pool;
GHash *bones_map; /* map of editbones by name */
GHash *controls_map; /* map of rigcontrols by bone pointer */
struct Object *ob;
} RigGraph;
typedef struct RigNode {
void *next, *prev;
float p[3];
int flag;
int degree;
struct BArc **arcs;
int subgraph_index;
int symmetry_level;
int symmetry_flag;
float symmetry_axis[3];
/*********************************/
ReebNode *link_mesh;
} RigNode;
typedef struct RigArc {
void *next, *prev;
RigNode *head, *tail;
int flag;
float length;
int symmetry_level;
int symmetry_group;
int symmetry_flag;
/*********************************/
ListBase edges;
int count;
ReebArc *link_mesh;
} RigArc;
typedef struct RigEdge {
struct RigEdge *next, *prev;
float head[3], tail[3];
float length;
float angle; /* angle to next edge */
float up_angle; /* angle between up_axis and the joint normal (defined as Previous edge CrossProduct Current edge */
struct EditBone *bone;
float up_axis[3];
} RigEdge;
/* Graph flags */
#define RIG_FREE_BONELIST 1
/* Control flags */
#define RIG_CTRL_HEAD_DONE 1
#define RIG_CTRL_TAIL_DONE 2
#define RIG_CTRL_PARENT_DEFORM 4
#define RIG_CTRL_FIT_ROOT 8
#define RIG_CTRL_FIT_BONE 16
#define RIG_CTRL_DONE (RIG_CTRL_HEAD_DONE | RIG_CTRL_TAIL_DONE)
/* Control tail flags */
typedef enum {
TL_NONE = 0,
TL_TAIL,
TL_HEAD
} LinkTailMode;
typedef struct RigControl {
struct RigControl *next, *prev;
float head[3], tail[3];
struct EditBone *bone;
struct EditBone *link;
struct EditBone *link_tail;
float up_axis[3];
float offset[3];
float qrot[4]; /* for dual linked bones, store the rotation of the linked bone for the finalization */
int flag;
LinkTailMode tail_mode;
} RigControl;
void BIF_retargetArc(struct bContext *C, ReebArc *earc, RigGraph *template_rigg);
RigGraph *RIG_graphFromArmature(const struct bContext *C, struct Object *ob, struct bArmature *arm);
int RIG_nbJoints(RigGraph *rg);
const char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index);
void RIG_freeRigGraph(BGraph *rg);
/* UNUSED */
void BIF_retargetArmature(bContext *C);
void BIF_adjustRetarget(bContext *C);
/* UNUSED / print funcs */
void RIG_printArc(struct RigGraph *rg, struct RigArc *arc);
void RIG_printGraph(struct RigGraph *rg);
void RIG_printArcBones(struct RigArc *arc);
#endif /* __BIF_RETARGET_H__ */

View File

@ -47,9 +47,6 @@ set(SRC
armature_select.c
armature_skinning.c
armature_utils.c
editarmature_generate.c
editarmature_retarget.c
editarmature_sketch.c
editarmature_undo.c
meshlaplacian.c
pose_edit.c
@ -59,13 +56,9 @@ set(SRC
pose_slide.c
pose_transform.c
pose_utils.c
reeb.c
BIF_generate.h
BIF_retarget.h
armature_intern.h
meshlaplacian.h
reeb.h
)
if(WITH_INTERNATIONAL)

View File

@ -138,18 +138,6 @@ void POSE_OT_quaternions_flip(struct wmOperatorType *ot);
void POSE_OT_bone_layers(struct wmOperatorType *ot);
/* ******************************************************* */
/* Etch-A-Ton (Skeleton Sketching) Operators */
void SKETCH_OT_gesture(struct wmOperatorType *ot);
void SKETCH_OT_delete(struct wmOperatorType *ot);
void SKETCH_OT_draw_stroke(struct wmOperatorType *ot);
void SKETCH_OT_draw_preview(struct wmOperatorType *ot);
void SKETCH_OT_finish_stroke(struct wmOperatorType *ot);
void SKETCH_OT_cancel_stroke(struct wmOperatorType *ot);
void SKETCH_OT_convert(struct wmOperatorType *ot);
void SKETCH_OT_select(struct wmOperatorType *ot);
/* ******************************************************* */
/* Pose Tool Utilities (for PoseLib, Pose Sliding, etc.) */
/* pose_utils.c */
@ -225,7 +213,6 @@ void POSE_OT_propagate(struct wmOperatorType *ot);
*/
EditBone *make_boneList(struct ListBase *edbo, struct ListBase *bones, struct EditBone *parent, struct Bone *actBone);
bool BIF_sk_selectStroke(struct bContext *C, const int mval[2], const bool extend);
/* duplicate method */
void preEditBoneDuplicate(struct ListBase *editbones);

View File

@ -85,16 +85,6 @@ void ED_operatortypes_armature(void)
WM_operatortype_append(ARMATURE_OT_armature_layers);
WM_operatortype_append(ARMATURE_OT_bone_layers);
/* SKETCH */
WM_operatortype_append(SKETCH_OT_gesture);
WM_operatortype_append(SKETCH_OT_delete);
WM_operatortype_append(SKETCH_OT_draw_stroke);
WM_operatortype_append(SKETCH_OT_draw_preview);
WM_operatortype_append(SKETCH_OT_finish_stroke);
WM_operatortype_append(SKETCH_OT_cancel_stroke);
WM_operatortype_append(SKETCH_OT_convert);
WM_operatortype_append(SKETCH_OT_select);
/* POSE */
WM_operatortype_append(POSE_OT_hide);
WM_operatortype_append(POSE_OT_reveal);
@ -203,23 +193,6 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
/* Armature ------------------------ */
keymap = WM_keymap_find(keyconf, "Armature", 0, 0);
keymap->poll = ED_operator_editarmature;
/* Armature -> Etch-A-Ton ------------------------ */
WM_keymap_add_item(keymap, "SKETCH_OT_delete", XKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SKETCH_OT_delete", DELKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SKETCH_OT_finish_stroke", RIGHTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SKETCH_OT_cancel_stroke", ESCKEY, KM_PRESS, 0, 0);
/* Already part of view3d select */
//WM_keymap_add_item(keymap, "SKETCH_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
/* sketch poll checks mode */
WM_keymap_add_item(keymap, "SKETCH_OT_gesture", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "snap", true);
WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0);
kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "snap", true);
/* only set in editmode armature, by space_view3d listener */
kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0);

View File

@ -625,10 +625,6 @@ bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, b
vc.mval[0] = mval[0];
vc.mval[1] = mval[1];
if (BIF_sk_selectStroke(C, mval, extend)) {
return true;
}
nearBone = get_nearest_editbonepoint(&vc, true, true, &basact, &selmask);
if (nearBone) {
ED_view3d_viewcontext_init_object(&vc, basact->object);

View File

@ -60,10 +60,6 @@
#include "armature_intern.h"
#include "meshlaplacian.h"
#if 0
#include "reeb.h"
#endif
/* ********************************** Bone Skinning *********************************************** */
static int bone_skinnable_cb(Object *UNUSED(ob), Bone *bone, void *datap)

View File

@ -716,8 +716,6 @@ void ED_armature_to_edit(bArmature *arm)
ED_armature_edit_free(arm);
arm->edbo = MEM_callocN(sizeof(ListBase), "edbo armature");
arm->act_edbone = make_boneList(arm->edbo, &arm->bonebase, NULL, arm->act_bone);
// BIF_freeTemplates(); /* force template update when entering editmode */
}
/* *************************************************************** */

View File

@ -1,305 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/armature/editarmature_generate.c
* \ingroup edarmature
*/
#include "DNA_scene_types.h"
#include "DNA_armature_types.h"
#include "BLI_math.h"
#include "BLI_graph.h"
#include "ED_armature.h"
#include "BIF_generate.h"
void setBoneRollFromNormal(EditBone *bone, const float no[3], float UNUSED(invmat[4][4]), float tmat[3][3])
{
if (no != NULL && !is_zero_v3(no)) {
float normal[3];
copy_v3_v3(normal, no);
mul_m3_v3(tmat, normal);
bone->roll = ED_armature_ebone_roll_to_vector(bone, normal, false);
}
}
float calcArcCorrelation(BArcIterator *iter, int start, int end, float v0[3], float n[3])
{
int len = 2 + abs(end - start);
if (len > 2) {
float avg_t = 0.0f;
float s_t = 0.0f;
float s_xyz = 0.0f;
int i;
/* First pass, calculate average */
for (i = start; i <= end; i++) {
float v[3];
IT_peek(iter, i);
sub_v3_v3v3(v, iter->p, v0);
avg_t += dot_v3v3(v, n);
}
avg_t /= dot_v3v3(n, n);
avg_t += 1.0f; /* adding start (0) and end (1) values */
avg_t /= len;
/* Second pass, calculate s_xyz and s_t */
for (i = start; i <= end; i++) {
float v[3], d[3];
float dt;
IT_peek(iter, i);
sub_v3_v3v3(v, iter->p, v0);
project_v3_v3v3(d, v, n);
sub_v3_v3(v, d);
dt = len_v3(d) - avg_t;
s_t += dt * dt;
s_xyz += dot_v3v3(v, v);
}
/* adding start(0) and end(1) values to s_t */
s_t += (avg_t * avg_t) + (1 - avg_t) * (1 - avg_t);
return 1.0f - s_xyz / s_t;
}
else {
return 1.0f;
}
}
int nextFixedSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int start, int end, float UNUSED(head[3]), float p[3])
{
static float stroke_length = 0;
static float current_length;
static char n;
float *v1, *v2;
float length_threshold;
int i;
if (stroke_length == 0) {
current_length = 0;
IT_peek(iter, start);
v1 = iter->p;
for (i = start + 1; i <= end; i++) {
IT_peek(iter, i);
v2 = iter->p;
stroke_length += len_v3v3(v1, v2);
v1 = v2;
}
n = 0;
current_length = 0;
}
n++;
length_threshold = n * stroke_length / toolsettings->skgen_subdivision_number;
IT_peek(iter, start);
v1 = iter->p;
/* < and not <= because we don't care about end, it is P_EXACT anyway */
for (i = start + 1; i < end; i++) {
IT_peek(iter, i);
v2 = iter->p;
current_length += len_v3v3(v1, v2);
if (current_length >= length_threshold) {
copy_v3_v3(p, v2);
return i;
}
v1 = v2;
}
stroke_length = 0;
return -1;
}
int nextAdaptativeSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int start, int end, float head[3], float p[3])
{
float correlation_threshold = toolsettings->skgen_correlation_limit;
float *start_p;
float n[3];
int i;
IT_peek(iter, start);
start_p = iter->p;
for (i = start + 2; i <= end; i++) {
/* Calculate normal */
IT_peek(iter, i);
sub_v3_v3v3(n, iter->p, head);
if (calcArcCorrelation(iter, start, i, start_p, n) < correlation_threshold) {
IT_peek(iter, i - 1);
copy_v3_v3(p, iter->p);
return i - 1;
}
}
return -1;
}
int nextLengthSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int start, int end, float head[3], float p[3])
{
float lengthLimit = toolsettings->skgen_length_limit;
int same = 1;
int i;
i = start + 1;
while (i <= end) {
float *vec0;
float *vec1;
IT_peek(iter, i - 1);
vec0 = iter->p;
IT_peek(iter, i);
vec1 = iter->p;
/* If lengthLimit hits the current segment */
if (len_v3v3(vec1, head) > lengthLimit) {
if (same == 0) {
float dv[3], off[3];
float a, b, c, f;
/* Solve quadratic distance equation */
sub_v3_v3v3(dv, vec1, vec0);
a = dot_v3v3(dv, dv);
sub_v3_v3v3(off, vec0, head);
b = 2 * dot_v3v3(dv, off);
c = dot_v3v3(off, off) - (lengthLimit * lengthLimit);
f = (-b + sqrtf(b * b - 4 * a * c)) / (2 * a);
//printf("a %f, b %f, c %f, f %f\n", a, b, c, f);
if (isnan(f) == 0 && f < 1.0f) {
copy_v3_v3(p, dv);
mul_v3_fl(p, f);
add_v3_v3(p, vec0);
}
else {
copy_v3_v3(p, vec1);
}
}
else {
float dv[3];
sub_v3_v3v3(dv, vec1, vec0);
normalize_v3(dv);
copy_v3_v3(p, dv);
mul_v3_fl(p, lengthLimit);
add_v3_v3(p, head);
}
return i - 1; /* restart at lower bound */
}
else {
i++;
same = 0; // Reset same
}
}
return -1;
}
EditBone *subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *UNUSED(editbones), BArcIterator *iter,
float invmat[4][4], float tmat[3][3], NextSubdivisionFunc next_subdividion)
{
EditBone *lastBone = NULL;
EditBone *child = NULL;
EditBone *parent = NULL;
float *normal = NULL;
float size_buffer = 1.2;
int bone_start = 0;
int end = iter->length;
int index;
IT_head(iter);
parent = ED_armature_ebone_add(arm, "Bone");
copy_v3_v3(parent->head, iter->p);
if (iter->size > FLT_EPSILON) {
parent->rad_head = iter->size * size_buffer;
}
normal = iter->no;
index = next_subdividion(toolsettings, iter, bone_start, end, parent->head, parent->tail);
while (index != -1) {
IT_peek(iter, index);
child = ED_armature_ebone_add(arm, "Bone");
copy_v3_v3(child->head, parent->tail);
child->parent = parent;
child->flag |= BONE_CONNECTED;
if (iter->size > FLT_EPSILON) {
child->rad_head = iter->size * size_buffer;
parent->rad_tail = iter->size * size_buffer;
}
/* going to next bone, fix parent */
mul_m4_v3(invmat, parent->tail);
mul_m4_v3(invmat, parent->head);
setBoneRollFromNormal(parent, normal, invmat, tmat);
parent = child; // new child is next parent
bone_start = index; // start next bone from current index
normal = iter->no; /* use normal at head, not tail */
index = next_subdividion(toolsettings, iter, bone_start, end, parent->head, parent->tail);
}
iter->tail(iter);
copy_v3_v3(parent->tail, iter->p);
if (iter->size > FLT_EPSILON) {
parent->rad_tail = iter->size * size_buffer;
}
/* fix last bone */
mul_m4_v3(invmat, parent->tail);
mul_m4_v3(invmat, parent->head);
setBoneRollFromNormal(parent, iter->no, invmat, tmat);
lastBone = parent;
return lastBone;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,207 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): Martin Poirier
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/armature/reeb.h
* \ingroup edarmature
*/
#ifndef __REEB_H__
#define __REEB_H__
#define WITH_BF_REEB
#include "DNA_listBase.h"
#include "BLI_graph.h"
struct GHash;
struct EdgeHash;
struct ReebArc;
struct ReebEdge;
struct ReebNode;
typedef struct ReebGraph {
ListBase arcs;
ListBase nodes;
float length;
FreeArc free_arc;
FreeNode free_node;
RadialSymmetry radial_symmetry;
AxialSymmetry axial_symmetry;
/*********************************/
int resolution;
int totnodes;
struct EdgeHash *emap;
int multi_level;
struct ReebGraph *link_up; /* for multi resolution filtering, points to higher levels */
} ReebGraph;
typedef struct EmbedBucket {
float val;
int nv;
float p[3];
float no[3]; /* if non-null, normal of the bucket */
} EmbedBucket;
typedef struct ReebNode {
void *next, *prev;
float p[3];
int flag;
int degree;
struct ReebArc **arcs;
int subgraph_index;
int symmetry_level;
int symmetry_flag;
float symmetry_axis[3];
/*********************************/
float no[3];
int index;
float weight;
int multi_level;
struct ReebNode *link_down; /* for multi resolution filtering, points to lower levels, if present */
struct ReebNode *link_up;
} ReebNode;
typedef struct ReebEdge {
struct ReebEdge *next, *prev;
struct ReebArc *arc;
struct ReebNode *v1, *v2;
struct ReebEdge *nextEdge;
int flag;
} ReebEdge;
typedef struct ReebArc {
void *next, *prev;
struct ReebNode *head, *tail;
int flag;
float length;
int symmetry_level;
int symmetry_group;
int symmetry_flag;
/*********************************/
ListBase edges;
int bcount;
struct EmbedBucket *buckets;
struct GHash *faces;
float angle;
struct ReebArc *link_up; /* for multi resolution filtering, points to higher levels */
} ReebArc;
typedef struct ReebArcIterator {
HeadFct head;
TailFct tail;
PeekFct peek;
NextFct next;
NextNFct nextN;
PreviousFct previous;
StoppedFct stopped;
float *p, *no;
float size;
int length;
int index;
/*********************************/
struct ReebArc *arc;
int start;
int end;
int stride;
} ReebArcIterator;
#if 0
struct EditMesh;
struct EdgeIndex;
int weightToHarmonic(struct EditMesh *em, struct EdgeIndex *indexed_edges);
int weightFromDistance(struct EditMesh *em, struct EdgeIndex *indexed_edges);
int weightFromLoc(struct EditMesh *me, int axis);
//void weightToVCol(struct EditMesh *em, int index);
void arcToVCol(struct ReebGraph *rg, struct EditMesh *em, int index);
//void angleToVCol(struct EditMesh *em, int index);
void renormalizeWeight(struct EditMesh *em, float newmax);
ReebGraph *generateReebGraph(struct EditMesh *me, int subdivisions);
#endif
ReebGraph *newReebGraph(void);
void initArcIterator(BArcIterator *iter, struct ReebArc *arc, struct ReebNode *head);
void initArcIterator2(BArcIterator *iter, struct ReebArc *arc, int start, int end);
void initArcIteratorStart(BArcIterator *iter, struct ReebArc *arc, struct ReebNode *head, int start);
/* Filtering */
void filterNullReebGraph(ReebGraph *rg);
int filterSmartReebGraph(ReebGraph *rg, float threshold);
/* Post-Build processing */
void repositionNodes(ReebGraph *rg);
void postprocessGraph(ReebGraph *rg, char mode);
void removeNormalNodes(ReebGraph *rg);
void sortNodes(ReebGraph *rg);
void sortArcs(ReebGraph *rg);
/*------------ Sanity check ------------*/
void verifyBuckets(ReebGraph *rg);
void verifyFaces(ReebGraph *rg);
void verifyArcs(ReebGraph *rg);
void verifyNodeDegree(ReebGraph *rg);
/*********************** PUBLIC *********************************/
#define REEB_MAX_MULTI_LEVEL 10
struct bContext;
ReebGraph *BIF_ReebGraphFromEditMesh(void);
ReebGraph *BIF_ReebGraphMultiFromEditMesh(struct bContext *C);
void BIF_flagMultiArcs(ReebGraph *rg, int flag);
void BIF_GlobalReebGraphFromEditMesh(void);
void BIF_GlobalReebFree(void);
ReebNode *BIF_otherNodeFromIndex(ReebArc *arc, ReebNode *node);
ReebNode *BIF_NodeFromIndex(ReebArc *arc, ReebNode *node);
ReebNode *BIF_lowestLevelNode(ReebNode *node);
ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node);
void REEB_freeGraph(ReebGraph *rg);
void REEB_freeArc(BArc *barc);
void REEB_exportGraph(ReebGraph *rg, int count);
void REEB_draw(void);
#endif /*__REEB_H__*/

View File

@ -679,7 +679,7 @@ static short gp_stroke_addpoint(
/* simplify a stroke (in buffer) before storing it
* - applies a reverse Chaikin filter
* - code adapted from etch-a-ton branch (editarmature_sketch.c)
* - code adapted from etch-a-ton branch
*/
static void gp_stroke_simplify(tGPsdata *p)
{

View File

@ -226,26 +226,6 @@ void ED_pose_bone_select(struct Object *ob, struct bPoseChannel *pchan, bool sel
void ED_pose_recalculate_paths(struct bContext *C, struct Scene *scene, struct Object *ob);
struct Object *ED_pose_object_from_context(struct bContext *C);
/* sketch */
int ED_operator_sketch_mode_active_stroke(struct bContext *C);
int ED_operator_sketch_full_mode(struct bContext *C);
int ED_operator_sketch_mode(const struct bContext *C);
void BIF_convertSketch(struct bContext *C);
void BIF_deleteSketch(struct bContext *C);
void BIF_selectAllSketch(struct bContext *C, int mode); /* -1: deselect, 0: select, 1: toggle */
void BIF_makeListTemplates(const struct bContext *C);
int BIF_currentTemplate(const struct bContext *C);
void BIF_freeTemplates(struct bContext *C);
void BIF_setTemplate(struct bContext *C, int index);
int BIF_nbJointsTemplate(const struct bContext *C);
const char *BIF_nameBoneTemplate(const struct bContext *C);
void BDR_drawSketch(const struct bContext *vc);
int BDR_drawSketchNames(struct ViewContext *vc);
/* meshlaplacian.c */
void ED_mesh_deform_bind_callback(
struct Scene *scene,

View File

@ -99,8 +99,6 @@ typedef struct bArmature {
Bone *act_bone; /* active bone */
struct EditBone *act_edbone; /* active editbone (in editmode) */
void *sketch; /* sketch struct for etch-a-ton */
int flag;
int drawtype;
int gevertdeformer; /* how vertex deformation is handled in the ge */

View File

@ -1262,37 +1262,10 @@ typedef struct ToolSettings {
/* Multires */
char multires_subdiv_type;
/* Skeleton generation */
short skgen_resolution;
float skgen_threshold_internal;
float skgen_threshold_external;
float skgen_length_ratio;
float skgen_length_limit;
float skgen_angle_limit;
float skgen_correlation_limit;
float skgen_symmetry_limit;
float skgen_retarget_angle_weight;
float skgen_retarget_length_weight;
float skgen_retarget_distance_weight;
short skgen_options;
char skgen_postpro;
char skgen_postpro_passes;
char skgen_subdivisions[3];
char skgen_multi_level;
/* Skeleton Sketching */
struct Object *skgen_template;
char bone_sketching;
char bone_sketching_convert;
char skgen_subdivision_number;
char skgen_retarget_options;
char skgen_retarget_roll;
char skgen_side_string[8];
char skgen_num_string[8];
/* Alt+RMB option */
char edge_mode;
char edge_mode_live_unwrap;
char _pad1;
/* Transform */
char snap_mode, snap_node_mode;
@ -1312,10 +1285,11 @@ typedef struct ToolSettings {
char vgroupsubset; /* subset selection filter in wpaint */
/* UV painting */
int use_uv_sculpt;
int uv_sculpt_settings;
int uv_sculpt_tool;
int uv_relax_method;
char _pad2[2];
char use_uv_sculpt;
char uv_sculpt_settings;
char uv_sculpt_tool;
char uv_relax_method;
/* XXX: these sculpt_paint_* fields are deprecated, use the
* unified_paint_settings field instead! */
short sculpt_paint_settings DNA_DEPRECATED; short pad5;
@ -2028,15 +2002,6 @@ typedef enum eGPencil_Placement_Flags {
#define BONE_SKETCHING_QUICK 2
#define BONE_SKETCHING_ADJUST 4
/* ToolSettings.bone_sketching_convert */
#define SK_CONVERT_CUT_FIXED 0
#define SK_CONVERT_CUT_LENGTH 1
#define SK_CONVERT_CUT_ADAPTATIVE 2
#define SK_CONVERT_RETARGET 3
/* ToolSettings.skgen_retarget_options */
#define SK_RETARGET_AUTONAME 1
/* ToolSettings.skgen_retarget_roll */
#define SK_RETARGET_ROLL_NONE 0
#define SK_RETARGET_ROLL_VIEW 1

View File

@ -666,15 +666,6 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
/* End of read-only Iterator of all the scene objects. */
static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
{
ToolSettings *ts = (ToolSettings *)ptr->data;
if (value.data && ((Object *)value.data)->type == OB_ARMATURE)
ts->skgen_template = value.data;
else
ts->skgen_template = NULL;
}
static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
{
Scene *scene = (Scene *)ptr->data;
@ -2454,22 +2445,6 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem retarget_roll_items[] = {
{SK_RETARGET_ROLL_NONE, "NONE", 0, "None", "Don't adjust roll"},
{SK_RETARGET_ROLL_VIEW, "VIEW", 0, "View", "Roll bones to face the view"},
{SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem sketch_convert_items[] = {
{SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
{SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
{SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive",
"Subdivide stroke adaptively, with more subdivision in curvier parts"},
{SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem edge_tag_items[] = {
{EDGE_MODE_SELECT, "SELECT", 0, "Select", ""},
{EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""},
@ -2873,72 +2848,6 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
/* etch-a-ton */
prop = RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
RNA_def_property_ui_text(prop, "Use Bone Sketching", "Use sketching to create and edit bones");
/* RNA_def_property_ui_icon(prop, ICON_EDIT, 0); */
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
RNA_def_property_ui_text(prop, "Quick Sketching", "Automatically convert and delete on stroke end");
prop = RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
RNA_def_property_ui_text(prop, "Overdraw Sketching", "Adjust strokes by drawing near them");
prop = RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
RNA_def_property_ui_text(prop, "Autoname Bones",
"Automatically generate values to replace &N and &S suffix placeholders in template names");
prop = RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
RNA_def_property_ui_text(prop, "Number", "Text to replace &N with (e.g. 'Finger.&N' -> 'Finger.1' or 'Finger.One')");
prop = RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
RNA_def_property_ui_text(prop, "Side", "Text to replace &S with (e.g. 'Arm.&S' -> 'Arm.R' or 'Arm.Right')");
prop = RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
prop = RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
RNA_def_property_range(prop, 1, 255);
RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
RNA_def_property_range(prop, 0.00001, 1.0);
RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
RNA_def_property_ui_text(prop, "Limit", "Correlation threshold for number of bones in the subdivided stroke");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
RNA_def_property_range(prop, 0.00001, 100000.0);
RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Length", "Maximum length of the subdivided bones");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
RNA_def_property_enum_items(prop, retarget_roll_items);
RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
prop = RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
RNA_def_property_enum_items(prop, sketch_convert_items);
RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
/* Unified Paint Settings */
prop = RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);

View File

@ -434,11 +434,6 @@ void WM_exit_ext(bContext *C, const bool do_python)
ED_undosys_type_free();
// XXX
// BIF_GlobalReebFree();
// BIF_freeRetarget();
BIF_freeTemplates(C);
free_openrecent();
BKE_mball_cubeTable_free();