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

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

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

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

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

示例1: RE_GetRender

void RenderLayersBaseProg::initExecution(){	Scene *scene = this->getScene();	Render *re = (scene) ? RE_GetRender(scene->id.name) : NULL;	RenderResult *rr = NULL;		if (re)		rr = RE_AcquireResultRead(re);		if (rr) {		SceneRenderLayer *srl = (SceneRenderLayer *)BLI_findlink(&scene->r.layers, getLayerId());		if (srl) {			RenderLayer *rl = RE_GetRenderLayer(rr, srl->name);			if (rl && rl->rectf) {				this->m_inputBuffer = RE_RenderLayerGetPass(rl, this->m_renderpass);				if (this->m_inputBuffer == NULL && this->m_renderpass == SCE_PASS_COMBINED) {					this->m_inputBuffer = rl->rectf;				}			}		}	}	if (re) {		RE_ReleaseResult(re);		re = NULL;	}}
开发者ID:Eibriel,项目名称:kiriblender,代码行数:28,


示例2: add_empty_ks_path_exec

static int add_empty_ks_path_exec (bContext *C, wmOperator *op){	Scene *scene= CTX_data_scene(C);	KeyingSet *ks;	KS_Path *ksp;		/* verify the Keying Set to use:	 *	- use the active one	 *	- return error if it doesn't exist	 */	if (scene->active_keyingset == 0) {		BKE_report(op->reports, RPT_ERROR, "No active Keying Set to add empty path to");		return OPERATOR_CANCELLED;	}	else		ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);		/* don't use the API method for this, since that checks on values... */	ksp= MEM_callocN(sizeof(KS_Path), "KeyingSetPath Empty");	BLI_addtail(&ks->paths, ksp);	ks->active_path= BLI_countlist(&ks->paths);		ksp->groupmode= KSP_GROUP_KSNAME; // XXX?		return OPERATOR_FINISHED;}
开发者ID:jinjoh,项目名称:NOOR,代码行数:26,


示例3: BLI_findlink

/* Get the active Keying Set for the Scene provided */KeyingSet *ANIM_scene_get_active_keyingset (Scene *scene){	/* if no scene, we've got no hope of finding the Keying Set */	if (scene == NULL)		return NULL;		/* currently, there are several possibilities here:	 *	-   0: no active keying set	 *	- > 0: one of the user-defined Keying Sets, but indices start from 0 (hence the -1)	 *	- < 0: a builtin keying set	 */	if (scene->active_keyingset > 0)		return BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);	else		return BLI_findlink(&builtin_keyingsets, (-scene->active_keyingset)-1);}
开发者ID:BHCLL,项目名称:blendocv,代码行数:17,


示例4: BLI_countlist

/* note, must be freed */int *defgroup_flip_map_single(Object *ob, int *flip_map_len, const bool use_default, int defgroup){	int defbase_tot = *flip_map_len = BLI_countlist(&ob->defbase);	if (defbase_tot == 0) {		return NULL;	}	else {		bDeformGroup *dg;		char name_flip[sizeof(dg->name)];		int i, flip_num, *map = MEM_mallocN(defbase_tot * sizeof(int), __func__);		for (i = 0; i < defbase_tot; i++) {			map[i] = use_default ? i : -1;		}		dg = BLI_findlink(&ob->defbase, defgroup);		BKE_deform_flip_side_name(name_flip, dg->name, false);		if (!STREQ(name_flip, dg->name)) {			flip_num = defgroup_name_index(ob, name_flip);			if (flip_num != -1) {				map[defgroup] = flip_num;				map[flip_num] = defgroup;			}		}		return map;	}}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:32,


示例5: isDisabled

static bool isDisabled(ModifierData *md, int useRenderParams){	ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md;	ParticleSystem *psys;	ModifierData *ob_md;		if (!pimd->ob)		return true;		psys = BLI_findlink(&pimd->ob->particlesystem, pimd->psys - 1);	if (psys == NULL)		return true;		/* If the psys modifier is disabled we cannot use its data.	 * First look up the psys modifier from the object, then check if it is enabled.	 */	for (ob_md = pimd->ob->modifiers.first; ob_md; ob_md = ob_md->next) {		if (ob_md->type == eModifierType_ParticleSystem) {			ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)ob_md;			if (psmd->psys == psys) {				int required_mode;								if (useRenderParams) required_mode = eModifierMode_Render;				else required_mode = eModifierMode_Realtime;								if (!modifier_isEnabled(md->scene, ob_md, required_mode))					return true;								break;			}		}	}		return false;}
开发者ID:greg100795,项目名称:blender-git,代码行数:35,


