当前位置: 首页>>代码示例>>C++>>正文


C++ BKE_reportf函数代码示例

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


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

示例1: rna_Group_objects_link

static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object)
{
	if (!add_to_group(group, object, CTX_data_scene(C), NULL)) {
		BKE_reportf(reports, RPT_ERROR, "Object '%s' already in group '%s'", object->id.name + 2, group->id.name + 2);
		return;
	}

	WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
}
开发者ID:danielmarg,项目名称:blender-main,代码行数:9,代码来源:rna_group.c

示例2: editsource_text_edit

static int editsource_text_edit(bContext *C,
                                wmOperator *op,
                                const char filepath[FILE_MAX],
                                const int line)
{
  struct Main *bmain = CTX_data_main(C);
  Text *text;

  /* Developers may wish to copy-paste to an external editor. */
  printf("%s:%d\n", filepath, line);

  for (text = bmain->texts.first; text; text = text->id.next) {
    if (text->name && BLI_path_cmp(text->name, filepath) == 0) {
      break;
    }
  }

  if (text == NULL) {
    text = BKE_text_load(bmain, filepath, BKE_main_blendfile_path(bmain));
    id_us_ensure_real(&text->id);
  }

  if (text == NULL) {
    BKE_reportf(op->reports, RPT_WARNING, "File '%s' cannot be opened", filepath);
    return OPERATOR_CANCELLED;
  }
  else {
    /* naughty!, find text area to set, not good behavior
     * but since this is a dev tool lets allow it - campbell */
    ScrArea *sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0);
    if (sa) {
      SpaceText *st = sa->spacedata.first;
      st->text = text;
    }
    else {
      BKE_reportf(op->reports, RPT_INFO, "See '%s' in the text editor", text->id.name + 2);
    }

    txt_move_toline(text, line - 1, false);
    WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
  }

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

示例3: RNA_pointer_create

static StructRNA *rna_RenderEngine_register(
        Main *bmain, ReportList *reports, void *data, const char *identifier,
        StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
	RenderEngineType *et, dummyet = {NULL};
	RenderEngine dummyengine = {NULL};
	PointerRNA dummyptr;
	int have_function[7];

	/* setup dummy engine & engine type to store static properties in */
	dummyengine.type = &dummyet;
	dummyet.flag |= RE_USE_SHADING_NODES_CUSTOM;
	RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr);

	/* validate the python class */
	if (validate(&dummyptr, data, have_function) != 0)
		return NULL;

	if (strlen(identifier) >= sizeof(dummyet.idname)) {
		BKE_reportf(reports, RPT_ERROR, "Registering render engine class: '%s' is too long, maximum length is %d",
		            identifier, (int)sizeof(dummyet.idname));
		return NULL;
	}

	/* check if we have registered this engine type before, and remove it */
	for (et = R_engines.first; et; et = et->next) {
		if (STREQ(et->idname, dummyet.idname)) {
			if (et->ext.srna)
				rna_RenderEngine_unregister(bmain, et->ext.srna);
			break;
		}
	}
	
	/* create a new engine type */
	et = MEM_callocN(sizeof(RenderEngineType), "python render engine");
	memcpy(et, &dummyet, sizeof(dummyet));

	et->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, et->idname, &RNA_RenderEngine);
	et->ext.data = data;
	et->ext.call = call;
	et->ext.free = free;
	RNA_struct_blender_type_set(et->ext.srna, et);

	et->update = (have_function[0]) ? engine_update : NULL;
	et->render = (have_function[1]) ? engine_render : NULL;
	et->bake = (have_function[2]) ? engine_bake : NULL;
	et->view_update = (have_function[3]) ? engine_view_update : NULL;
	et->view_draw = (have_function[4]) ? engine_view_draw : NULL;
	et->update_script_node = (have_function[5]) ? engine_update_script_node : NULL;
	et->update_render_passes = (have_function[6]) ? engine_update_render_passes : NULL;

	BLI_addtail(&R_engines, et);

	return et->ext.srna;
}
开发者ID:mgschwan,项目名称:blensor,代码行数:55,代码来源:rna_render.c

示例4: rna_Object_ray_cast

