• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ED_space_clip_get_clip函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ED_space_clip_get_clip函数的典型用法代码示例。如果您正苦于以下问题:C++ ED_space_clip_get_clip函数的具体用法?C++ ED_space_clip_get_clip怎么用?C++ ED_space_clip_get_clip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ED_space_clip_get_clip函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: circle_select_exec

static int circle_select_exec(bContext *C, wmOperator *op)
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	ARegion *ar = CTX_wm_region(C);

	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingTrack *track;
	ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
	int x, y, radius, width, height, mode, change = FALSE;
	float zoomx, zoomy, offset[2], ellipse[2];
	int framenr = ED_space_clip_get_clip_frame_number(sc);

	/* get operator properties */
	x = RNA_int_get(op->ptr, "x");
	y = RNA_int_get(op->ptr, "y");
	radius = RNA_int_get(op->ptr, "radius");

	mode = RNA_int_get(op->ptr, "gesture_mode");

	/* compute ellipse and position in unified coordinates */
	ED_space_clip_get_size(sc, &width, &height);
	ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy);

	ellipse[0] = width * zoomx / radius;
	ellipse[1] = height * zoomy / radius;

	ED_clip_point_stable_pos(sc, ar, x, y, &offset[0], &offset[1]);

	/* do selection */
	track = tracksbase->first;
	while (track) {
		if ((track->flag & TRACK_HIDDEN) == 0) {
			MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);

			if (MARKER_VISIBLE(sc, track, marker) && marker_inside_ellipse(marker, offset, ellipse)) {
				if (mode == GESTURE_MODAL_SELECT)
					BKE_tracking_track_flag_set(track, TRACK_AREA_ALL, SELECT);
				else
					BKE_tracking_track_flag_clear(track, TRACK_AREA_ALL, SELECT);

				change = TRUE;
			}
		}

		track = track->next;
	}

	if (change) {
		BKE_tracking_dopesheet_tag_update(tracking);

		WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);

		return OPERATOR_FINISHED;
	}

	return OPERATOR_CANCELLED;
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:58,代码来源:tracking_select.c


示例2: set_origin_exec

static int set_origin_exec(bContext *C, wmOperator *op)
{
  SpaceClip *sc = CTX_wm_space_clip(C);
  MovieClip *clip = ED_space_clip_get_clip(sc);
  MovieTracking *tracking = &clip->tracking;
  Scene *scene = CTX_data_scene(C);
  Object *camera = get_camera_with_movieclip(scene, clip);
  int selected_count = count_selected_bundles(C);

  if (selected_count == 0) {
    BKE_report(op->reports,
               RPT_ERROR,
               "At least one track with bundle should be selected to "
               "define origin position");

    return OPERATOR_CANCELLED;
  }

  Object *object = get_orientation_object(C);
  if (object == NULL) {
    BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
    return OPERATOR_CANCELLED;
  }

  MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
  ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, tracking_object);

  float median[3] = {0.0f, 0.0f, 0.0f};
  zero_v3(median);
  for (MovieTrackingTrack *track = tracksbase->first; track != NULL; track = track->next) {
    if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_HAS_BUNDLE)) {
      add_v3_v3(median, track->bundle_pos);
    }
  }
  mul_v3_fl(median, 1.0f / selected_count);

  float mat[4][4], vec[3];
  BKE_tracking_get_camera_object_matrix(scene, camera, mat);
  mul_v3_m4v3(vec, mat, median);

  if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
    sub_v3_v3(object->loc, vec);
  }
  else {
    object_solver_inverted_matrix(scene, object, mat);
    mul_v3_m4v3(vec, mat, vec);
    copy_v3_v3(object->loc, vec);
  }

  DEG_id_tag_update(&clip->id, 0);
  DEG_id_tag_update(&object->id, ID_RECALC_TRANSFORM);

  WM_event_add_notifier(C, NC_MOVIECLIP | NA_EVALUATED, clip);
  WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);

  return OPERATOR_FINISHED;
}
开发者ID:dfelinto,项目名称:blender,代码行数:57,代码来源:tracking_ops_orient.c


