您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CTX_wm_reports函数代码示例

51自学网 2021-06-01 20:07:04
  C++
这篇教程C++ CTX_wm_reports函数代码示例写得很实用,希望能帮到您。

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

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

示例1: ui_but_anim_autokey

void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra){	ID *id;	bAction *action;	FCurve *fcu;	bool driven;	bool special;	fcu = ui_but_get_fcurve(but, NULL, &action, &driven, &special);		if (fcu == NULL)		return;		if (special) {		/* NLA Strip property */		if (IS_AUTOKEY_ON(scene)) {			ReportList *reports = CTX_wm_reports(C);			ToolSettings *ts = scene->toolsettings;						insert_keyframe_direct(reports, but->rnapoin, but->rnaprop, fcu, cfra, ts->keyframe_type, 0);			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);		}	}	else if (driven) {		/* Driver - Try to insert keyframe using the driver's input as the frame,		 * making it easier to set up corrective drivers		 */		if (IS_AUTOKEY_ON(scene)) {			ReportList *reports = CTX_wm_reports(C);			ToolSettings *ts = scene->toolsettings;						insert_keyframe_direct(reports, but->rnapoin, but->rnaprop, fcu, cfra, ts->keyframe_type, INSERTKEY_DRIVER);			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);		}	}	else {		id = but->rnapoin.id.data;				/* TODO: this should probably respect the keyingset only option for anim */		if (autokeyframe_cfra_can_key(scene, id)) {			ReportList *reports = CTX_wm_reports(C);			ToolSettings *ts = scene->toolsettings;			short flag = ANIM_get_keyframing_flags(scene, 1);						fcu->flag &= ~FCURVE_SELECTED;						/* Note: We use but->rnaindex instead of fcu->array_index,			 *       because a button may control all items of an array at once.			 *       E.g., color wheels (see T42567). */			BLI_assert((fcu->array_index == but->rnaindex) || (but->rnaindex == -1));			insert_keyframe(reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)),			                fcu->rna_path, but->rnaindex, cfra, ts->keyframe_type, flag);						WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);		}	}}
开发者ID:UPBGE,项目名称:blender,代码行数:57,


示例2: ui_but_anim_autokey

void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra){	ID *id;	bAction *action;	FCurve *fcu;	bool driven;	bool special;	fcu = ui_but_get_fcurve(but, NULL, &action, &driven, &special);		if (fcu == NULL)		return;		if (special) {		/* NLA Strip property */		if (IS_AUTOKEY_ON(scene)) {			ReportList *reports = CTX_wm_reports(C);			PointerRNA ptr = {{NULL}};			PropertyRNA *prop = NULL;			int index;						UI_context_active_but_prop_get(C, &ptr, &prop, &index);						insert_keyframe_direct(reports, ptr, prop, fcu, cfra, 0);			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);		}	}	else if (!driven) {		id = but->rnapoin.id.data;		/* TODO: this should probably respect the keyingset only option for anim */		if (autokeyframe_cfra_can_key(scene, id)) {			ReportList *reports = CTX_wm_reports(C);			short flag = ANIM_get_keyframing_flags(scene, 1);			fcu->flag &= ~FCURVE_SELECTED;			/* Note: We use but->rnaindex instead of fcu->array_index,			 *       because a button may control all items of an array at once.			 *       E.g., color wheels (see T42567). */			BLI_assert((fcu->array_index == but->rnaindex) || (but->rnaindex == -1));			insert_keyframe(reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)),			                fcu->rna_path, but->rnaindex, cfra, flag);			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);		}	}}
开发者ID:DrangPo,项目名称:blender,代码行数:48,


示例3: do_mat_livedb_item_rename

