Merging r47691 through r47698 from trunk into soc-2011-tomato
This commit is contained in:
@@ -83,9 +83,12 @@ void BLI_pbvh_search_gather(PBVH *bvh,
|
||||
* hit first */
|
||||
|
||||
void BLI_pbvh_raycast(PBVH * bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
|
||||
float ray_start[3], float ray_normal[3], int original);
|
||||
const float ray_start[3], const float ray_normal[3],
|
||||
int original);
|
||||
|
||||
int BLI_pbvh_node_raycast(PBVH * bvh, PBVHNode * node, float (*origco)[3],
|
||||
float ray_start[3], float ray_normal[3], float *dist);
|
||||
const float ray_start[3], const float ray_normal[3],
|
||||
float *dist);
|
||||
|
||||
/* Drawing */
|
||||
|
||||
|
||||
@@ -1137,17 +1137,21 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
|
||||
|
||||
if (node->flag & PBVH_RebuildDrawBuffers) {
|
||||
GPU_free_buffers(node->draw_buffers);
|
||||
if (bvh->grids) {
|
||||
node->draw_buffers =
|
||||
GPU_build_grid_buffers(node->prim_indices,
|
||||
node->totprim, bvh->grid_hidden, bvh->gridkey.grid_size);
|
||||
}
|
||||
else {
|
||||
node->draw_buffers =
|
||||
GPU_build_mesh_buffers(node->face_vert_indices,
|
||||
bvh->faces, bvh->verts,
|
||||
node->prim_indices,
|
||||
node->totprim);
|
||||
switch (bvh->type) {
|
||||
case PBVH_GRIDS:
|
||||
node->draw_buffers =
|
||||
GPU_build_grid_buffers(node->prim_indices,
|
||||
node->totprim,
|
||||
bvh->grid_hidden,
|
||||
bvh->gridkey.grid_size);
|
||||
break;
|
||||
case PBVH_FACES:
|
||||
node->draw_buffers =
|
||||
GPU_build_mesh_buffers(node->face_vert_indices,
|
||||
bvh->faces, bvh->verts,
|
||||
node->prim_indices,
|
||||
node->totprim);
|
||||
break;
|
||||
}
|
||||
|
||||
node->flag &= ~PBVH_RebuildDrawBuffers;
|
||||
@@ -1473,7 +1477,8 @@ static int ray_aabb_intersect(PBVHNode *node, void *data_v)
|
||||
}
|
||||
|
||||
void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
|
||||
float ray_start[3], float ray_normal[3], int original)
|
||||
const float ray_start[3], const float ray_normal[3],
|
||||
int original)
|
||||
{
|
||||
RaycastData rcd;
|
||||
|
||||
@@ -1489,8 +1494,10 @@ void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
|
||||
BLI_pbvh_search_callback_occluded(bvh, ray_aabb_intersect, &rcd, cb, data);
|
||||
}
|
||||
|
||||
static int ray_face_intersection(float ray_start[3], float ray_normal[3],
|
||||
float *t0, float *t1, float *t2, float *t3,
|
||||
static int ray_face_intersection(const float ray_start[3],
|
||||
const float ray_normal[3],
|
||||
const float *t0, const float *t1,
|
||||
const float *t2, const float *t3,
|
||||
float *fdist)
|
||||
{
|
||||
float dist;
|
||||
@@ -1506,91 +1513,114 @@ static int ray_face_intersection(float ray_start[3], float ray_normal[3],
|
||||
}
|
||||
}
|
||||
|
||||
int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
|
||||
float ray_start[3], float ray_normal[3], float *dist)
|
||||
static int pbvh_faces_node_raycast(PBVH *bvh, const PBVHNode *node,
|
||||
float (*origco)[3],
|
||||
const float ray_start[3],
|
||||
const float ray_normal[3], float *dist)
|
||||
{
|
||||
MVert *vert;
|
||||
BLI_bitmap gh;
|
||||
int *faces, totface, gridsize, totgrid;
|
||||
const MVert *vert = bvh->verts;
|
||||
const int *faces = node->prim_indices;
|
||||
int i, hit = 0, totface = node->totprim;
|
||||
|
||||
for (i = 0; i < totface; ++i) {
|
||||
const MFace *f = bvh->faces + faces[i];
|
||||
const int *face_verts = node->face_vert_indices[i];
|
||||
|
||||
if (paint_is_face_hidden(f, vert))
|
||||
continue;
|
||||
|
||||
if (origco) {
|
||||
/* intersect with backuped original coordinates */
|
||||
hit |= ray_face_intersection(ray_start, ray_normal,
|
||||
origco[face_verts[0]],
|
||||
origco[face_verts[1]],
|
||||
origco[face_verts[2]],
|
||||
f->v4 ? origco[face_verts[3]] : NULL,
|
||||
dist);
|
||||
}
|
||||
else {
|
||||
/* intersect with current coordinates */
|
||||
hit |= ray_face_intersection(ray_start, ray_normal,
|
||||
vert[f->v1].co,
|
||||
vert[f->v2].co,
|
||||
vert[f->v3].co,
|
||||
f->v4 ? vert[f->v4].co : NULL,
|
||||
dist);
|
||||
}
|
||||
}
|
||||
|
||||
return hit;
|
||||
}
|
||||
|
||||
static int pbvh_grids_node_raycast(PBVH *bvh, PBVHNode *node,
|
||||
float (*origco)[3],
|
||||
const float ray_start[3],
|
||||
const float ray_normal[3], float *dist)
|
||||
{
|
||||
int totgrid = node->totprim;
|
||||
int gridsize = bvh->gridkey.grid_size;
|
||||
int i, x, y, hit = 0;
|
||||
|
||||
for (i = 0; i < totgrid; ++i) {
|
||||
CCGElem *grid = bvh->grids[node->prim_indices[i]];
|
||||
BLI_bitmap gh;
|
||||
|
||||
if (!grid)
|
||||
continue;
|
||||
|
||||
gh = bvh->grid_hidden[node->prim_indices[i]];
|
||||
|
||||
for (y = 0; y < gridsize - 1; ++y) {
|
||||
for (x = 0; x < gridsize - 1; ++x) {
|
||||
/* check if grid face is hidden */
|
||||
if (gh) {
|
||||
if (paint_is_grid_face_hidden(gh, gridsize, x, y))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (origco) {
|
||||
hit |= ray_face_intersection(ray_start, ray_normal,
|
||||
origco[y * gridsize + x],
|
||||
origco[y * gridsize + x + 1],
|
||||
origco[(y + 1) * gridsize + x + 1],
|
||||
origco[(y + 1) * gridsize + x],
|
||||
dist);
|
||||
}
|
||||
else {
|
||||
hit |= ray_face_intersection(ray_start, ray_normal,
|
||||
CCG_grid_elem_co(&bvh->gridkey, grid, x, y),
|
||||
CCG_grid_elem_co(&bvh->gridkey, grid, x + 1, y),
|
||||
CCG_grid_elem_co(&bvh->gridkey, grid, x + 1, y + 1),
|
||||
CCG_grid_elem_co(&bvh->gridkey, grid, x, y + 1),
|
||||
dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (origco)
|
||||
origco += gridsize * gridsize;
|
||||
}
|
||||
|
||||
return hit;
|
||||
}
|
||||
|
||||
int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
|
||||
const float ray_start[3], const float ray_normal[3],
|
||||
float *dist)
|
||||
{
|
||||
int hit = 0;
|
||||
|
||||
if (node->flag & PBVH_FullyHidden)
|
||||
return 0;
|
||||
|
||||
switch (bvh->type) {
|
||||
case PBVH_FACES:
|
||||
vert = bvh->verts;
|
||||
faces = node->prim_indices;
|
||||
totface = node->totprim;
|
||||
|
||||
for (i = 0; i < totface; ++i) {
|
||||
const MFace *f = bvh->faces + faces[i];
|
||||
int *face_verts = node->face_vert_indices[i];
|
||||
|
||||
if (paint_is_face_hidden(f, vert))
|
||||
continue;
|
||||
|
||||
if (origco) {
|
||||
/* intersect with backuped original coordinates */
|
||||
hit |= ray_face_intersection(ray_start, ray_normal,
|
||||
origco[face_verts[0]],
|
||||
origco[face_verts[1]],
|
||||
origco[face_verts[2]],
|
||||
f->v4 ? origco[face_verts[3]] : NULL,
|
||||
dist);
|
||||
}
|
||||
else {
|
||||
/* intersect with current coordinates */
|
||||
hit |= ray_face_intersection(ray_start, ray_normal,
|
||||
vert[f->v1].co,
|
||||
vert[f->v2].co,
|
||||
vert[f->v3].co,
|
||||
f->v4 ? vert[f->v4].co : NULL,
|
||||
dist);
|
||||
}
|
||||
}
|
||||
hit |= pbvh_faces_node_raycast(bvh, node, origco,
|
||||
ray_start, ray_normal, dist);
|
||||
break;
|
||||
case PBVH_GRIDS:
|
||||
totgrid = node->totprim;
|
||||
gridsize = bvh->gridkey.grid_size;
|
||||
|
||||
for (i = 0; i < totgrid; ++i) {
|
||||
CCGElem *grid = bvh->grids[node->prim_indices[i]];
|
||||
if (!grid)
|
||||
continue;
|
||||
|
||||
gh = bvh->grid_hidden[node->prim_indices[i]];
|
||||
|
||||
for (y = 0; y < gridsize - 1; ++y) {
|
||||
for (x = 0; x < gridsize - 1; ++x) {
|
||||
/* check if grid face is hidden */
|
||||
if (gh) {
|
||||
if (paint_is_grid_face_hidden(gh, gridsize, x, y))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (origco) {
|
||||
hit |= ray_face_intersection(ray_start, ray_normal,
|
||||
origco[y * gridsize + x],
|
||||
origco[y * gridsize + x + 1],
|
||||
origco[(y + 1) * gridsize + x + 1],
|
||||
origco[(y + 1) * gridsize + x],
|
||||
dist);
|
||||
}
|
||||
else {
|
||||
hit |= ray_face_intersection(ray_start, ray_normal,
|
||||
CCG_grid_elem_co(&bvh->gridkey, grid, x, y),
|
||||
CCG_grid_elem_co(&bvh->gridkey, grid, x + 1, y),
|
||||
CCG_grid_elem_co(&bvh->gridkey, grid, x + 1, y + 1),
|
||||
CCG_grid_elem_co(&bvh->gridkey, grid, x, y + 1),
|
||||
dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (origco)
|
||||
origco += gridsize * gridsize;
|
||||
}
|
||||
hit |= pbvh_grids_node_raycast(bvh, node, origco,
|
||||
ray_start, ray_normal, dist);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1787,11 +1817,7 @@ PBVHProxyNode *BLI_pbvh_node_add_proxy(PBVH *bvh, PBVHNode *node)
|
||||
else
|
||||
node->proxies = MEM_mallocN(sizeof(PBVHProxyNode), "PBVHNodeProxy");
|
||||
|
||||
if (bvh->grids)
|
||||
totverts = node->totprim * bvh->gridkey.grid_area;
|
||||
else
|
||||
totverts = node->uniq_verts;
|
||||
|
||||
BLI_pbvh_node_num_verts(bvh, node, &totverts, NULL);
|
||||
node->proxies[index].co = MEM_callocN(sizeof(float[3]) * totverts, "PBVHNodeProxy.co");
|
||||
}
|
||||
|
||||
|
||||
@@ -1413,6 +1413,7 @@ static void smooth(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode,
|
||||
SculptSession *ss = ob->sculpt;
|
||||
const int max_iterations = 4;
|
||||
const float fract = 1.0f / max_iterations;
|
||||
PBVHType type = BLI_pbvh_type(ss->pbvh);
|
||||
int iteration, n, count;
|
||||
float last;
|
||||
|
||||
@@ -1421,16 +1422,25 @@ static void smooth(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode,
|
||||
count = (int)(bstrength * max_iterations);
|
||||
last = max_iterations * (bstrength - count * fract);
|
||||
|
||||
if (type == PBVH_FACES && !ss->pmap) {
|
||||
BLI_assert(!"sculpt smooth: pmap missing");
|
||||
return;
|
||||
}
|
||||
|
||||
for (iteration = 0; iteration <= count; ++iteration) {
|
||||
float strength = (iteration != count) ? 1.0f : last;
|
||||
|
||||
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
|
||||
for (n = 0; n < totnode; n++) {
|
||||
if (ss->multires) {
|
||||
do_multires_smooth_brush(sd, ss, nodes[n],
|
||||
iteration != count ? 1.0f : last, smooth_mask);
|
||||
}
|
||||
else if (ss->pmap) {
|
||||
do_mesh_smooth_brush(sd, ss, nodes[n],
|
||||
iteration != count ? 1.0f : last, smooth_mask);
|
||||
switch(type) {
|
||||
case PBVH_GRIDS:
|
||||
do_multires_smooth_brush(sd, ss, nodes[n], strength,
|
||||
smooth_mask);
|
||||
break;
|
||||
case PBVH_FACES:
|
||||
do_mesh_smooth_brush(sd, ss, nodes[n], strength,
|
||||
smooth_mask);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3571,6 +3581,21 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
|
||||
sd->special_rotation = cache->special_rotation;
|
||||
}
|
||||
|
||||
/* Returns true iff any of the smoothing modes are active (currently
|
||||
one of smooth brush, autosmooth, mask smooth, or shift-key
|
||||
smooth) */
|
||||
static int sculpt_any_smooth_mode(const Brush *brush,
|
||||
StrokeCache *cache,
|
||||
int stroke_mode)
|
||||
{
|
||||
return ((stroke_mode == BRUSH_STROKE_SMOOTH) ||
|
||||
(cache && cache->alt_smooth) ||
|
||||
(brush->sculpt_tool == SCULPT_TOOL_SMOOTH) ||
|
||||
(brush->autosmooth_factor > 0) ||
|
||||
((brush->sculpt_tool == SCULPT_TOOL_MASK) &&
|
||||
(brush->mask_tool == BRUSH_MASK_SMOOTH)));
|
||||
}
|
||||
|
||||
static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob)
|
||||
{
|
||||
SculptSession *ss = ob->sculpt;
|
||||
@@ -3579,7 +3604,8 @@ static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob)
|
||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
Brush *brush = paint_brush(&sd->paint);
|
||||
|
||||
sculpt_update_mesh_elements(CTX_data_scene(C), sd, ob, brush->sculpt_tool == SCULPT_TOOL_SMOOTH);
|
||||
sculpt_update_mesh_elements(CTX_data_scene(C), sd, ob,
|
||||
sculpt_any_smooth_mode(brush, ss->cache, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3689,11 +3715,7 @@ static int sculpt_brush_stroke_init(bContext *C, wmOperator *op)
|
||||
view3d_operator_needs_opengl(C);
|
||||
sculpt_brush_init_tex(scene, sd, ss);
|
||||
|
||||
is_smooth |= mode == BRUSH_STROKE_SMOOTH;
|
||||
is_smooth |= brush->sculpt_tool == SCULPT_TOOL_SMOOTH;
|
||||
is_smooth |= ((brush->sculpt_tool == SCULPT_TOOL_MASK) &&
|
||||
(brush->mask_tool == BRUSH_MASK_SMOOTH));
|
||||
|
||||
is_smooth = sculpt_any_smooth_mode(brush, NULL, mode);
|
||||
sculpt_update_mesh_elements(scene, sd, ob, is_smooth);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -200,8 +200,8 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
|
||||
|
||||
/* tracked segments */
|
||||
for (i = 0; i < channel->tot_segment; i++) {
|
||||
int start_frame = channel->segments[2 * i];
|
||||
int end_frame = channel->segments[2 * i + 1];
|
||||
int start_frame = BKE_movieclip_remap_clip_to_scene_frame(clip, channel->segments[2 * i]);
|
||||
int end_frame = BKE_movieclip_remap_clip_to_scene_frame(clip, channel->segments[2 * i + 1]);
|
||||
|
||||
if (sel)
|
||||
glColor4fv(selected_strip);
|
||||
@@ -224,8 +224,11 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
|
||||
while (i < track->markersnr) {
|
||||
MovieTrackingMarker *marker = &track->markers[i];
|
||||
|
||||
if ((marker->flag & (MARKER_DISABLED | MARKER_TRACKED)) == 0)
|
||||
draw_keyframe_shape(marker->framenr, y, xscale, yscale, sel, alpha);
|
||||
if ((marker->flag & (MARKER_DISABLED | MARKER_TRACKED)) == 0) {
|
||||
int framenr = BKE_movieclip_remap_clip_to_scene_frame(clip, marker->framenr);
|
||||
|
||||
draw_keyframe_shape(framenr, y, xscale, yscale, sel, alpha);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
|
||||
if (act_track) {
|
||||
MovieTrackingTrack *track = act_track;
|
||||
|
||||
for (i = sfra, a = 0; i <= efra; i++) {
|
||||
for (i = sfra - clip->start_frame + 1, a = 0; i <= efra - clip->start_frame + 1; i++) {
|
||||
int framenr;
|
||||
MovieTrackingMarker *marker;
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@ static void draw_curve_knot(float x, float y, float xscale, float yscale, float
|
||||
}
|
||||
|
||||
static void tracking_segment_point_cb(void *UNUSED(userdata), MovieTrackingTrack *UNUSED(track),
|
||||
MovieTrackingMarker *marker, int UNUSED(coord), float val)
|
||||
MovieTrackingMarker *UNUSED(marker), int UNUSED(coord), int scene_framenr, float val)
|
||||
{
|
||||
glVertex2f(marker->framenr, val);
|
||||
glVertex2f(scene_framenr, val);
|
||||
}
|
||||
|
||||
void tracking_segment_start_cb(void *userdata, MovieTrackingTrack *track, int coord)
|
||||
@@ -123,7 +123,7 @@ void tracking_segment_end_cb(void *UNUSED(userdata))
|
||||
}
|
||||
|
||||
static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track,
|
||||
MovieTrackingMarker *marker, int coord, float val)
|
||||
MovieTrackingMarker *marker, int coord, int scene_framenr, float val)
|
||||
{
|
||||
struct { MovieTrackingTrack *act_track; int sel; float xscale, yscale, hsize; } *data = userdata;
|
||||
int sel = 0, sel_flag;
|
||||
@@ -140,7 +140,7 @@ static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track,
|
||||
else
|
||||
UI_ThemeColor(TH_HANDLE_VERTEX);
|
||||
|
||||
draw_curve_knot(marker->framenr, val, data->xscale, data->yscale, data->hsize);
|
||||
draw_curve_knot(scene_framenr, val, data->xscale, data->yscale, data->hsize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,10 +109,11 @@ typedef struct {
|
||||
} MouseSelectUserData;
|
||||
|
||||
static void find_nearest_tracking_segment_cb(void *userdata, MovieTrackingTrack *track,
|
||||
MovieTrackingMarker *marker, int coord, float val)
|
||||
MovieTrackingMarker *UNUSED(marker),
|
||||
int coord, int scene_framenr, float val)
|
||||
{
|
||||
MouseSelectUserData *data = userdata;
|
||||
float co[2] = {marker->framenr, val};
|
||||
float co[2] = {scene_framenr, val};
|
||||
|
||||
if (data->has_prev) {
|
||||
float d = dist_to_line_segment_v2(data->mouse_co, data->prev_co, co);
|
||||
@@ -137,14 +138,14 @@ void find_nearest_tracking_segment_end_cb(void *userdata)
|
||||
}
|
||||
|
||||
static void find_nearest_tracking_knot_cb(void *userdata, MovieTrackingTrack *track,
|
||||
MovieTrackingMarker *marker, int coord, float val)
|
||||
MovieTrackingMarker *marker, int coord, int scene_framenr, float val)
|
||||
{
|
||||
MouseSelectUserData *data = userdata;
|
||||
float dx = marker->framenr - data->mouse_co[0], dy = val - data->mouse_co[1];
|
||||
float dx = scene_framenr - data->mouse_co[0], dy = val - data->mouse_co[1];
|
||||
float d = dx * dx + dy * dy;
|
||||
|
||||
if (data->marker == NULL || d < data->min_dist) {
|
||||
float co[2] = {marker->framenr, val};
|
||||
float co[2] = {scene_framenr, val};
|
||||
|
||||
data->track = track;
|
||||
data->marker = marker;
|
||||
@@ -308,11 +309,11 @@ typedef struct BorderSelectuserData {
|
||||
} BorderSelectuserData;
|
||||
|
||||
static void border_select_cb(void *userdata, MovieTrackingTrack *UNUSED(track),
|
||||
MovieTrackingMarker *marker, int coord, float val)
|
||||
MovieTrackingMarker *marker, int coord, int scene_framenr, float val)
|
||||
{
|
||||
BorderSelectuserData *data = (BorderSelectuserData *) userdata;
|
||||
|
||||
if (BLI_in_rctf(&data->rect, marker->framenr, val)) {
|
||||
if (BLI_in_rctf(&data->rect, scene_framenr, val)) {
|
||||
int flag = 0;
|
||||
|
||||
if (coord == 0)
|
||||
@@ -532,7 +533,7 @@ typedef struct {
|
||||
} ViewAllUserData;
|
||||
|
||||
static void view_all_cb(void *userdata, MovieTrackingTrack *UNUSED(track), MovieTrackingMarker *UNUSED(marker),
|
||||
int UNUSED(coord), float val)
|
||||
int UNUSED(coord), int UNUSED(scene_framenr), float val)
|
||||
{
|
||||
ViewAllUserData *data = (ViewAllUserData *) userdata;
|
||||
|
||||
|
||||
@@ -110,12 +110,12 @@ void ED_clip_tool_props_register(struct ARegionType *art);
|
||||
|
||||
/* clip_utils.c */
|
||||
void clip_graph_tracking_values_iterate_track(struct SpaceClip *sc, struct MovieTrackingTrack *track, void *userdata,
|
||||
void (*func) (void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, float val),
|
||||
void (*func) (void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
|
||||
void (*segment_start) (void *userdata, struct MovieTrackingTrack *track, int coord),
|
||||
void (*segment_end) (void *userdata));
|
||||
|
||||
void clip_graph_tracking_values_iterate(struct SpaceClip *sc, void *userdata,
|
||||
void (*func) (void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, float val),
|
||||
void (*func) (void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
|
||||
void (*segment_start) (void *userdata, struct MovieTrackingTrack *track, int coord),
|
||||
void (*segment_end) (void *userdata));
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#include "clip_intern.h" // own include
|
||||
|
||||
void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack *track, void *userdata,
|
||||
void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, float val),
|
||||
void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
|
||||
void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord),
|
||||
void (*segment_end) (void *userdata))
|
||||
{
|
||||
@@ -104,8 +104,11 @@ void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack
|
||||
val = (marker->pos[coord] - prevval) * ((coord == 0) ? (width) : (height));
|
||||
val /= marker->framenr - prevfra;
|
||||
|
||||
if (func)
|
||||
func(userdata, track, marker, coord, val);
|
||||
if (func) {
|
||||
int scene_framenr = BKE_movieclip_remap_clip_to_scene_frame(clip, marker->framenr);
|
||||
|
||||
func(userdata, track, marker, coord, scene_framenr, val);
|
||||
}
|
||||
|
||||
prevval = marker->pos[coord];
|
||||
prevfra = marker->framenr;
|
||||
@@ -119,7 +122,7 @@ void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack
|
||||
}
|
||||
|
||||
void clip_graph_tracking_values_iterate(SpaceClip *sc, void *userdata,
|
||||
void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, float val),
|
||||
void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
|
||||
void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord),
|
||||
void (*segment_end) (void *userdata))
|
||||
{
|
||||
|
||||
@@ -477,6 +477,15 @@ static void rna_WeightVGModifier_mask_uvlayer_set(PointerRNA *ptr, const char *v
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_MultiresModifier_type_set(PointerRNA *ptr, int value)
|
||||
{
|
||||
Object *ob = (Object *)ptr->id.data;
|
||||
MultiresModifierData *mmd = (MultiresModifierData *)ptr->data;
|
||||
|
||||
multires_force_update(ob);
|
||||
mmd->simple = value;
|
||||
}
|
||||
|
||||
static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
|
||||
{
|
||||
MultiresModifierData *mmd = (MultiresModifierData *)ptr->data;
|
||||
@@ -739,7 +748,7 @@ static void rna_BevelModifier_angle_limit_set(PointerRNA *ptr, float value)
|
||||
|
||||
#else
|
||||
|
||||
static void rna_def_property_subdivision_common(StructRNA *srna, const char type[])
|
||||
static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const char type[])
|
||||
{
|
||||
static EnumPropertyItem prop_subdivision_type_items[] = {
|
||||
{0, "CATMULL_CLARK", 0, "Catmull-Clark", ""},
|
||||
@@ -752,6 +761,8 @@ static void rna_def_property_subdivision_common(StructRNA *srna, const char type
|
||||
RNA_def_property_enum_items(prop, prop_subdivision_type_items);
|
||||
RNA_def_property_ui_text(prop, "Subdivision Type", "Select type of subdivision algorithm");
|
||||
RNA_def_property_update(prop, 0, "rna_Modifier_update");
|
||||
|
||||
return prop;
|
||||
}
|
||||
|
||||
static void rna_def_modifier_subsurf(BlenderRNA *brna)
|
||||
@@ -901,7 +912,8 @@ static void rna_def_modifier_multires(BlenderRNA *brna)
|
||||
RNA_def_struct_sdna(srna, "MultiresModifierData");
|
||||
RNA_def_struct_ui_icon(srna, ICON_MOD_MULTIRES);
|
||||
|
||||
rna_def_property_subdivision_common(srna, "simple");
|
||||
prop = rna_def_property_subdivision_common(srna, "simple");
|
||||
RNA_def_property_enum_funcs(prop, NULL, "rna_MultiresModifier_type_set", NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, NULL, "lvl");
|
||||
|
||||
Reference in New Issue
Block a user