static void rna_Object_ray_cast(
        Object *ob, ReportList *reports,
        float origin[3], float direction[3], float distance,
        int *r_success, float r_location[3], float r_normal[3], int *r_index)
{
	bool success = false;

	if (ob->derivedFinal == NULL) {
		BKE_reportf(reports, RPT_ERROR, "Object '%s' has no mesh data to be used for ray casting", ob->id.name + 2);
		return;
	}

	/* Test BoundBox first (efficiency) */
	BoundBox *bb = BKE_object_boundbox_get(ob);
	float distmin;
	if (!bb || (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], &distmin, NULL) && distmin <= distance)) {

		BVHTreeFromMesh treeData = {NULL};

		/* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
		bvhtree_from_mesh_looptri(&treeData, ob->derivedFinal, 0.0f, 4, 6);

		/* may fail if the mesh has no faces, in that case the ray-cast misses */
		if (treeData.tree != NULL) {
			BVHTreeRayHit hit;

			hit.index = -1;
			hit.dist = distance;

			normalize_v3(direction);


			if (BLI_bvhtree_ray_cast(treeData.tree, origin, direction, 0.0f, &hit,
			                         treeData.raycast_callback, &treeData) != -1)
			{
				if (hit.dist <= distance) {
					*r_success = success = true;

					copy_v3_v3(r_location, hit.co);
					copy_v3_v3(r_normal, hit.no);
					*r_index = dm_looptri_to_poly_index(ob->derivedFinal, &treeData.looptri[hit.index]);
				}
			}

			free_bvhtree_from_mesh(&treeData);
		}
	}
	if (success == false) {
		*r_success = false;

		zero_v3(r_location);
		zero_v3(r_normal);
		*r_index = -1;
	}
}
开发者ID:wisaac407,项目名称:blender,代码行数:55,代码来源:rna_object_api.c

示例5: rna_Action_pose_markers_remove

static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, PointerRNA *marker_ptr)
{
    TimeMarker *marker = marker_ptr->data;
    if (!BLI_remlink_safe(&act->markers, marker)) {
        BKE_reportf(reports, RPT_ERROR, "Timeline marker '%s' not found in action '%s'", marker->name, act->id.name + 2);
        return;
    }

    MEM_freeN(marker);
    RNA_POINTER_INVALIDATE(marker_ptr);
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:11,代码来源:rna_action.c

示例6: rna_KeyMap_remove

static void rna_KeyMap_remove(wmKeyConfig *keyconfig, ReportList *reports, PointerRNA *keymap_ptr)
{
  wmKeyMap *keymap = keymap_ptr->data;

  if (WM_keymap_remove(keyconfig, keymap) == false) {
    BKE_reportf(reports, RPT_ERROR, "KeyConfig '%s' cannot be removed", keymap->idname);
    return;
  }

  RNA_POINTER_INVALIDATE(keymap_ptr);
}
开发者ID:dfelinto,项目名称:blender,代码行数:11,代码来源:rna_wm_api.c

示例7: rna_Image_update

static void rna_Image_update(Image *image, ReportList *reports)
{
	ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);

	if(ibuf == NULL) {
		BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2);
		return;
	}

	IMB_rect_from_float(ibuf);
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:11,代码来源:rna_image_api.c

示例8: rna_KeyMap_item_remove

static void rna_KeyMap_item_remove(wmKeyMap *km, ReportList *reports, PointerRNA *kmi_ptr)
{
	wmKeyMapItem *kmi = kmi_ptr->data;

	if (WM_keymap_remove_item(km, kmi) == false) {
		BKE_reportf(reports, RPT_ERROR, "KeyMapItem '%s' cannot be removed from '%s'", kmi->idname, km->idname);
		return;
	}

	RNA_POINTER_INVALIDATE(kmi_ptr);
}
开发者ID:wisaac407,项目名称:blender,代码行数:11,代码来源:rna_wm_api.c

示例9: RNA_pointer_create