示例3: apply_solution_scale_invoke

static int apply_solution_scale_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
  SpaceClip *sc = CTX_wm_space_clip(C);
  MovieClip *clip = ED_space_clip_get_clip(sc);
  if (!RNA_struct_property_is_set(op->ptr, "distance")) {
    RNA_float_set(op->ptr, "distance", clip->tracking.settings.dist);
  }
  return apply_solution_scale_exec(C, op);
}
开发者ID:dfelinto,项目名称:blender,代码行数:9,代码来源:tracking_ops_orient.c


示例4: clip_draw_cache_and_notes

void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *ar)
{
	Scene *scene = CTX_data_scene(C);
	MovieClip *clip = ED_space_clip_get_clip(sc);
	if (clip) {
		draw_movieclip_cache(sc, ar, clip, scene);
		draw_movieclip_notes(sc, ar);
	}
}
开发者ID:manwapastorelli,项目名称:blender-git,代码行数:9,代码来源:clip_draw.c


示例5: mouse_select_knot

static bool mouse_select_knot(bContext *C, float co[2], bool extend)
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	MovieClip *clip = ED_space_clip_get_clip(sc);
	ARegion *ar = CTX_wm_region(C);
	View2D *v2d = &ar->v2d;
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
	static const int delta = 6;

	if (act_track) {
		MouseSelectUserData userdata;

		mouse_select_init_data(&userdata, co);
		clip_graph_tracking_values_iterate_track(sc, act_track, &userdata,
		                                         find_nearest_tracking_knot_cb, NULL, NULL);

		if (userdata.marker) {
			int x1, y1, x2, y2;

			if (UI_view2d_view_to_region_clip(v2d, co[0], co[1], &x1, &y1) &&
			    UI_view2d_view_to_region_clip(v2d, userdata.min_co[0], userdata.min_co[1], &x2, &y2) &&
			    (abs(x2 - x1) <= delta && abs(y2 - y1) <= delta))
			{
				if (!extend) {
					SelectUserData selectdata = {SEL_DESELECT};

					clip_graph_tracking_iterate(sc,
					                            (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
					                            (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
					                            &selectdata,
					                            toggle_selection_cb);
				}

				if (userdata.coord == 0) {
					if (extend && (userdata.marker->flag & MARKER_GRAPH_SEL_X) != 0)
						userdata.marker->flag &= ~MARKER_GRAPH_SEL_X;
					else
						userdata.marker->flag |= MARKER_GRAPH_SEL_X;
				}
				else {
					if (extend && (userdata.marker->flag & MARKER_GRAPH_SEL_Y) != 0)
						userdata.marker->flag &= ~MARKER_GRAPH_SEL_Y;
					else
						userdata.marker->flag |= MARKER_GRAPH_SEL_Y;
				}

				return true;
			}
		}
	}

	return false;
}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:54,代码来源:clip_graph_ops.c


示例6: do_lasso_select_marker

static int do_lasso_select_marker(bContext *C, int mcords[][2], short moves, short select)
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	ARegion *ar = CTX_wm_region(C);

	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingTrack *track;
	ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
	rcti rect;
	int change = FALSE;
	int framenr = ED_space_clip_get_clip_frame_number(sc);

	/* get rectangle from operator */
	BLI_lasso_boundbox(&rect, mcords, moves);

	/* do actual selection */
	track = tracksbase->first;
	while (track) {
		if ((track->flag & TRACK_HIDDEN) == 0) {
			MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);

			if (MARKER_VISIBLE(sc, track, marker)) {
				float screen_co[2];

				/* marker in screen coords */
				ED_clip_point_stable_pos__reverse(sc, ar, marker->pos, screen_co);

				if (BLI_in_rcti(&rect, screen_co[0], screen_co[1]) &&
				    BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], V2D_IS_CLIPPED))
				{
					if (select)
						BKE_tracking_track_flag_set(track, TRACK_AREA_ALL, SELECT);
					else
						BKE_tracking_track_flag_clear(track, TRACK_AREA_ALL, SELECT);
				}

				change = TRUE;
			}
		}

		track = track->next;
	}

	if (change) {
		BKE_tracking_dopesheet_tag_update(tracking);

		WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
	}

	return change;
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:52,代码来源:tracking_select.c


示例7: apply_solution_scale_poll

static bool apply_solution_scale_poll(bContext *C)
{
  SpaceClip *sc = CTX_wm_space_clip(C);
  if (sc != NULL) {
    MovieClip *clip = ED_space_clip_get_clip(sc);
    if (clip != NULL) {
      MovieTracking *tracking = &clip->tracking;
      MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
      return (tracking_object->flag & TRACKING_OBJECT_CAMERA) != 0;
    }
  }
  return 0;
}
开发者ID:dfelinto,项目名称:blender,代码行数:13,代码来源:tracking_ops_orient.c


示例8: count_selected_bundles

static int count_selected_bundles(bContext *C)
{
  SpaceClip *sc = CTX_wm_space_clip(C);
  MovieClip *clip = ED_space_clip_get_clip(sc);
  ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
  int tot = 0;
  for (MovieTrackingTrack *track = tracksbase->first; track != NULL; track = track->next) {
    if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_HAS_BUNDLE)) {
      tot++;
    }
  }
  return tot;
}
开发者ID:dfelinto,项目名称:blender,代码行数:13,代码来源:tracking_ops_orient.c


示例9: delete_curve_exec

static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op))
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);

	if (!act_track)
		return OPERATOR_CANCELLED;

	clip_delete_track(C, clip, act_track);

	return OPERATOR_FINISHED;
}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:14,代码来源:clip_graph_ops.c


示例10: CTX_wm_space_clip

static MovieTrackingPlaneTrack *tracking_plane_marker_check_slide(bContext *C,
                                                                  const wmEvent *event,
                                                                  int *corner_r)
{
  const float distance_clip_squared = 12.0f * 12.0f;
  SpaceClip *sc = CTX_wm_space_clip(C);
  ARegion *ar = CTX_wm_region(C);
  MovieClip *clip = ED_space_clip_get_clip(sc);
  MovieTracking *tracking = &clip->tracking;
  int width, height;
  float co[2];
  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
  int framenr = ED_space_clip_get_clip_frame_number(sc);

  ED_space_clip_get_size(sc, &width, &height);
  if (width == 0 || height == 0) {
    return NULL;
  }

  ED_clip_mouse_pos(sc, ar, event->mval, co);

  float min_distance_squared = FLT_MAX;
  int min_corner = -1;
  MovieTrackingPlaneTrack *min_plane_track = NULL;
  for (MovieTrackingPlaneTrack *plane_track = plane_tracks_base->first; plane_track != NULL;
       plane_track = plane_track->next) {
    if (PLANE_TRACK_VIEW_SELECTED(plane_track)) {
      MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr);
      for (int i = 0; i < 4; i++) {
        float distance_squared = mouse_to_plane_slide_zone_distance_squared(
            co, plane_marker->corners[i], width, height);

        if (distance_squared < min_distance_squared) {
          min_distance_squared = distance_squared;
          min_corner = i;
          min_plane_track = plane_track;
        }
      }
    }
  }

  if (min_distance_squared < distance_clip_squared / sc->zoom) {
    if (corner_r != NULL) {
      *corner_r = min_corner;
    }
    return min_plane_track;
  }

  return NULL;
}
开发者ID:dfelinto,项目名称:blender,代码行数:50,代码来源:tracking_ops_plane.c


示例11: graph_select_all_markers_exec