/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */static int do_mat_livedb_item_rename(bContext *C, ARegion *ar, SpaceLDB *slivedb, LiveDbTreeElement *te, const float mval[2]){	    ReportList  *reports;    int         CUR_UNIT_Y;    if(TE_GET_TYPE(te->item->type) == MAT_LDB_TREE_ITEM_TYPE_CATEGORY)        CUR_UNIT_Y = UI_UNIT_Y;    else        CUR_UNIT_Y = MAT_LIVEDB_UI_UNIT_Y;    reports = CTX_wm_reports(C);        if (mval[1] > te->ys && mval[1] < te->ys + CUR_UNIT_Y) {        /* click on name */        if (mval[0] > te->xs + UI_UNIT_X * 2 && mval[0] < te->xend) {            do_item_rename(ar, te, reports);            return 1;        }        return 0;    }    for (te = te->subtree.first; te; te = te->next) {        if (do_mat_livedb_item_rename(C, ar, slivedb, te, mval)) return 1;    }    return 0;} /* do_mat_livedb_item_rename() */
开发者ID:mistajuliax,项目名称:OctaneBlender,代码行数:26,


示例4: BPY_execute_string_as_number

/** * /return success */bool BPY_execute_string_as_number(bContext *C, const char *expr, double *value, const bool verbose){	PyGILState_STATE gilstate;	bool ok = true;	if (!value || !expr) return -1;	if (expr[0] == '/0') {		*value = 0.0;		return ok;	}	bpy_context_set(C, &gilstate);	ok = PyC_RunString_AsNumber(expr, value, "<blender button>");	if (ok == false) {		if (verbose) {			BPy_errors_to_report_ex(CTX_wm_reports(C), false, false);		}		else {			PyErr_Clear();		}	}	bpy_context_clear(C, &gilstate);	return ok;}
开发者ID:UPBGE,项目名称:blender,代码行数:32,


示例5: reports_to_text_exec

static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op)){	ReportList *reports = CTX_wm_reports(C);	Text *txt;	char *str;		/* create new text-block to write to */	txt = add_empty_text("Recent Reports");		/* convert entire list to a display string, and add this to the text-block	 *	- if commandline debug option enabled, show debug reports too	 *	- otherwise, up to info (which is what users normally see)	 */	str = BKE_reports_string(reports, (G.f & G_DEBUG)? RPT_DEBUG : RPT_INFO);	if (str) {		write_text(txt, str);		MEM_freeN(str);		return OPERATOR_FINISHED;	}	else {		return OPERATOR_CANCELLED;	}}
开发者ID:mik0001,项目名称:Blender,代码行数:25,


示例6: report_delete_exec

static int report_delete_exec(bContext *C, wmOperator *UNUSED(op)){	SpaceInfo *sinfo = CTX_wm_space_info(C);	ReportList *reports = CTX_wm_reports(C);	int report_mask = info_report_mask(sinfo);	Report *report, *report_next;	for (report = reports->list.first; report; ) {		report_next = report->next;		if ((report->type & report_mask) && (report->flag & SELECT)) {			BLI_remlink(&reports->list, report);			MEM_freeN((void *)report->message);			MEM_freeN(report);		}		report = report_next;	}	ED_area_tag_redraw(CTX_wm_area(C));	return OPERATOR_FINISHED;}
开发者ID:danielmarg,项目名称:blender-main,代码行数:26,


示例7: ED_armature_enter_posemode

/* This function is used to process the necessary updates for */void ED_armature_enter_posemode(bContext *C, Base *base){	ReportList *reports = CTX_wm_reports(C);	Object *ob = base->object;		if (ob->id.lib) {		BKE_report(reports, RPT_WARNING, "Cannot pose libdata");		return;	}		switch (ob->type) {		case OB_ARMATURE:			ob->restore_mode = ob->mode;			ob->mode |= OB_MODE_POSE;						WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_POSE, NULL);						break;		default:			return;	}		/* XXX: disabled as this would otherwise cause a nasty loop... */	//ED_object_toggle_modes(C, ob->mode);}
开发者ID:Moguri,项目名称:blender,代码行数:26,


示例8: report_copy_exec

static int report_copy_exec(bContext *C, wmOperator *UNUSED(op)){	SpaceInfo *sinfo = CTX_wm_space_info(C);	ReportList *reports = CTX_wm_reports(C);	int report_mask = info_report_mask(sinfo);	Report *report;	DynStr *buf_dyn = BLI_dynstr_new();	char *buf_str;	for (report = reports->list.first; report; report = report->next) {		if ((report->type & report_mask) && (report->flag & SELECT)) {			BLI_dynstr_append(buf_dyn, report->message);			BLI_dynstr_append(buf_dyn, "/n");		}	}	buf_str = BLI_dynstr_get_cstring(buf_dyn);	BLI_dynstr_free(buf_dyn);	WM_clipboard_text_set(buf_str, 0);	MEM_freeN(buf_str);	return OPERATOR_FINISHED;}
开发者ID:danielmarg,项目名称:blender-main,代码行数:26,


示例9: wm_file_read_report

void wm_file_read_report(bContext *C){	ReportList *reports = NULL;	Scene *sce;	for (sce = G.main->scene.first; sce; sce = sce->id.next) {		if (sce->r.engine[0] &&		    BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL)		{			if (reports == NULL) {				reports = CTX_wm_reports(C);			}			BKE_reportf(reports, RPT_ERROR,			            "Engine '%s' not available for scene '%s' "			            "(an addon may need to be installed or enabled)",			            sce->r.engine, sce->id.name + 2);		}	}	if (reports) {		if (!G.background) {			WM_report_banner_show();		}	}}
开发者ID:ChunHungLiu,项目名称:blender,代码行数:26,


示例10: report_select_all_toggle_exec

static int report_select_all_toggle_exec(bContext *C, wmOperator *UNUSED(op)){	SpaceInfo *sinfo = CTX_wm_space_info(C);	ReportList *reports = CTX_wm_reports(C);	int report_mask = info_report_mask(sinfo);	int deselect = 0;	Report *report;	for (report = reports->list.last; report; report = report->prev) {		if ((report->type & report_mask) && (report->flag & SELECT)) {			deselect = 1;			break;		}	}	if (deselect) {		for (report = reports->list.last; report; report = report->prev)			if (report->type & report_mask)				report->flag &= ~SELECT;	}	else {		for (report = reports->list.last; report; report = report->prev)			if (report->type & report_mask)				report->flag |= SELECT;	}	ED_area_tag_redraw(CTX_wm_area(C));	return OPERATOR_FINISHED;}
开发者ID:danielmarg,项目名称:blender-main,代码行数:32,


示例11: wm_init_reports

static void wm_init_reports(bContext *C){	ReportList *reports = CTX_wm_reports(C);	BLI_assert(!reports || BLI_listbase_is_empty(&reports->list));	BKE_reports_init(reports, RPT_STORE);}
开发者ID:Ichthyostega,项目名称:blender,代码行数:8,


示例12: mat_livedb_item_rename_cb

/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */void mat_livedb_item_rename_cb(bContext *C, LiveDbTreeElement *te){    ARegion     *ar         = CTX_wm_region(C);    ReportList  *reports    = CTX_wm_reports(C);    if(*te->flag & TE_ACTIVE) {        *te->flag &= ~TE_ACTIVE;        do_item_rename(ar, te, reports);    }} /* mat_livedb_item_rename_cb() */
开发者ID:mistajuliax,项目名称:OctaneBlender,代码行数:11,


示例13: select_report_pick_exec

static int select_report_pick_exec(bContext *C, wmOperator *op){	int report_index = RNA_int_get(op->ptr, "report_index");	Report *report = BLI_findlink(&CTX_wm_reports(C)->list, report_index);	if (!report)		return OPERATOR_CANCELLED;	report->flag ^= SELECT; /* toggle */	ED_area_tag_redraw(CTX_wm_area(C));	return OPERATOR_FINISHED;}
开发者ID:danielmarg,项目名称:blender-main,代码行数:14,


示例14: driver_remove_cb