static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
                                      StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
	ARegionType *art;
	HeaderType *ht, dummyht = {NULL};
	Header dummyheader = {NULL};
	PointerRNA dummyhtr;
	int have_function[1];

	/* setup dummy header & header type to store static properties in */
	dummyheader.type = &dummyht;
	RNA_pointer_create(NULL, &RNA_Header, &dummyheader, &dummyhtr);

	/* validate the python class */
	if (validate(&dummyhtr, data, have_function) != 0)
		return NULL;

	if (strlen(identifier) >= sizeof(dummyht.idname)) {
		BKE_reportf(reports, RPT_ERROR, "Registering header class: '%s' is too long, maximum length is %d",
		            identifier, (int)sizeof(dummyht.idname));
		return NULL;
	}

	if (!(art = region_type_find(reports, dummyht.space_type, RGN_TYPE_HEADER)))
		return NULL;

	/* check if we have registered this header type before, and remove it */
	for (ht = art->headertypes.first; ht; ht = ht->next) {
		if (strcmp(ht->idname, dummyht.idname) == 0) {
			if (ht->ext.srna)
				rna_Header_unregister(bmain, ht->ext.srna);
			break;
		}
	}
	
	/* create a new header type */
	ht = MEM_callocN(sizeof(HeaderType), "python buttons header");
	memcpy(ht, &dummyht, sizeof(dummyht));

	ht->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ht->idname, &RNA_Header);
	ht->ext.data = data;
	ht->ext.call = call;
	ht->ext.free = free;
	RNA_struct_blender_type_set(ht->ext.srna, ht);

	ht->draw = (have_function[0]) ? header_draw : NULL;

	BLI_addtail(&art->headertypes, ht);

	/* update while blender is running */
	WM_main_add_notifier(NC_WINDOW, NULL);
	
	return ht->ext.srna;
}
开发者ID:YasirArafath,项目名称:blender-git,代码行数:54,代码来源:rna_ui.c

示例10: rna_KeyConfig_remove

static void rna_KeyConfig_remove(wmWindowManager *wm, ReportList *reports, PointerRNA *keyconf_ptr)
{
  wmKeyConfig *keyconf = keyconf_ptr->data;

  if (WM_keyconfig_remove(wm, keyconf) == false) {
    BKE_reportf(reports, RPT_ERROR, "KeyConfig '%s' cannot be removed", keyconf->idname);
    return;
  }

  RNA_POINTER_INVALIDATE(keyconf_ptr);
}
开发者ID:dfelinto,项目名称:blender,代码行数:11,代码来源:rna_wm_api.c

示例11: packAll

/* no libraries for now */
void packAll(Main *bmain, ReportList *reports, bool verbose)
{
	Image *ima;
	VFont *vfont;
	bSound *sound;
	int tot = 0;
	
	for (ima = bmain->image.first; ima; ima = ima->id.next) {
		if (BKE_image_has_packedfile(ima) == false && ima->id.lib == NULL) {
			if (ima->source == IMA_SRC_FILE) {
				BKE_image_packfiles(reports, ima, ID_BLEND_PATH(bmain, &ima->id));
				tot ++;
			}
			else if (BKE_image_is_animated(ima) && verbose) {
				BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported",
				            ima->id.name + 2);
			}
		}
	}

	for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next) {
		if (vfont->packedfile == NULL && vfont->id.lib == NULL && BKE_vfont_is_builtin(vfont) == false) {
			vfont->packedfile = newPackedFile(reports, vfont->name, bmain->name);
			tot ++;
		}
	}

	for (sound = bmain->sound.first; sound; sound = sound->id.next) {
		if (sound->packedfile == NULL && sound->id.lib == NULL) {
			sound->packedfile = newPackedFile(reports, sound->name, bmain->name);
			tot++;
		}
	}
	
	if (tot > 0)
		BKE_reportf(reports, RPT_INFO, "Packed %d files", tot);
	else if (verbose)
		BKE_report(reports, RPT_INFO, "No new files have been packed");


}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:42,代码来源:packedFile.c

示例12: editsource_text_edit