示例6: mask_layer_move_exec

static int mask_layer_move_exec(bContext *C, wmOperator *op){	Mask *mask = CTX_data_edit_mask(C);	MaskLayer *mask_layer = BLI_findlink(&mask->masklayers, mask->masklay_act);	MaskLayer *mask_layer_other;	int direction = RNA_enum_get(op->ptr, "direction");	if (!mask_layer)		return OPERATOR_CANCELLED;	if (direction == -1) {		mask_layer_other = mask_layer->prev;		if (!mask_layer_other)			return OPERATOR_CANCELLED;		BLI_remlink(&mask->masklayers, mask_layer);		BLI_insertlinkbefore(&mask->masklayers, mask_layer_other, mask_layer);		mask->masklay_act--;	}	else if (direction == 1) {		mask_layer_other = mask_layer->next;		if (!mask_layer_other)			return OPERATOR_CANCELLED;		BLI_remlink(&mask->masklayers, mask_layer);		BLI_insertlinkafter(&mask->masklayers, mask_layer_other, mask_layer);		mask->masklay_act++;	}	return OPERATOR_FINISHED;}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:33,


示例7: wm_method_draw_stereo3d_anaglyph

static void wm_method_draw_stereo3d_anaglyph(wmWindow *win){	wmDrawData *drawdata;	int view, bit;	for (view = 0; view < 2; view ++) {		drawdata = BLI_findlink(&win->drawdata, (view * 2) + 1);		bit = view + 1;		switch (win->stereo3d_format->anaglyph_type) {			case S3D_ANAGLYPH_REDCYAN:				glColorMask((1&bit) ? GL_TRUE : GL_FALSE,				            (2&bit) ? GL_TRUE : GL_FALSE,				            (2&bit) ? GL_TRUE : GL_FALSE,				            GL_FALSE);				break;			case S3D_ANAGLYPH_GREENMAGENTA:				glColorMask((2&bit) ? GL_TRUE : GL_FALSE,				            (1&bit) ? GL_TRUE : GL_FALSE,				            (2&bit) ? GL_TRUE : GL_FALSE,				            GL_FALSE);				break;			case S3D_ANAGLYPH_YELLOWBLUE:				glColorMask((1&bit) ? GL_TRUE : GL_FALSE,				            (1&bit) ? GL_TRUE : GL_FALSE,				            (2&bit) ? GL_TRUE : GL_FALSE,				            GL_FALSE);				break;		}		wm_triple_draw_textures(win, drawdata->triple, 1.0f);		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);	}}
开发者ID:flair2005,项目名称:mechanical-blender,代码行数:35,


示例8: BLI_countlist

/* note, must be freed */int *defgroup_flip_map_single(Object *ob, int *flip_map_len, int use_default, int defgroup){	int defbase_tot= *flip_map_len= BLI_countlist(&ob->defbase);	if (defbase_tot==0) {		return NULL;	}	else {		bDeformGroup *dg;		char name[sizeof(dg->name)];		int i, flip_num, *map= MEM_mallocN(defbase_tot * sizeof(int), __func__);		for (i=0; i < defbase_tot; i++) {			if (use_default) map[i]= i;			else             map[i]= -1;		}		dg= BLI_findlink(&ob->defbase, defgroup);		flip_side_name(name, dg->name, FALSE);		if (strcmp(name, dg->name)) {			flip_num= defgroup_name_index(ob, name);			if (flip_num >= 0) {				map[defgroup]= flip_num;				map[flip_num]= defgroup;			}		}		return map;	}}
开发者ID:mik0001,项目名称:Blender,代码行数:33,


示例9: do_node_add_group