/* callback to remove the active driver */static void driver_remove_cb(bContext *C, void *ale_v, void *UNUSED(arg)){	bAnimListElem *ale = (bAnimListElem *)ale_v;	ID *id = ale->id;	FCurve *fcu = ale->data;	ReportList *reports = CTX_wm_reports(C);		/* try to get F-Curve that driver lives on, and ID block which has this AnimData */	if (ELEM(NULL, id, fcu))		return;		/* call API method to remove this driver  */		ANIM_remove_driver(reports, id, fcu->rna_path, fcu->array_index, 0);}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:15,


示例15: select_report_pick_invoke

static int select_report_pick_invoke(bContext *C, wmOperator *op, wmEvent *event){	SpaceInfo *sinfo = CTX_wm_space_info(C);	ARegion *ar = CTX_wm_region(C);	ReportList *reports = CTX_wm_reports(C);	Report *report;	/* uses opengl */	wmSubWindowSet(CTX_wm_window(C), ar->swinid);		report = info_text_pick(sinfo, ar, reports, event->mval[1]);	RNA_int_set(op->ptr, "report_index", BLI_findindex(&reports->list, report));	return select_report_pick_exec(C, op);}
开发者ID:danielmarg,项目名称:blender-main,代码行数:16,


示例16: BKE_report

static FCurve *rna_Driver_from_existing(AnimData *adt, bContext *C, FCurve *src_driver){	/* verify that we've got a driver to duplicate */	if (ELEM(NULL, src_driver, src_driver->driver)) {		BKE_report(CTX_wm_reports(C), RPT_ERROR, "No valid driver data to create copy of");		return NULL;	}	else {		/* just make a copy of the existing one and add to self */		FCurve *new_fcu = copy_fcurve(src_driver);				/* XXX: if we impose any ordering on these someday, this will be problematic */		BLI_addtail(&adt->drivers, new_fcu);		return new_fcu;	}}
开发者ID:244xiao,项目名称:blender,代码行数:16,


示例17: ED_editors_init

void ED_editors_init(bContext *C){	wmWindowManager *wm = CTX_wm_manager(C);	Main *bmain = CTX_data_main(C);	Scene *sce = CTX_data_scene(C);	Object *ob, *obact = (sce && sce->basact) ? sce->basact->object : NULL;	ID *data;	if (wm->undo_stack == NULL) {		wm->undo_stack = BKE_undosys_stack_create();	}	/* This is called during initialization, so we don't want to store any reports */	ReportList *reports = CTX_wm_reports(C);	int reports_flag_prev = reports->flag & ~RPT_STORE;	SWAP(int, reports->flag, reports_flag_prev);	/* toggle on modes for objects that were saved with these enabled. for	 * e.g. linked objects we have to ensure that they are actually the	 * active object in this scene. */	for (ob = bmain->object.first; ob; ob = ob->id.next) {		int mode = ob->mode;		if (!ELEM(mode, OB_MODE_OBJECT, OB_MODE_POSE)) {			ob->mode = OB_MODE_OBJECT;			data = ob->data;			if (ob == obact && !ID_IS_LINKED(ob) && !(data && ID_IS_LINKED(data)))				ED_object_mode_toggle(C, mode);		}	}	/* image editor paint mode */	if (sce) {		ED_space_image_paint_update(bmain, wm, sce);	}	SWAP(int, reports->flag, reports_flag_prev);}
开发者ID:Ichthyostega,项目名称:blender,代码行数:40,


示例18: ui_but_anim_autokey

void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra){	ID *id;	bAction *action;	FCurve *fcu;	bool driven;	fcu = ui_but_get_fcurve(but, &action, &driven);	if (fcu && !driven) {		id = but->rnapoin.id.data;		/* TODO: this should probably respect the keyingset only option for anim */		if (autokeyframe_cfra_can_key(scene, id)) {			ReportList *reports = CTX_wm_reports(C);			short flag = ANIM_get_keyframing_flags(scene, 1);			fcu->flag &= ~FCURVE_SELECTED;			insert_keyframe(reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)), fcu->rna_path, fcu->array_index, cfra, flag);			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);		}	}}
开发者ID:floored,项目名称:blender,代码行数:23,