static int editsource_text_edit(bContext *C, wmOperator *op,
                                char filepath[240], int line)
{
	struct Main *bmain= CTX_data_main(C);
	Text *text;

	for (text=bmain->text.first; text; text=text->id.next) {
		if (text->name && BLI_path_cmp(text->name, filepath) == 0) {
			break;
		}
	}

	if (text == NULL) {
		text= add_text(filepath, bmain->name);
	}

	if (text == NULL) {
		BKE_reportf(op->reports, RPT_WARNING,
		            "file: '%s' can't be opened", filepath);
		return OPERATOR_CANCELLED;
	}
	else {
		/* naughty!, find text area to set, not good behavior
		 * but since this is a dev tool lets allow it - campbell */
		ScrArea *sa= BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0);
		if(sa) {
			SpaceText *st= sa->spacedata.first;
			st->text= text;
		}
		else {
			BKE_reportf(op->reports, RPT_INFO,
			            "See '%s' in the text editor", text->id.name + 2);
		}

		txt_move_toline(text, line - 1, FALSE);
		WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
	}

	return OPERATOR_FINISHED;
}
开发者ID:mik0001,项目名称:Blender,代码行数:40,代码来源:interface_ops.c

示例13: RNA_pointer_create

static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
                                             StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
	KeyingSetInfo dummyksi = {NULL};
	KeyingSetInfo *ksi;
	PointerRNA dummyptr = {{NULL}};
	int have_function[3];

	/* setup dummy type info to store static properties in */
	/* TODO: perhaps we want to get users to register as if they're using 'KeyingSet' directly instead? */
	RNA_pointer_create(NULL, &RNA_KeyingSetInfo, &dummyksi, &dummyptr);
	
	/* validate the python class */
	if (validate(&dummyptr, data, have_function) != 0)
		return NULL;
	
	if (strlen(identifier) >= sizeof(dummyksi.idname)) {
		BKE_reportf(reports, RPT_ERROR, "Registering keying set info class: '%s' is too long, maximum length is %d",
		            identifier, (int)sizeof(dummyksi.idname));
		return NULL;
	}
	
	/* check if we have registered this info before, and remove it */
	ksi = ANIM_keyingset_info_find_name(dummyksi.idname);
	if (ksi && ksi->ext.srna)
		rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna);
	
	/* create a new KeyingSetInfo type */
	ksi = MEM_callocN(sizeof(KeyingSetInfo), "python keying set info");
	memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo));
	
	/* set RNA-extensions info */
	ksi->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ksi->idname, &RNA_KeyingSetInfo);
	ksi->ext.data = data;
	ksi->ext.call = call;
	ksi->ext.free = free;
	RNA_struct_blender_type_set(ksi->ext.srna, ksi);
	
	/* set callbacks */
	/* NOTE: we really should have all of these...  */
	ksi->poll = (have_function[0]) ? RKS_POLL_rna_internal : NULL;
	ksi->iter = (have_function[1]) ? RKS_ITER_rna_internal : NULL;
	ksi->generate = (have_function[2]) ? RKS_GEN_rna_internal : NULL;
	
	/* add and register with other info as needed */
	ANIM_keyingset_info_register(ksi);
	
	WM_main_add_notifier(NC_WINDOW, NULL);

	/* return the struct-rna added */
	return ksi->ext.srna;
}
开发者ID:244xiao,项目名称:blender,代码行数:52,代码来源:rna_animation.c

示例14: rna_Depsgraph_debug_stats

static void rna_Depsgraph_debug_stats(Depsgraph *graph, ReportList *reports)
{
	size_t outer, ops, rels;
	
	DEG_stats_simple(graph, &outer, &ops, &rels);
	
	// XXX: report doesn't seem to work
	printf("Approx %lu Operations, %lu Relations, %lu Outer Nodes\n",
	       ops, rels, outer);
		   
	BKE_reportf(reports, RPT_WARNING, "Approx. %lu Operations, %lu Relations, %lu Outer Nodes",
	            ops, rels, outer);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:13,代码来源:rna_depsgraph.c

示例15: rna_Mask_layers_remove

static void rna_Mask_layers_remove(Mask *mask, ReportList *reports, PointerRNA *masklay_ptr)
{
	MaskLayer *masklay = masklay_ptr->data;
	if (BLI_findindex(&mask->masklayers, masklay) == -1) {
		BKE_reportf(reports, RPT_ERROR, "Mask layer '%s' not found in mask '%s'", masklay->name, mask->id.name + 2);
		return;
	}

	BKE_mask_layer_remove(mask, masklay);
	RNA_POINTER_INVALIDATE(masklay_ptr);

	WM_main_add_notifier(NC_MASK | NA_EDITED, mask);
}
开发者ID:ilent2,项目名称:Blender-Billboard-Modifier,代码行数:13,代码来源:rna_mask.c


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