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


C++ id_us_min函数代码示例

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


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

示例1: free_actuator

void free_actuator(bActuator *act)
{
	if (act->data) {
		switch (act->type) {
			case ACT_ACTION:
			case ACT_SHAPEACTION:
			{
				bActionActuator *aa = (bActionActuator *)act->data;
				if (aa->act)
					id_us_min((ID *)aa->act);
				break;
			}
			case ACT_SOUND:
			{
				bSoundActuator *sa = (bSoundActuator *) act->data;
				if (sa->sound)
					id_us_min((ID *)sa->sound);
				break;
			}
		}

		MEM_freeN(act->data);
	}
	MEM_freeN(act);
}
开发者ID:mgschwan,项目名称:blensor,代码行数:25,代码来源:sca.c

示例2: BKE_brush_free

/* not brush itself */
void BKE_brush_free(Brush *brush)
{
	id_us_min((ID *)brush->mtex.tex);
	id_us_min((ID *)brush->mask_mtex.tex);
	id_us_min((ID *)brush->paint_curve);

	if (brush->icon_imbuf)
		IMB_freeImBuf(brush->icon_imbuf);

	BKE_previewimg_free(&(brush->preview));

	curvemapping_free(brush->curve);

	if (brush->gradient)
		MEM_freeN(brush->gradient);
}
开发者ID:Rojuinex,项目名称:Blender,代码行数:17,代码来源:brush.c

示例3: KX_GameObject

BL_ArmatureObject::BL_ArmatureObject(
				void* sgReplicationInfo, 
				SG_Callbacks callbacks, 
				Object *armature,
				Scene *scene,
				int vert_deform_type)

:	KX_GameObject(sgReplicationInfo,callbacks),
	m_controlledConstraints(),
	m_poseChannels(),
	m_scene(scene), // maybe remove later. needed for BKE_pose_where_is
	m_lastframe(0.0),
	m_timestep(0.040),
	m_vert_deform_type(vert_deform_type),
	m_constraintNumber(0),
	m_channelNumber(0),
	m_lastapplyframe(0.0)
{
	m_origObjArma = armature; // Keep a copy of the original armature so we can fix drivers later
	m_objArma = BKE_object_copy(G.main, armature);
	m_objArma->data = BKE_armature_copy(G.main, (bArmature *)armature->data);
	// During object replication ob->data is increase, we decrease it now because we get a copy.
	id_us_min(&((bArmature *)m_origObjArma->data)->id);
	m_pose = m_objArma->pose;
	// need this to get iTaSC working ok in the BGE
	m_pose->flag |= POSE_GAME_ENGINE;
	memcpy(m_obmat, m_objArma->obmat, sizeof(m_obmat));

	// The side-effect of this method registers this object as "animatable" with the KX_Scene.
	GetActionManager();
}
开发者ID:diekev,项目名称:blender,代码行数:31,代码来源:BL_ArmatureObject.cpp

示例4: BKE_lamp_free

void BKE_lamp_free(Lamp *la)
{
	MTex *mtex;
	int a;

	for (a = 0; a < MAX_MTEX; a++) {
		mtex = la->mtex[a];
		if (mtex && mtex->tex)
			id_us_min(&mtex->tex->id);
		if (mtex)
			MEM_freeN(mtex);
	}
	
	BKE_animdata_free((ID *)la);

	curvemapping_free(la->curfalloff);

	/* is no lib link block, but lamp extension */
	if (la->nodetree) {
		ntreeFreeTree(la->nodetree);
		MEM_freeN(la->nodetree);
	}
	
	BKE_previewimg_free(&la->preview);
	BKE_icon_id_delete(&la->id);
	la->id.icon_id = 0;
}
开发者ID:DrangPo,项目名称:blender,代码行数:27,代码来源:lamp.c

示例5: freeData

static void freeData(ModifierData *md)
{
	DisplaceModifierData *dmd = (DisplaceModifierData *) md;
	if (dmd->texture) {
		id_us_min(&dmd->texture->id);
	}
}
开发者ID:DarkDefender,项目名称:blender-npr-tess2,代码行数:7,代码来源:MOD_displace.c

示例6: BKE_brush_texture_delete

int BKE_brush_texture_delete(Brush *brush)
{
	if (brush->mtex.tex)
		id_us_min(&brush->mtex.tex->id);

	return 1;
}
开发者ID:UPBGE,项目名称:blender,代码行数:7,代码来源:brush.c

示例7: node_remove_linked

static void node_remove_linked(bNodeTree *ntree, bNode *rem_node)
{
	bNode *node, *next;
	bNodeSocket *sock;

	if (!rem_node)
		return;

	/* tag linked nodes to be removed */
	for (node = ntree->nodes.first; node; node = node->next)
		node->flag &= ~NODE_TEST;

	node_tag_recursive(rem_node);

	/* clear tags on nodes that are still used by other nodes */
	for (node = ntree->nodes.first; node; node = node->next)
		if (!(node->flag & NODE_TEST))
			for (sock = node->inputs.first; sock; sock = sock->next)
				if (sock->link && sock->link->fromnode != rem_node)
					node_clear_recursive(sock->link->fromnode);

	/* remove nodes */
	for (node = ntree->nodes.first; node; node = next) {
		next = node->next;

		if (node->flag & NODE_TEST) {
			if (node->id)
				id_us_min(node->id);
			nodeFreeNode(ntree, node);
		}
	}
}
开发者ID:mgschwan,项目名称:blensor,代码行数:32,代码来源:node_templates.c

示例8: STRNCPY

/* Add new collection, without view layer syncing. */
static Collection *collection_add(Main *bmain,
                                  Collection *collection_parent,
                                  const char *name_custom)
{
  /* Determine new collection name. */
  char name[MAX_NAME];

  if (name_custom) {
    STRNCPY(name, name_custom);
  }
  else {
    BKE_collection_new_name_get(collection_parent, name);
  }

  /* Create new collection. */
  Collection *collection = BKE_libblock_alloc(bmain, ID_GR, name, 0);

  /* We increase collection user count when linking to Collections. */
  id_us_min(&collection->id);

  /* Optionally add to parent collection. */
  if (collection_parent) {
    collection_child_add(collection_parent, collection, 0, true);
  }

  return collection;
}
开发者ID:wangyxuan,项目名称:blender,代码行数:28,代码来源:collection.c

示例9: freeData

static void freeData(ModifierData *md)
{
	WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
	if (wmd->mask_texture) {
		id_us_min(&wmd->mask_texture->id);
	}
}
开发者ID:Brachi,项目名称:blender,代码行数:7,代码来源:MOD_weightvgproximity.c

示例10: freeData

static void freeData(ModifierData *md)
{
	WaveModifierData *wmd = (WaveModifierData *) md;
	if (wmd->texture) {
		id_us_min(&wmd->texture->id);
	}
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:7,代码来源:MOD_wave.c

示例11: brush_generic_tool_set

static int brush_generic_tool_set(Main *bmain, Paint *paint, const int tool,
                                  const size_t tool_offset, const int ob_mode,
                                  const char *tool_name, const bool create_missing,
                                  const bool toggle)
{
	Brush *brush, *brush_orig = BKE_paint_brush(paint);

	if (toggle)
		brush = brush_tool_toggle(bmain, brush_orig, tool, tool_offset, ob_mode);
	else
		brush = brush_tool_cycle(bmain, brush_orig, tool, tool_offset, ob_mode);

	if (!brush && brush_tool(brush_orig, tool_offset) != tool && create_missing) {
		brush = BKE_brush_add(bmain, tool_name, ob_mode);
		id_us_min(&brush->id);  /* fake user only */
		brush_tool_set(brush, tool_offset, tool);
		brush->toggle_brush = brush_orig;
	}

	if (brush) {
		BKE_paint_brush_set(paint, brush);
		BKE_paint_invalidate_overlay_all();

		WM_main_add_notifier(NC_BRUSH | NA_EDITED, brush);
		return OPERATOR_FINISHED;
	}
	else {
		return OPERATOR_CANCELLED;
	}
}
开发者ID:mgschwan,项目名称:blensor,代码行数:30,代码来源:paint_ops.c

示例12: paint_brush_set

void paint_brush_set(Paint *p, Brush *br)
{
	if (p) {
		id_us_min((ID *)p->brush);
		id_us_plus((ID *)br);
		p->brush = br;
	}
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:8,代码来源:paint.c

示例13: freeData

static void freeData(ModifierData *md)
{
	MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;

	if (mcmd->cache_file) {
		id_us_min(&mcmd->cache_file->id);
	}
}
开发者ID:mauge123,项目名称:mechanical-blender,代码行数:8,代码来源:MOD_meshsequencecache.c

示例14: freeData

static void freeData(ModifierData *md)
{
	WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
	curvemapping_free(wmd->cmap_curve);

	if (wmd->mask_texture) {
		id_us_min(&wmd->mask_texture->id);
	}
}
开发者ID:Eibriel,项目名称:kiriblender,代码行数:9,代码来源:MOD_weightvgedit.c

示例15: set_current_material_texture

void set_current_material_texture(Material *ma, Tex *newtex)
{
	Tex *tex = NULL;
	bNode *node;

	if ((ma->use_nodes && ma->nodetree) &&
	    (node = nodeGetActiveID(ma->nodetree, ID_TE)))
	{
		tex = (Tex *)node->id;
		id_us_min(&tex->id);
		if (newtex) {
			node->id = &newtex->id;
			id_us_plus(&newtex->id);
		}
		else {
			node->id = NULL;
		}
	}
	else {
		int act = (int)ma->texact;

		tex = (ma->mtex[act]) ? ma->mtex[act]->tex : NULL;
		id_us_min(&tex->id);

		if (newtex) {
			if (!ma->mtex[act]) {
				ma->mtex[act] = BKE_texture_mtex_add();
				/* Reset this slot's ON/OFF toggle, for materials, when slot was empty. */
				ma->septex &= ~(1 << act);
				/* For volumes the default UV texture coordinates are not available. */
				if (ma->material_type == MA_TYPE_VOLUME) {
					ma->mtex[act]->texco = TEXCO_ORCO;
				}
			}
			
			ma->mtex[act]->tex = newtex;
			id_us_plus(&newtex->id);
		}
		else if (ma->mtex[act]) {
			MEM_freeN(ma->mtex[act]);
			ma->mtex[act] = NULL;
		}
	}
}
开发者ID:mgschwan,项目名称:blensor,代码行数:44,代码来源:texture.c


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