示例19: reports_to_text_poll

static int reports_to_text_poll(bContext *C){	return CTX_wm_reports(C) != NULL;}
开发者ID:mik0001,项目名称:Blender,代码行数:4,


示例20: borderselect_exec

/* borderselect operator */static int borderselect_exec(bContext *C, wmOperator *op){	SpaceInfo *sinfo = CTX_wm_space_info(C);	ARegion *ar = CTX_wm_region(C);	ReportList *reports = CTX_wm_reports(C);	int report_mask = info_report_mask(sinfo);	int extend = RNA_boolean_get(op->ptr, "extend");	Report *report_min, *report_max, *report;	//View2D *v2d = UI_view2d_fromcontext(C);	rcti rect;	//rctf rectf, rq;	short selecting = (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);	//int mval[2];	WM_operator_properties_border_to_rcti(op, &rect);#if 0	mval[0] = rect.xmin;	mval[1] = rect.ymin;	UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmin, &rectf.ymin);	mval[0] = rect.xmax;	mval[1] = rect.ymax;	UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmax, &rectf.ymax);#endif	if (!extend) {		for (report = reports->list.first; report; report = report->next) {			if ((report->type & report_mask) == 0)				continue;			report->flag &= ~SELECT;		}	}	report_min = info_text_pick(sinfo, ar, reports, rect.ymax);	report_max = info_text_pick(sinfo, ar, reports, rect.ymin);	/* get the first report if none found */	if (report_min == NULL) {		// printf("find_min/n");		for (report = reports->list.first; report; report = report->next) {			if (report->type & report_mask) {				report_min = report;				break;			}		}	}	if (report_max == NULL) {		// printf("find_max/n");		for (report = reports->list.last; report; report = report->prev) {			if (report->type & report_mask) {				report_max = report;				break;			}		}	}	if (report_min == NULL || report_max == NULL)		return OPERATOR_CANCELLED;	for (report = report_min; (report != report_max->next); report = report->next) {		if ((report->type & report_mask) == 0)			continue;		if (selecting)			report->flag |= SELECT;		else			report->flag &= ~SELECT;	}	ED_area_tag_redraw(CTX_wm_area(C));	return OPERATOR_FINISHED;}
开发者ID:danielmarg,项目名称:blender-main,代码行数:81,


示例21: unlink_action_cb

static void unlink_action_cb(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te),                             TreeStoreElem *tsep, TreeStoreElem *UNUSED(tselem)){	/* just set action to NULL */	BKE_animdata_set_action(CTX_wm_reports(C), tsep->id, NULL);}
开发者ID:244xiao,项目名称:blender,代码行数:6,


示例22: do_outliner_operation_event