static void do_node_add_group(bContext *C, void *UNUSED(arg), int event){	SpaceNode *snode = CTX_wm_space_node(C);	Main *bmain = CTX_data_main(C);	Scene *scene = CTX_data_scene(C);	bNodeTemplate ntemp;		if (event >= 0) {		ntemp.ngroup = BLI_findlink(&G.main->nodetree, event);		ntemp.type = ntemp.ngroup->nodetype;	}	else {		ntemp.type = -event;		switch (ntemp.type) {			case NODE_GROUP:				ntemp.ngroup = ntreeAddTree("Group", snode->treetype, ntemp.type);				break;			default:				ntemp.ngroup = NULL;		}	}	if (!ntemp.ngroup)		return;		ntemp.main = bmain;	ntemp.scene = scene;		do_node_add(C, &ntemp);}
开发者ID:danielmarg,项目名称:blender-main,代码行数:29,


示例10: ED_text_region_location_from_cursor

/** * Takes a cursor (row, character) and returns x,y pixel coords. */bool ED_text_region_location_from_cursor(SpaceText *st, ARegion *ar, const int cursor_co[2], int r_pixel_co[2]){	TextLine *line = NULL;	if (!st->text) {		goto error;	}	line = BLI_findlink(&st->text->lines, cursor_co[0]);	if (!line || (cursor_co[1] < 0) || (cursor_co[1] > line->len)) {		goto error;	}	else {		int offl, offc;		int linenr_offset = st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;		/* handle tabs as well! */		int char_pos = text_get_char_pos(st, line->line, cursor_co[1]);		wrap_offset(st, ar, line, cursor_co[1], &offl, &offc);		r_pixel_co[0] = (char_pos + offc - st->left) * st->cwidth + linenr_offset;		r_pixel_co[1] = (cursor_co[0] + offl - st->top) * (st->lheight_dpi + TXT_LINE_SPACING);		r_pixel_co[1] = (ar->winy - (r_pixel_co[1] + TXT_OFFSET)) - st->lheight_dpi;	}	return true;error:	r_pixel_co[0] = r_pixel_co[1] = -1;	return false;}
开发者ID:jonntd,项目名称:blender,代码行数:33,


示例11: BLI_findlink

/* returns the active pose for a poselib */static TimeMarker *poselib_get_active_pose(bAction *act){		if ((act) && (act->active_marker))		return BLI_findlink(&act->markers, act->active_marker - 1);	else		return NULL;}
开发者ID:castlelore,项目名称:blender-git,代码行数:8,


示例12: do_node_add_group

static void do_node_add_group(bContext *C, void *UNUSED(arg), int event){	SpaceNode *snode= CTX_wm_space_node(C);	bNodeTemplate ntemp;		if (event>=0) {		ntemp.ngroup= BLI_findlink(&G.main->nodetree, event);		ntemp.type = ntemp.ngroup->nodetype;	}	else {		ntemp.type = -event;		switch (ntemp.type) {		case NODE_GROUP:			ntemp.ngroup = ntreeAddTree("Group", snode->treetype, ntemp.type);			break;		case NODE_FORLOOP:			ntemp.ngroup = ntreeAddTree("For Loop", snode->treetype, ntemp.type);			break;		case NODE_WHILELOOP:			ntemp.ngroup = ntreeAddTree("While Loop", snode->treetype, ntemp.type);			break;		default:			ntemp.ngroup = NULL;		}	}	if (!ntemp.ngroup)		return;		do_node_add(C, &ntemp);}
开发者ID:xinkang,项目名称:blendocv,代码行数:30,


示例13: poselib_remove_exec

static int poselib_remove_exec(bContext *C, wmOperator *op){	Object *ob = get_poselib_object(C);	bAction *act = (ob) ? ob->poselib : NULL;	TimeMarker *marker;	int marker_index;	FCurve *fcu;	PropertyRNA *prop;	/* check if valid poselib */	if (act == NULL) {		BKE_report(op->reports, RPT_ERROR, "Object does not have pose lib data");		return OPERATOR_CANCELLED;	}	prop = RNA_struct_find_property(op->ptr, "pose");	if (RNA_property_is_set(op->ptr, prop)) {		marker_index = RNA_property_enum_get(op->ptr, prop);	}	else {		marker_index = act->active_marker - 1;	}	/* get index (and pointer) of pose to remove */	marker = BLI_findlink(&act->markers, marker_index);	if (marker == NULL) {		BKE_reportf(op->reports, RPT_ERROR, "Invalid pose specified %d", marker_index);		return OPERATOR_CANCELLED;	}		/* remove relevant keyframes */	for (fcu = act->curves.first; fcu; fcu = fcu->next) {		BezTriple *bezt;		unsigned int i;				if (fcu->bezt) {			for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {				/* check if remove */				if (IS_EQF(bezt->vec[1][0], (float)marker->frame)) {					delete_fcurve_key(fcu, i, 1);					break;				}			}		}	}		/* remove poselib from list */	BLI_freelinkN(&act->markers, marker);		/* fix active pose number */	act->active_marker = 0;		/* send notifiers for this - using keyframe editing notifiers, since action 	 * may be being shown in anim editors as active action 	 */	WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);		/* done */	return OPERATOR_FINISHED;}
开发者ID:castlelore,项目名称:blender-git,代码行数:60,


