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


C++ IDP_FreeProperty函数代码示例

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


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


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