Beispiel #1
0
static int poselib_rename_invoke (bContext *C, wmOperator *op, wmEvent *evt)
{
	Object *ob= get_poselib_object(C);
	bAction *act= (ob) ? ob->poselib : NULL;
	TimeMarker *marker;
	
	/* check if valid poselib */
	if (act == NULL) {
		BKE_report(op->reports, RPT_ERROR, "Object doesn't have PoseLib data");
		return OPERATOR_CANCELLED;
	}
	
	/* get index (and pointer) of pose to remove */
	marker= BLI_findlink(&act->markers, act->active_marker-1);
	if (marker == NULL) {
		BKE_report(op->reports, RPT_ERROR, "Invalid index for Pose");
		return OPERATOR_CANCELLED;
	}
	else {
		/* use the existing name of the marker as the name, and use the active marker as the one to rename */
		RNA_enum_set(op->ptr, "pose", act->active_marker-1);
		RNA_string_set(op->ptr, "name", marker->name);
	}
	
	/* part to sync with other similar operators... */
	return WM_operator_props_popup(C, op, evt);
}
Beispiel #2
0
static int rna_Operator_props_popup(bContext *C, wmOperator *op, wmEvent *event)
{
  return WM_operator_props_popup(C, op, event);
}