示例14: rna_Mesh_assign_verts_to_group

static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex,                                           float weight, int assignmode){	if (ob->type != OB_MESH) {		BKE_report(reports, RPT_ERROR, "Object should be of mesh type");		return;	}	Mesh *me = (Mesh *)ob->data;	int group_index = BLI_findlink(&ob->defbase, group);	if (group_index == -1) {		BKE_report(reports, RPT_ERROR, "No vertex groups assigned to mesh");		return;	}	if (assignmode != WEIGHT_REPLACE && assignmode != WEIGHT_ADD && assignmode != WEIGHT_SUBTRACT) {		BKE_report(reports, RPT_ERROR, "Bad assignment mode");		return;	}	/* makes a set of dVerts corresponding to the mVerts */	if (!me->dvert)		create_dverts(&me->id);	/* loop list adding verts to group  */	for (i = 0; i < totindex; i++) {		if (i < 0 || i >= me->totvert) {			BKE_report(reports, RPT_ERROR, "Bad vertex index in list");			return;		}		add_vert_defnr(ob, group_index, i, weight, assignmode);	}}
开发者ID:mgschwan,项目名称:blensor,代码行数:34,


示例15: poselib_rename_invoke

static int poselib_rename_invoke(bContext *C, wmOperator *op, const wmEvent *event){	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 does not have pose lib 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_confirm(C, op, event);}
开发者ID:castlelore,项目名称:blender-git,代码行数:27,


示例16: rna_GPencil_active_layer_index_set

static void rna_GPencil_active_layer_index_set(PointerRNA *ptr, int value){	bGPdata *gpd   = (bGPdata *)ptr->id.data;	bGPDlayer *gpl = BLI_findlink(&gpd->layers, value);	gpencil_layer_setactive(gpd, gpl);}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:7,


示例17: poselib_rename_exec

static int poselib_rename_exec(bContext *C, wmOperator *op){	Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));	bAction *act = (ob) ? ob->poselib : NULL;	TimeMarker *marker;	char newname[64];		/* check if valid poselib */	if (act == NULL) {		BKE_report(op->reports, RPT_ERROR, "Object does not have pose lib data");		return OPERATOR_CANCELLED;	}		/* get index (and pointer) of pose to remove */	marker = BLI_findlink(&act->markers, RNA_enum_get(op->ptr, "pose"));	if (marker == NULL) {		BKE_report(op->reports, RPT_ERROR, "Invalid index for pose");		return OPERATOR_CANCELLED;	}		/* get new name */	RNA_string_get(op->ptr, "name", newname);		/* copy name and validate it */	BLI_strncpy(marker->name, newname, sizeof(marker->name));	BLI_uniquename(&act->markers, marker, DATA_("Pose"), '.', offsetof(TimeMarker, name), sizeof(marker->name));		/* send notifiers for this - using keyframe editing notifiers, since action 	 * may be being shown in anim editors as active action 	 */	WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);		/* done */	return OPERATOR_FINISHED;}
开发者ID:castlelore,项目名称:blender-git,代码行数:35,


示例18: ED_texture_context_check_linestyle