static int graph_select_all_markers_exec(bContext *C, wmOperator *op)
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
	MovieTrackingMarker *marker;
	int action = RNA_enum_get(op->ptr, "action");
	int a;

	if (!act_track)
		return OPERATOR_CANCELLED;

	if (action == SEL_TOGGLE) {
		action = SEL_SELECT;

		for (a = 0; a < act_track->markersnr; a++) {
			marker = &act_track->markers[a];

			if (marker->flag & MARKER_GRAPH_SEL) {
				action = SEL_DESELECT;
				break;
			}
		}
	}

	for (a = 0; a < act_track->markersnr; a++) {
		marker = &act_track->markers[a];

		switch (action) {
			case SEL_SELECT:
				marker->flag |= MARKER_GRAPH_SEL;
				break;
			case SEL_DESELECT:
				marker->flag &= ~MARKER_GRAPH_SEL;
				break;
			case SEL_INVERT:
				marker->flag ^= MARKER_GRAPH_SEL;
				break;
		}
	}

	WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);

	return OPERATOR_FINISHED;
}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:46,代码来源:clip_graph_ops.c


示例12: set_axis_exec

static int set_axis_exec(bContext *C, wmOperator *op)
{
    SpaceClip *sc = CTX_wm_space_clip(C);
    MovieClip *clip = ED_space_clip_get_clip(sc);
    MovieTracking *tracking = &clip->tracking;
    MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
    Scene *scene = CTX_data_scene(C);
    Object *object;
    int axis = RNA_enum_get(op->ptr, "axis");

    if (count_selected_bundles(C) != 1) {
        BKE_report(op->reports,
                   RPT_ERROR,
                   "Single track with bundle should be selected to define axis");
        return OPERATOR_CANCELLED;
    }

    object = get_orientation_object(C);
    if (object == NULL) {
        BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
        return OPERATOR_CANCELLED;
    }

    ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking,
                           tracking_object);
    MovieTrackingTrack *track = tracksbase->first;
    while (track) {
        if (TRACK_VIEW_SELECTED(sc, track) &&
                (track->flag & TRACK_HAS_BUNDLE))
        {
            break;
        }
        track = track->next;
    }

    set_axis(scene, object, clip, tracking_object, track, axis == 0 ? 'X' : 'Y');

    DAG_id_tag_update(&clip->id, 0);
    DAG_id_tag_update(&object->id, OB_RECALC_OB);

    WM_event_add_notifier(C, NC_MOVIECLIP | NA_EVALUATED, clip);
    WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);

    return OPERATOR_FINISHED;
}
开发者ID:diekev,项目名称:blender,代码行数:45,代码来源:tracking_ops_orient.c


示例13: mouse_select_curve