static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops,                                       TreeElement *te, const wmEvent *event, const float mval[2]){	ReportList *reports = CTX_wm_reports(C); // XXX...		if (mval[1] > te->ys && mval[1] < te->ys + UI_UNIT_Y) {		int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0;		TreeStoreElem *tselem = TREESTORE(te);				/* select object that's clicked on and popup context menu */		if (!(tselem->flag & TSE_SELECTED)) {						if (outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1) )				outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);						tselem->flag |= TSE_SELECTED;			/* redraw, same as outliner_select function */			soops->storeflag |= SO_TREESTORE_REDRAW;			ED_region_tag_redraw(ar);		}				set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);				if (scenelevel) {			//if (objectlevel || datalevel || idlevel) error("Mixed selection");			//else pupmenu("Scene Operations%t|Delete");		}		else if (objectlevel) {			WM_operator_name_call(C, "OUTLINER_OT_object_operation", WM_OP_INVOKE_REGION_WIN, NULL);		}		else if (idlevel) {			if (idlevel == -1 || datalevel) {				BKE_report(reports, RPT_WARNING, "Mixed selection");			}			else {				if (idlevel == ID_GR)					WM_operator_name_call(C, "OUTLINER_OT_group_operation", WM_OP_INVOKE_REGION_WIN, NULL);				else					WM_operator_name_call(C, "OUTLINER_OT_id_operation", WM_OP_INVOKE_REGION_WIN, NULL);			}		}		else if (datalevel) {			if (datalevel == -1) {				BKE_report(reports, RPT_WARNING, "Mixed selection");			}			else {				if (datalevel == TSE_ANIM_DATA)					WM_operator_name_call(C, "OUTLINER_OT_animdata_operation", WM_OP_INVOKE_REGION_WIN, NULL);				else if (datalevel == TSE_DRIVER_BASE) {					/* do nothing... no special ops needed yet */				}				else if (ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS)) {					/*WM_operator_name_call(C, "OUTLINER_OT_renderdata_operation", WM_OP_INVOKE_REGION_WIN, NULL)*/				}				else {					WM_operator_name_call(C, "OUTLINER_OT_data_operation", WM_OP_INVOKE_REGION_WIN, NULL);				}			}		}				return 1;	}		for (te = te->subtree.first; te; te = te->next) {		if (do_outliner_operation_event(C, scene, ar, soops, te, event, mval))			return 1;	}	return 0;}
开发者ID:244xiao,项目名称:blender,代码行数:69,


示例23: update_reports_display_invoke

static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event){	wmWindowManager *wm = CTX_wm_manager(C);	ReportList *reports = CTX_wm_reports(C);	Report *report;	ReportTimerInfo *rti;	float progress = 0.0, color_progress = 0.0;	float neutral_col[3] = {0.35, 0.35, 0.35};	float neutral_gray = 0.6;	float timeout = 0.0, color_timeout = 0.0;	int send_note = 0;		/* escape if not our timer */	if ((reports->reporttimer == NULL) ||	    (reports->reporttimer != event->customdata) ||	    ((report = BKE_reports_last_displayable(reports)) == NULL) /* may have been deleted */	    )	{		return OPERATOR_PASS_THROUGH;	}	rti = (ReportTimerInfo *)reports->reporttimer->customdata;		timeout = (report->type & RPT_ERROR_ALL) ? ERROR_TIMEOUT : INFO_TIMEOUT;	color_timeout = (report->type & RPT_ERROR_ALL) ? ERROR_COLOR_TIMEOUT : INFO_COLOR_TIMEOUT;		/* clear the report display after timeout */	if ((float)reports->reporttimer->duration > timeout) {		WM_event_remove_timer(wm, NULL, reports->reporttimer);		reports->reporttimer = NULL;				WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, NULL);				return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);	}	if (rti->widthfac == 0.0f) {		/* initialize colors based on report type */		if (report->type & RPT_ERROR_ALL) {			rti->col[0] = 1.0;			rti->col[1] = 0.2;			rti->col[2] = 0.0;		}		else if (report->type & RPT_WARNING_ALL) {			rti->col[0] = 1.0;			rti->col[1] = 1.0;			rti->col[2] = 0.0;		}		else if (report->type & RPT_INFO_ALL) {			rti->col[0] = 0.3;			rti->col[1] = 0.45;			rti->col[2] = 0.7;		}		rti->grayscale = 0.75;		rti->widthfac = 1.0;	}		progress = (float)reports->reporttimer->duration / timeout;	color_progress = (float)reports->reporttimer->duration / color_timeout;		/* save us from too many draws */	if (color_progress <= 1.0f) {		send_note = 1;				/* fade colors out sharply according to progress through fade-out duration */		interp_v3_v3v3(rti->col, rti->col, neutral_col, color_progress);		rti->grayscale = interpf(neutral_gray, rti->grayscale, color_progress);	}	/* collapse report at end of timeout */	if (progress * timeout > timeout - COLLAPSE_TIMEOUT) {		rti->widthfac = (progress * timeout - (timeout - COLLAPSE_TIMEOUT)) / COLLAPSE_TIMEOUT;		rti->widthfac = 1.0f - rti->widthfac;		send_note = 1;	}		if (send_note) {		WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, NULL);	}		return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:82,