bool ED_texture_context_check_linestyle(const bContext *C){#ifdef WITH_FREESTYLE	Scene *scene = CTX_data_scene(C);	SceneRenderLayer *actsrl;	FreestyleConfig *config;	FreestyleLineSet *lineset;	FreestyleLineStyle *linestyle;	if (scene && (scene->r.mode & R_EDGE_FRS)) {		actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);		config = &actsrl->freestyleConfig;		if (config->mode == FREESTYLE_CONTROL_EDITOR_MODE) {			lineset = BKE_freestyle_lineset_get_active(config);			if (lineset) {				linestyle = lineset->linestyle;				return linestyle && (linestyle->flag & LS_TEXTURE);			}		}	}#else	(void)C;#endif	return false;}
开发者ID:linkedinyou,项目名称:blender-git,代码行数:25,


示例19: remove_active_keyingset_exec

static int remove_active_keyingset_exec (bContext *C, wmOperator *op){	Scene *scene= CTX_data_scene(C);	KeyingSet *ks;		/* verify the Keying Set to use:	 *	- use the active one	 *	- return error if it doesn't exist	 */	if (scene->active_keyingset == 0) {		BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove");		return OPERATOR_CANCELLED;	}	else		ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);		/* free KeyingSet's data, then remove it from the scene */	BKE_keyingset_free(ks);	BLI_freelinkN(&scene->keyingsets, ks);		/* the active one should now be the previously second-to-last one */	scene->active_keyingset--;		/* send notifiers */	WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL);		return OPERATOR_FINISHED;}
开发者ID:jinjoh,项目名称:NOOR,代码行数:28,


示例20: RE_GetSceneRender

void RenderLayersProg::determineResolution(unsigned int resolution[2],                                           unsigned int /*preferredResolution*/[2]){  Scene *sce = this->getScene();  Render *re = (sce) ? RE_GetSceneRender(sce) : NULL;  RenderResult *rr = NULL;  resolution[0] = 0;  resolution[1] = 0;  if (re) {    rr = RE_AcquireResultRead(re);  }  if (rr) {    ViewLayer *view_layer = (ViewLayer *)BLI_findlink(&sce->view_layers, getLayerId());    if (view_layer) {      RenderLayer *rl = RE_GetRenderLayer(rr, view_layer->name);      if (rl) {        resolution[0] = rl->rectx;        resolution[1] = rl->recty;      }    }  }  if (re) {    RE_ReleaseResult(re);  }}
开发者ID:dfelinto,项目名称:blender,代码行数:29,


示例21: ed_marker_make_links_scene_exec

static int ed_marker_make_links_scene_exec(bContext *C, wmOperator *op){	ListBase *markers = ED_context_get_markers(C);	Scene *scene_to = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene"));	TimeMarker *marker, *marker_new;	if (scene_to == NULL) {		BKE_report(op->reports, RPT_ERROR, "Scene not found");		return OPERATOR_CANCELLED;	}	if (scene_to == CTX_data_scene(C)) {		BKE_report(op->reports, RPT_ERROR, "Cannot re-link markers into the same scene");		return OPERATOR_CANCELLED;	}	/* copy markers */	for (marker = markers->first; marker; marker = marker->next) {		if (marker->flag & SELECT) {			marker_new = MEM_dupallocN(marker);			marker_new->prev = marker_new->next = NULL;						BLI_addtail(&scene_to->markers, marker_new);		}	}	return OPERATOR_FINISHED;}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:28,


示例22: wm_history_file_update

/** * Run after saving a file to refresh the #BLENDER_HISTORY_FILE list. */static void wm_history_file_update(void){	RecentFile *recent;	/* no write history for recovered startup files */	if (G.main->name[0] == 0)		return;	recent = G.recent_files.first;	/* refresh recent-files.txt of recent opened files, when current file was changed */	if (!(recent) || (BLI_path_cmp(recent->filepath, G.main->name) != 0)) {		recent = wm_file_history_find(G.main->name);		if (recent) {			BLI_remlink(&G.recent_files, recent);		}		else {			RecentFile *recent_next;			for (recent = BLI_findlink(&G.recent_files, U.recent_files - 1); recent; recent = recent_next) {				recent_next = recent->next;				wm_history_file_free(recent);			}			recent = wm_history_file_new(G.main->name);		}		/* add current file to the beginning of list */		BLI_addhead(&(G.recent_files), recent);		/* write current file to recent-files.txt */		wm_history_file_write();		/* also update most recent files on System */		GHOST_addToSystemRecentFiles(G.main->name);	}}
开发者ID:Moguri,项目名称:blender,代码行数:38,



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


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