static bool mouse_select_curve(bContext *C, float co[2], bool extend)
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
	MouseSelectUserData userdata;

	mouse_select_init_data(&userdata, co);
	clip_graph_tracking_values_iterate(sc,
	                                   (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
	                                   (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
	                                   &userdata, find_nearest_tracking_segment_cb,
	                                   NULL, find_nearest_tracking_segment_end_cb);

	if (userdata.track) {
		if (extend) {
			if (act_track == userdata.track) {
				/* currently only single curve can be selected (selected curve represents active track) */
				act_track = NULL;
			}
		}
		else if (act_track != userdata.track) {
			SelectUserData selectdata = {SEL_DESELECT};
			MovieTrackingObject *object = BKE_tracking_object_get_active(tracking);

			tracking->act_track = userdata.track;
			if ((sc->flag & SC_SHOW_GRAPH_SEL_ONLY) == 0) {
				ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, object);
				BKE_tracking_track_select(tracksbase, userdata.track, TRACK_AREA_ALL, false);
			}

			/* deselect all knots on newly selected curve */
			clip_graph_tracking_iterate(sc,
			                            (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
			                            (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
			                            &selectdata, toggle_selection_cb);
		}

		return true;
	}

	return false;
}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:44,代码来源:clip_graph_ops.c


示例14: dopesheet_select_channel_exec

static int dopesheet_select_channel_exec(bContext *C, wmOperator *op)
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingObject *object = BKE_tracking_object_get_active(tracking);
	MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
	MovieTrackingDopesheetChannel *channel;
	ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, object);
	float location[2];
	const bool extend = RNA_boolean_get(op->ptr, "extend");
	int current_channel_index = 0, channel_index;
	const bool show_selected_only = (dopesheet->flag & TRACKING_DOPE_SELECTED_ONLY) != 0;

	RNA_float_get_array(op->ptr, "location", location);
	channel_index = -(location[1] - (CHANNEL_FIRST + CHANNEL_HEIGHT_HALF)) / CHANNEL_STEP;

	for (channel = dopesheet->channels.first; channel; channel = channel->next) {
		MovieTrackingTrack *track = channel->track;

		if (current_channel_index == channel_index) {
			if (extend)
				track->flag ^= TRACK_DOPE_SEL;
			else
				track->flag |= TRACK_DOPE_SEL;

			if (track->flag & TRACK_DOPE_SEL) {
				tracking->act_track = track;
				BKE_tracking_track_select(tracksbase, track, TRACK_AREA_ALL, true);
			}
			else if (show_selected_only == false) {
				BKE_tracking_track_deselect(track, TRACK_AREA_ALL);
			}
		}
		else if (!extend)
			track->flag &= ~TRACK_DOPE_SEL;

		current_channel_index++;
	}

	WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);

	return OPERATOR_FINISHED;
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:44,代码来源:clip_dopesheet_ops.c


示例15: draw_movieclip_notes

static void draw_movieclip_notes(SpaceClip *sc, ARegion *ar)
{
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	char str[256] = {0};
	int block = FALSE;

	if (tracking->stats) {
		BLI_strncpy(str, tracking->stats->message, sizeof(str));
		block = TRUE;
	}
	else {
		if (sc->flag & SC_LOCK_SELECTION)
			strcpy(str, "Locked");
	}

	if (str[0])
		ED_region_info_draw(ar, str, block, 0.6f);
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:19,代码来源:clip_draw.c


示例16: set_orientation_poll

static bool set_orientation_poll(bContext *C)
{
  SpaceClip *sc = CTX_wm_space_clip(C);
  if (sc != NULL) {
    ViewLayer *view_layer = CTX_data_view_layer(C);
    MovieClip *clip = ED_space_clip_get_clip(sc);
    if (clip != NULL) {
      MovieTracking *tracking = &clip->tracking;
      MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
      if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
        return true;
      }
      else {
        return OBACT(view_layer) != NULL;
      }
    }
  }
  return false;
}
开发者ID:dfelinto,项目名称:blender,代码行数:19,代码来源:tracking_ops_orient.c


示例17: mouse_select

static int mouse_select(bContext *C, float co[2], int extend)
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
	MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
	MovieTrackingTrack *track = NULL;   /* selected marker */

	track = find_nearest_track(sc, tracksbase, co);

	if (track) {
		int area = track_mouse_area(C, co, track);

		if (!extend || !TRACK_VIEW_SELECTED(sc, track))
			area = TRACK_AREA_ALL;

		if (extend && TRACK_AREA_SELECTED(track, area)) {
			if (track == act_track)
				BKE_tracking_track_deselect(track, area);
			else
				clip->tracking.act_track = track;
		}
		else {
			if (area == TRACK_AREA_POINT)
				area = TRACK_AREA_ALL;

			BKE_tracking_track_select(tracksbase, track, area, extend);
			clip->tracking.act_track = track;
		}
	}

	if (!extend) {
		sc->xlockof = 0.0f;
		sc->ylockof = 0.0f;
	}

	BKE_tracking_dopesheet_tag_update(tracking);

	WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);

	return OPERATOR_FINISHED;
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:43,代码来源:tracking_select.c


示例18: draw_movieclip_buffer