示例24: wm_free_reports

static void wm_free_reports(bContext *C){	ReportList *reports = CTX_wm_reports(C);	BKE_reports_clear(reports);}
开发者ID:Ichthyostega,项目名称:blender,代码行数:6,


示例25: ANIM_apply_keyingset

/* Given a KeyingSet and context info (if required), modify keyframes for the channels specified * by the KeyingSet. This takes into account many of the different combinations of using KeyingSets. * Returns the number of channels that keyframes were added to */int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra){	Scene *scene = CTX_data_scene(C);	ReportList *reports = CTX_wm_reports(C);	KS_Path *ksp;	int kflag = 0, success = 0;	char *groupname = NULL;		/* sanity checks */	if (ks == NULL)		return 0;		/* get flags to use */	if (mode == MODIFYKEY_MODE_INSERT) {		/* use KeyingSet's flags as base */		kflag = ks->keyingflag;				/* suppliment with info from the context */		kflag |= ANIM_get_keyframing_flags(scene, 1);	}	else if (mode == MODIFYKEY_MODE_DELETE)		kflag = 0;		/* if relative Keying Sets, poll and build up the paths */	success = ANIM_validate_keyingset(C, dsources, ks);		if (success != 0) {		/* return error code if failed */		return success;	}		/* apply the paths as specified in the KeyingSet now */	for (ksp = ks->paths.first; ksp; ksp = ksp->next) {		int arraylen, i;		short kflag2;				/* skip path if no ID pointer is specified */		if (ksp->id == NULL) {			BKE_reportf(reports, RPT_WARNING,			            "Skipping path in keying set, as it has no ID (KS = '%s', path = '%s[%d]')",			            ks->name, ksp->rna_path, ksp->array_index);			continue;		}				/* since keying settings can be defined on the paths too, extend the path before using it */		kflag2 = (kflag | ksp->keyingflag);				/* get pointer to name of group to add channels to */		if (ksp->groupmode == KSP_GROUP_NONE)			groupname = NULL;		else if (ksp->groupmode == KSP_GROUP_KSNAME)			groupname = ks->name;		else			groupname = ksp->group;				/* init arraylen and i - arraylen should be greater than i so that		 * normal non-array entries get keyframed correctly		 */		i = ksp->array_index;		arraylen = i;				/* get length of array if whole array option is enabled */		if (ksp->flag & KSP_FLAG_WHOLE_ARRAY) {			PointerRNA id_ptr, ptr;			PropertyRNA *prop;						RNA_id_pointer_create(ksp->id, &id_ptr);			if (RNA_path_resolve_property(&id_ptr, ksp->rna_path, &ptr, &prop))				arraylen = RNA_property_array_length(&ptr, prop);		}				/* we should do at least one step */		if (arraylen == i)			arraylen++;				/* for each possible index, perform operation 		 *	- assume that arraylen is greater than index		 */		for (; i < arraylen; i++) {			/* action to take depends on mode */			if (mode == MODIFYKEY_MODE_INSERT)				success += insert_keyframe(reports, ksp->id, act, groupname, ksp->rna_path, i, cfra, kflag2);			else if (mode == MODIFYKEY_MODE_DELETE)				success += delete_keyframe(reports, ksp->id, act, groupname, ksp->rna_path, i, cfra, kflag2);		}				/* set recalc-flags */		switch (GS(ksp->id->name)) {			case ID_OB: /* Object (or Object-Related) Keyframes */			{				Object *ob = (Object *)ksp->id;								// XXX: only object transforms?				DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);				break;			}//.........这里部分代码省略.........
开发者ID:castlelore,项目名称:blender-git,代码行数:101,



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


C++ CTX_wm_screen函数代码示例
C++ CTX_wm_region_view3d函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。