这篇教程C++ BKE_reportf函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中BKE_reportf函数的典型用法代码示例。如果您正苦于以下问题:C++ BKE_reportf函数的具体用法?C++ BKE_reportf怎么用?C++ BKE_reportf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了BKE_reportf函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: rna_Group_objects_linkstatic 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,
示例2: editsource_text_editstatic 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,
示例3: RNA_pointer_createstatic 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,
示例4: rna_Object_ray_caststatic 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,
示例5: rna_Action_pose_markers_removestatic 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,
示例6: rna_KeyMap_removestatic 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,
示例7: rna_Image_updatestatic 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,
示例8: rna_KeyMap_item_removestatic 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,
示例9: RNA_pointer_createstatic 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,
示例10: rna_KeyConfig_removestatic 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,
示例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,
示例12: editsource_text_editstatic 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,
示例13: RNA_pointer_createstatic 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,
示例14: rna_Depsgraph_debug_statsstatic 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,
示例15: rna_Mask_layers_removestatic 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,
示例16: rna_Object_shape_key_removestatic void rna_Object_shape_key_remove( Object *ob, Main *bmain, ReportList *reports, PointerRNA *kb_ptr){ KeyBlock *kb = kb_ptr->data; Key *key = BKE_key_from_object(ob); if ((key == NULL) || BLI_findindex(&key->block, kb) == -1) { BKE_reportf(reports, RPT_ERROR, "ShapeKey not found"); return; } if (!BKE_object_shapekey_remove(bmain, ob, kb)) { BKE_reportf(reports, RPT_ERROR, "Could not remove ShapeKey"); return; } DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); RNA_POINTER_INVALIDATE(kb_ptr);}
开发者ID:wisaac407,项目名称:blender,代码行数:22,
示例17: rna_Object_closest_point_on_meshstatic void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float point_co[3], float max_dist, float n_location[3], float n_normal[3], int *index){ BVHTreeFromMesh treeData = {NULL}; if (ob->derivedFinal == NULL) { BKE_reportf(reports, RPT_ERROR, "Object '%s' has no mesh data to be used for finding nearest point", ob->id.name + 2); return; } /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */ bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6); if (treeData.tree == NULL) { BKE_reportf(reports, RPT_ERROR, "Object '%s' could not create internal data for finding nearest point", ob->id.name + 2); return; } else { BVHTreeNearest nearest; nearest.index = -1; nearest.dist_sq = max_dist * max_dist; if (BLI_bvhtree_find_nearest(treeData.tree, point_co, &nearest, treeData.nearest_callback, &treeData) != -1) { copy_v3_v3(n_location, nearest.co); copy_v3_v3(n_normal, nearest.no); *index = dm_tessface_to_poly_index(ob->derivedFinal, nearest.index); free_bvhtree_from_mesh(&treeData); return; } } zero_v3(n_location); zero_v3(n_normal); *index = -1; free_bvhtree_from_mesh(&treeData);}
开发者ID:bitfusionio,项目名称:blender,代码行数:39,
示例18: rna_NlaStrip_removestatic void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *reports, PointerRNA *strip_ptr){ NlaStrip *strip = strip_ptr->data; if (BLI_findindex(&track->strips, strip) == -1) { BKE_reportf(reports, RPT_ERROR, "NLA strip '%s' not found in track '%s'", strip->name, track->name); return; } BKE_nlastrip_free(&track->strips, strip); RNA_POINTER_INVALIDATE(strip_ptr); WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL);}
开发者ID:mgschwan,项目名称:blensor,代码行数:13,
示例19: rna_Image_savestatic void rna_Image_save(Image *image, Main *bmain, bContext *C, ReportList *reports){ ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, NULL); if (ibuf) { char filename[FILE_MAX]; BLI_strncpy(filename, image->name, sizeof(filename)); BLI_path_abs(filename, ID_BLEND_PATH(bmain, &image->id)); if (BKE_image_has_packedfile(image)) { ImagePackedFile *imapf; for (imapf = image->packedfiles.first; imapf; imapf = imapf->next) { if (writePackedFile(reports, imapf->filepath, imapf->packedfile, 0) != RET_OK) { BKE_reportf(reports, RPT_ERROR, "Image '%s' could not save packed file to '%s'", image->id.name + 2, imapf->filepath); } } } else if (IMB_saveiff(ibuf, filename, ibuf->flags)) { image->type = IMA_TYPE_IMAGE; if (image->source == IMA_SRC_GENERATED) image->source = IMA_SRC_FILE; IMB_colormanagment_colorspace_from_ibuf_ftype(&image->colorspace_settings, ibuf); ibuf->userflags &= ~IB_BITMAPDIRTY; } else { BKE_reportf(reports, RPT_ERROR, "Image '%s' could not be saved to '%s'", image->id.name + 2, image->name); } } else { BKE_reportf(reports, RPT_ERROR, "Image '%s' does not have any image data", image->id.name + 2); } BKE_image_release_ibuf(image, ibuf, NULL); WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, image);}
开发者ID:bitfusionio,项目名称:blender,代码行数:39,
注:本文中的BKE_reportf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ BKE_reports_init函数代码示例 C++ BKE_report函数代码示例 |