本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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;
}
示例5: freeData
static void freeData(ModifierData *md)
{
DisplaceModifierData *dmd = (DisplaceModifierData *) md;
if (dmd->texture) {
id_us_min(&dmd->texture->id);
}
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例9: freeData
static void freeData(ModifierData *md)
{
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
if (wmd->mask_texture) {
id_us_min(&wmd->mask_texture->id);
}
}
示例10: freeData
static void freeData(ModifierData *md)
{
WaveModifierData *wmd = (WaveModifierData *) md;
if (wmd->texture) {
id_us_min(&wmd->texture->id);
}
}
示例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;
}
}
示例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;
}
}
示例13: freeData
static void freeData(ModifierData *md)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
if (mcmd->cache_file) {
id_us_min(&mcmd->cache_file->id);
}
}
示例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);
}
}
示例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;
}
}
}