static void draw_movieclip_buffer(const bContext *C, SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
                                  int width, int height, float zoomx, float zoomy)
{
	MovieClip *clip = ED_space_clip_get_clip(sc);
	int filter = GL_LINEAR;
	int x, y;

	/* find window pixel coordinates of origin */
	UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x, &y);

	/* checkerboard for case alpha */
	if (ibuf->planes == 32) {
		glEnable(GL_BLEND);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

		fdrawcheckerboard(x, y, x + zoomx * ibuf->x, y + zoomy * ibuf->y);
	}

	/* non-scaled proxy shouldn't use filtering */
	if ((clip->flag & MCLIP_USE_PROXY) == 0 ||
	    ELEM(sc->user.render_size, MCLIP_PROXY_RENDER_SIZE_FULL, MCLIP_PROXY_RENDER_SIZE_100))
	{
		filter = GL_NEAREST;
	}

	/* set zoom */
	glPixelZoom(zoomx * width / ibuf->x, zoomy * height / ibuf->y);

	glaDrawImBuf_glsl_ctx(C, ibuf, x, y, filter);
	/* reset zoom */
	glPixelZoom(1.0f, 1.0f);


	if (sc->flag & SC_SHOW_METADATA) {
		rctf frame;
		BLI_rctf_init(&frame, 0.0f, ibuf->x, 0.0f, ibuf->y);
		ED_region_image_metadata_draw(x, y, ibuf, &frame, zoomx * width / ibuf->x, zoomy * height / ibuf->y);
	}

	if (ibuf->planes == 32)
		glDisable(GL_BLEND);
}
开发者ID:Ichthyostega,项目名称:blender,代码行数:42,代码来源:clip_draw.c


示例19: draw_movieclip_notes

static void draw_movieclip_notes(SpaceClip *sc, ARegion *ar)
{
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	char str[256] = {0};
	bool block = false;

	if (tracking->stats) {
		BLI_strncpy(str, tracking->stats->message, sizeof(str));
		block = true;
	}
	else {
		if (sc->flag & SC_LOCK_SELECTION)
			strcpy(str, "Locked");
	}

	if (str[0]) {
		float fill_color[4] = {0.0f, 0.0f, 0.0f, 0.6f};
		ED_region_info_draw(ar, str, block, fill_color);
	}
}
开发者ID:manwapastorelli,项目名称:blender-git,代码行数:21,代码来源:clip_draw.c


示例20: draw_tracks_motion_curves

static void draw_tracks_motion_curves(View2D *v2d, SpaceClip *sc)
{
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
	int width, height;
	TrackMotionCurveUserData userdata;

	BKE_movieclip_get_size(clip, &sc->user, &width, &height);

	if (!width || !height)
		return;

	/* non-selected knot handles */
	userdata.hsize = UI_GetThemeValuef(TH_HANDLE_VERTEX_SIZE);
	userdata.sel = false;
	userdata.act_track = act_track;
	UI_view2d_scale_get(v2d, &userdata.xscale, &userdata.yscale);
	clip_graph_tracking_values_iterate(sc,
	                                   (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
	                                   (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
	                                   &userdata, tracking_segment_knot_cb, NULL, NULL);

	/* draw graph lines */
	glEnable(GL_BLEND);
	clip_graph_tracking_values_iterate(sc,
	                                   (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
	                                   (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
	                                   act_track, tracking_segment_point_cb, tracking_segment_start_cb,
	                                   tracking_segment_end_cb);
	glDisable(GL_BLEND);

	/* selected knot handles on top of curves */
	userdata.sel = true;
	clip_graph_tracking_values_iterate(sc,
	                                   (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
	                                   (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
	                                   &userdata, tracking_segment_knot_cb, NULL, NULL);
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:39,代码来源:clip_graph_draw.c



注:本文中的ED_space_clip_get_clip函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ EE_ReadVariable函数代码示例发布时间:2022-05-30
下一篇:
C++ ED_region_tag_redraw函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap