• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IDP_FreeProperty函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: PyMapping_Keys

static IDProperty *idp_from_PyMapping(const char *name, PyObject *ob)
{
	IDProperty *prop;
	IDPropertyTemplate val = {0};

	PyObject *keys, *vals, *key, *pval;
	int i, len;
	/* yay! we get into recursive stuff now! */
	keys = PyMapping_Keys(ob);
	vals = PyMapping_Values(ob);

	/* we allocate the group first; if we hit any invalid data,
	 * we can delete it easily enough.*/
	prop = IDP_New(IDP_GROUP, &val, name);
	len = PyMapping_Length(ob);
	for (i = 0; i < len; i++) {
		key = PySequence_GetItem(keys, i);
		pval = PySequence_GetItem(vals, i);
		if (BPy_IDProperty_Map_ValidateAndCreate(key, prop, pval) == false) {
			IDP_FreeProperty(prop);
			MEM_freeN(prop);
			Py_XDECREF(keys);
			Py_XDECREF(vals);
			Py_XDECREF(key);
			Py_XDECREF(pval);
			/* error is already set */
			return NULL;
		}
		Py_XDECREF(key);
		Py_XDECREF(pval);
	}
	Py_XDECREF(keys);
	Py_XDECREF(vals);
	return prop;
}
开发者ID:wchargin,项目名称:blender,代码行数:35,代码来源:idprop_py_api.c


示例2: BKE_libblock_free_data

void BKE_libblock_free_data(Main *UNUSED(bmain), ID *id)
{
	if (id->properties) {
		IDP_FreeProperty(id->properties);
		MEM_freeN(id->properties);
	}
}
开发者ID:UPBGE,项目名称:blender,代码行数:7,代码来源:library_remap.c


示例3: IMB_metadata_free

void IMB_metadata_free(struct IDProperty *metadata)
{
  if (metadata == NULL) {
    return;
  }

  IDP_FreeProperty(metadata);
}
开发者ID:dfelinto,项目名称:blender,代码行数:8,代码来源:metadata.c


示例4: fcm_python_free

static void fcm_python_free(FModifier *fcm)
{
	FMod_Python *data = (FMod_Python *)fcm->data;
	
	/* id-properties */
	IDP_FreeProperty(data->prop);
	MEM_freeN(data->prop);
}
开发者ID:nttputus,项目名称:blensor,代码行数:8,代码来源:fmodifier.c


示例5: WM_keymap_restore_item_to_default

void WM_keymap_restore_item_to_default(bContext *C, wmKeyMap *keymap, wmKeyMapItem *kmi)
{
	wmWindowManager *wm = CTX_wm_manager(C);
	wmKeyMap *defaultmap, *addonmap;
	wmKeyMapItem *orig;

	if(!keymap)
		return;

	/* construct default keymap from preset + addons */
	defaultmap= wm_keymap_preset(wm, keymap);
	addonmap= WM_keymap_list_find(&wm->addonconf->keymaps, keymap->idname, keymap->spaceid, keymap->regionid);

	if(addonmap) {
		defaultmap = wm_keymap_copy(defaultmap);
		wm_keymap_addon_add(defaultmap, addonmap);
	}

	/* find original item */
	orig = WM_keymap_item_find_id(defaultmap, kmi->id);

	if(orig) {
		/* restore to original */
		if(strcmp(orig->idname, kmi->idname) != 0) {
			BLI_strncpy(kmi->idname, orig->idname, sizeof(kmi->idname));
			WM_keymap_properties_reset(kmi, NULL);
		}

		if (orig->properties) {
			if(kmi->properties) {
				IDP_FreeProperty(kmi->properties);
				MEM_freeN(kmi->properties);
				kmi->properties= NULL;
			}

			kmi->properties= IDP_CopyProperty(orig->properties);
			kmi->ptr->data= kmi->properties;
		}

		kmi->propvalue = orig->propvalue;
		kmi->type = orig->type;
		kmi->val = orig->val;
		kmi->shift = orig->shift;
		kmi->ctrl = orig->ctrl;
		kmi->alt = orig->alt;
		kmi->oskey = orig->oskey;
		kmi->keymodifier = orig->keymodifier;
		kmi->maptype = orig->maptype;

		WM_keyconfig_update_tag(keymap, kmi);
	}

	/* free temporary keymap */
	if(addonmap) {
		WM_keymap_free(defaultmap);
		MEM_freeN(defaultmap);
	}
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:58,代码来源:wm_keymap.c


示例6: BLO_update_defaults_userpref_blend

/**
 * Override values in in-memory startup.blend, avoids resaving for small changes.
 */
void BLO_update_defaults_userpref_blend(void)
{
  /* default so DPI is detected automatically */
  U.dpi = 0;
  U.ui_scale = 1.0f;

#ifdef WITH_PYTHON_SECURITY
  /* use alternative setting for security nuts
   * otherwise we'd need to patch the binary blob - startup.blend.c */
  U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE;
#else
  U.flag &= ~USER_SCRIPT_AUTOEXEC_DISABLE;
#endif

  /* Transform tweak with single click and drag. */
  U.flag |= USER_RELEASECONFIRM;

  U.flag &= ~(USER_DEVELOPER_UI | USER_TOOLTIPS_PYTHON);

  /* Clear addon preferences. */
  for (bAddon *addon = U.addons.first, *addon_next; addon != NULL; addon = addon_next) {
    addon_next = addon->next;

    if (addon->prop) {
      IDP_FreeProperty(addon->prop);
      MEM_freeN(addon->prop);
      addon->prop = NULL;
    }
  }

  /* Ignore the theme saved in the blend file,
   * instead use the theme from 'userdef_default_theme.c' */
  {
    bTheme *theme = U.themes.first;
    memcpy(theme, &U_theme_default, sizeof(bTheme));
  }

  /* Leave temp directory empty, will then get appropriate value per OS. */
  U.tempdir[0] = '\0';

  /* Only enable tooltips translation by default,
   * without actually enabling translation itself, for now. */
  U.transopts = USER_TR_TOOLTIPS;
  U.memcachelimit = 4096;

  /* Auto perspective. */
  U.uiflag |= USER_AUTOPERSP;

  /* Init weight paint range. */
  BKE_colorband_init(&U.coba_weight, true);

  /* Default visible section. */
  U.userpref = USER_SECTION_INTERFACE;

  /* Default to left click select. */
  BKE_keyconfig_pref_set_select_mouse(&U, 0, true);
}
开发者ID:wangyxuan,项目名称:blender,代码行数:60,代码来源:versioning_defaults.c


示例7: keymap_item_free

static void keymap_item_free(wmKeyMapItem *kmi)
{
	if (kmi->properties) {
		IDP_FreeProperty(kmi->properties);
		MEM_freeN(kmi->properties);
	}
	if (kmi->ptr)
		MEM_freeN(kmi->ptr);
}
开发者ID:akonneker,项目名称:blensor,代码行数:9,代码来源:blender.c


示例8: BKE_blender_user_menu_item_free

void BKE_blender_user_menu_item_free(bUserMenuItem *umi)
{
  if (umi->type == USER_MENU_TYPE_OPERATOR) {
    bUserMenuItem_Op *umi_op = (bUserMenuItem_Op *)umi;
    if (umi_op->prop) {
      IDP_FreeProperty(umi_op->prop);
    }
  }
  MEM_freeN(umi);
}
开发者ID:dfelinto,项目名称:blender,代码行数:10,代码来源:blender_user_menu.c


示例9: BKE_libblock_free_data

void BKE_libblock_free_data(Main *bmain, ID *id)
{
	if (id->properties) {
		IDP_FreeProperty(id->properties);
		MEM_freeN(id->properties);
	}
	
	/* this ID may be a driver target! */
	BKE_animdata_main_cb(bmain, animdata_dtar_clear_cb, (void *)id);
}
开发者ID:diekev,项目名称:blender,代码行数:10,代码来源:library_remap.c


示例10: ffmpeg_set_expert_options

static void ffmpeg_set_expert_options(RenderData *rd)
{
	int codec_id = rd->ffcodecdata.codec;

	if (rd->ffcodecdata.properties)
		IDP_FreeProperty(rd->ffcodecdata.properties);

	if (codec_id == CODEC_ID_H264) {
		/*
		 * All options here are for x264, but must be set via ffmpeg.
		 * The names are therefore different - Search for "x264 to FFmpeg option mapping"
		 * to get a list.
		 */

		/*
		 * Use CABAC coder. Using "coder:1", which should be equivalent,
		 * crashes Blender for some reason. Either way - this is no big deal.
		 */
		BKE_ffmpeg_property_add_string(rd, "video", "coder:vlc");

		/*
		 * The other options were taken from the libx264-default.preset
		 * included in the ffmpeg distribution.
		 */
//		ffmpeg_property_add_string(rd, "video", "flags:loop"); // this breaks compatibility for QT
		BKE_ffmpeg_property_add_string(rd, "video", "cmp:chroma");
		BKE_ffmpeg_property_add_string(rd, "video", "partitions:parti4x4");
		BKE_ffmpeg_property_add_string(rd, "video", "partitions:partp8x8");
		BKE_ffmpeg_property_add_string(rd, "video", "partitions:partb8x8");
		BKE_ffmpeg_property_add_string(rd, "video", "me:hex");
		BKE_ffmpeg_property_add_string(rd, "video", "subq:6");
		BKE_ffmpeg_property_add_string(rd, "video", "me_range:16");
		BKE_ffmpeg_property_add_string(rd, "video", "qdiff:4");
		BKE_ffmpeg_property_add_string(rd, "video", "keyint_min:25");
		BKE_ffmpeg_property_add_string(rd, "video", "sc_threshold:40");
		BKE_ffmpeg_property_add_string(rd, "video", "i_qfactor:0.71");
		BKE_ffmpeg_property_add_string(rd, "video", "b_strategy:1");
		BKE_ffmpeg_property_add_string(rd, "video", "bf:3");
		BKE_ffmpeg_property_add_string(rd, "video", "refs:2");
		BKE_ffmpeg_property_add_string(rd, "video", "qcomp:0.6");
		BKE_ffmpeg_property_add_string(rd, "video", "directpred:3");
		BKE_ffmpeg_property_add_string(rd, "video", "trellis:0");
		BKE_ffmpeg_property_add_string(rd, "video", "flags2:wpred");
		BKE_ffmpeg_property_add_string(rd, "video", "flags2:dct8x8");
		BKE_ffmpeg_property_add_string(rd, "video", "flags2:fastpskip");
		BKE_ffmpeg_property_add_string(rd, "video", "wpredp:2");

		if (rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT)
			BKE_ffmpeg_property_add_string(rd, "video", "cqp:0");
	}
	else if (codec_id == CODEC_ID_DNXHD) {
		if (rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT)
			BKE_ffmpeg_property_add_string(rd, "video", "mbd:rd");
	}
}
开发者ID:scorpion81,项目名称:blender-voro,代码行数:55,代码来源:writeffmpeg.c


示例11: userdef_free_keyconfig_prefs

static void userdef_free_keyconfig_prefs(UserDef *userdef)
{
  for (wmKeyConfigPref *kpt = userdef->user_keyconfig_prefs.first, *kpt_next; kpt;
       kpt = kpt_next) {
    kpt_next = kpt->next;
    IDP_FreeProperty(kpt->prop);
    MEM_freeN(kpt->prop);
    MEM_freeN(kpt);
  }
  BLI_listbase_clear(&userdef->user_keyconfig_prefs);
}
开发者ID:wangyxuan,项目名称:blender,代码行数:11,代码来源:blender.c


示例12: userdef_free_addons

static void userdef_free_addons(UserDef *userdef)
{
	for (bAddon *addon = userdef->addons.first, *addon_next; addon; addon = addon_next) {
		addon_next = addon->next;
		if (addon->prop) {
			IDP_FreeProperty(addon->prop);
			MEM_freeN(addon->prop);
		}
		MEM_freeN(addon);
	}
	BLI_listbase_clear(&userdef->addons);
}
开发者ID:wisaac407,项目名称:blender,代码行数:12,代码来源:blender.c


示例13: BKE_libblock_free_data

void BKE_libblock_free_data(ID *id)
{
	Main *bmain = G.main;  /* should eventually be an arg */
	
	if (id->properties) {
		IDP_FreeProperty(id->properties);
		MEM_freeN(id->properties);
	}
	
	/* this ID may be a driver target! */
	BKE_animdata_main_cb(bmain, animdata_dtar_clear_cb, (void *)id);
}
开发者ID:manwapastorelli,项目名称:blender-git,代码行数:12,代码来源:library.c


示例14: BKE_area_region_free

/* not region itself */
void BKE_area_region_free(SpaceType *st, ARegion *ar)
{
	uiList *uilst;

	if (st) {
		ARegionType *art = BKE_regiontype_from_id(st, ar->regiontype);
		
		if (art && art->free)
			art->free(ar);
		
		if (ar->regiondata)
			printf("regiondata free error\n");
	}
	else if (ar->type && ar->type->free)
		ar->type->free(ar);
	
	if (ar->v2d.tab_offset) {
		MEM_freeN(ar->v2d.tab_offset);
		ar->v2d.tab_offset = NULL;
	}

	if (!BLI_listbase_is_empty(&ar->panels)) {
		Panel *pa, *pa_next;
		for (pa = ar->panels.first; pa; pa = pa_next) {
			pa_next = pa->next;
			if (pa->activedata) {
				MEM_freeN(pa->activedata);
			}
			MEM_freeN(pa);
		}
	}

	for (uilst = ar->ui_lists.first; uilst; uilst = uilst->next) {
		if (uilst->dyn_data) {
			uiListDyn *dyn_data = uilst->dyn_data;
			if (dyn_data->items_filter_flags) {
				MEM_freeN(dyn_data->items_filter_flags);
			}
			if (dyn_data->items_filter_neworder) {
				MEM_freeN(dyn_data->items_filter_neworder);
			}
			MEM_freeN(dyn_data);
		}
		if (uilst->properties) {
			IDP_FreeProperty(uilst->properties);
			MEM_freeN(uilst->properties);
		}
	}
	BLI_freelistN(&ar->ui_lists);
	BLI_freelistN(&ar->ui_previews);
	BLI_freelistN(&ar->panels_category);
	BLI_freelistN(&ar->panels_category_active);
}
开发者ID:flair2005,项目名称:mechanical-blender,代码行数:54,代码来源:screen.c


示例15: bone_free

void bone_free(bArmature *arm, EditBone *bone)
{
	if (arm->act_edbone == bone)
		arm->act_edbone = NULL;

	if (bone->prop) {
		IDP_FreeProperty(bone->prop);
		MEM_freeN(bone->prop);
	}

	BLI_freelinkN(arm->edbo, bone);
}
开发者ID:mgschwan,项目名称:blensor,代码行数:12,代码来源:armature_utils.c


示例16: BKE_userdef_free

void BKE_userdef_free(void)
{
	wmKeyMap *km;
	wmKeyMapItem *kmi;
	wmKeyMapDiffItem *kmdi;
	bAddon *addon, *addon_next;
	uiFont *font;

	for (km = U.user_keymaps.first; km; km = km->next) {
		for (kmdi = km->diff_items.first; kmdi; kmdi = kmdi->next) {
			if (kmdi->add_item) {
				keymap_item_free(kmdi->add_item);
				MEM_freeN(kmdi->add_item);
			}
			if (kmdi->remove_item) {
				keymap_item_free(kmdi->remove_item);
				MEM_freeN(kmdi->remove_item);
			}
		}

		for (kmi = km->items.first; kmi; kmi = kmi->next)
			keymap_item_free(kmi);

		BLI_freelistN(&km->diff_items);
		BLI_freelistN(&km->items);
	}
	
	for (addon = U.addons.first; addon; addon = addon_next) {
		addon_next = addon->next;
		if (addon->prop) {
			IDP_FreeProperty(addon->prop);
			MEM_freeN(addon->prop);
		}
		MEM_freeN(addon);
	}

	for (font = U.uifonts.first; font; font = font->next) {
		BLF_unload_id(font->blf_id);
	}

	BLF_default_set(-1);

	BLI_freelistN(&U.autoexec_paths);

	BLI_freelistN(&U.uistyles);
	BLI_freelistN(&U.uifonts);
	BLI_freelistN(&U.themes);
	BLI_freelistN(&U.user_keymaps);
}
开发者ID:akonneker,项目名称:blensor,代码行数:49,代码来源:blender.c


示例17: BKE_ffmpeg_property_del

void BKE_ffmpeg_property_del(RenderData *rd, void *type, void *prop_)
{
	struct IDProperty *prop = (struct IDProperty *) prop_;
	IDProperty *group;
	
	if (!rd->ffcodecdata.properties) {
		return;
	}

	group = IDP_GetPropertyFromGroup(rd->ffcodecdata.properties, type);
	if (group && prop) {
		IDP_RemFromGroup(group, prop);
		IDP_FreeProperty(prop);
		MEM_freeN(prop);
	}
}
开发者ID:scorpion81,项目名称:blender-voro,代码行数:16,代码来源:writeffmpeg.c


示例18: BKE_pose_channel_copy_data

/**
 * Copy the internal members of each pose channel including constraints
 * and ID-Props, used when duplicating bones in editmode.
 * (unlike copy_pose_channel_data which only does posing-related stuff).
 *
 * \note use when copying bones in editmode (on returned value from #BKE_pose_channel_verify)
 */
void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
{
	/* copy transform locks */
	pchan->protectflag = pchan_from->protectflag;

	/* copy rotation mode */
	pchan->rotmode = pchan_from->rotmode;

	/* copy bone group */
	pchan->agrp_index = pchan_from->agrp_index;

	/* ik (dof) settings */
	pchan->ikflag = pchan_from->ikflag;
	copy_v3_v3(pchan->limitmin, pchan_from->limitmin);
	copy_v3_v3(pchan->limitmax, pchan_from->limitmax);
	copy_v3_v3(pchan->stiffness, pchan_from->stiffness);
	pchan->ikstretch = pchan_from->ikstretch;
	pchan->ikrotweight = pchan_from->ikrotweight;
	pchan->iklinweight = pchan_from->iklinweight;
	
	/* bbone settings (typically not animated) */
	pchan->bboneflag = pchan_from->bboneflag;
	pchan->bbone_next = pchan_from->bbone_next;
	pchan->bbone_prev = pchan_from->bbone_prev;

	/* constraints */
	BKE_constraints_copy(&pchan->constraints, &pchan_from->constraints, true);

	/* id-properties */
	if (pchan->prop) {
		/* unlikely but possible it exists */
		IDP_FreeProperty(pchan->prop);
		MEM_freeN(pchan->prop);
		pchan->prop = NULL;
	}
	if (pchan_from->prop) {
		pchan->prop = IDP_CopyProperty(pchan_from->prop);
	}

	/* custom shape */
	pchan->custom = pchan_from->custom;
	if (pchan->custom) {
		id_us_plus(&pchan->custom->id);
	}

	pchan->custom_scale = pchan_from->custom_scale;
}
开发者ID:UPBGE,项目名称:blender,代码行数:54,代码来源:action.c


示例19: node_free_script

static void node_free_script(bNode *node)
{
    NodeShaderScript *nss = node->storage;

    if (nss) {
        if (nss->bytecode) {
            MEM_freeN(nss->bytecode);
        }

        if (nss->prop) {
            IDP_FreeProperty(nss->prop);
            MEM_freeN(nss->prop);
        }

        MEM_freeN(nss);
    }
}
开发者ID:scorpion81,项目名称:blender-voro,代码行数:17,代码来源:node_shader_script.c


示例20: ED_armature_ebone_listbase_free

void ED_armature_ebone_listbase_free(ListBase *lb)
{
	EditBone *ebone, *ebone_next;

	for (ebone = lb->first; ebone; ebone = ebone_next) {
		ebone_next = ebone->next;

		if (ebone->prop) {
			IDP_FreeProperty(ebone->prop);
			MEM_freeN(ebone->prop);
		}

		MEM_freeN(ebone);
	}

	BLI_listbase_clear(lb);
}
开发者ID:mgschwan,项目名称:blensor,代码行数:17,代码来源:armature_utils.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IDS_HDT_CONSOLE函数代码示例发布时间:2022-05-30
下一篇:
C++ IDL_NODE_TYPE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap