Пример #1
0
static void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob, int from_mix)
{
	if(object_insert_shape_key(scene, ob, NULL, from_mix)) {
		Key *key= ob_get_key(ob);
		ob->shapenr= BLI_countlist(&key->block);

		WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
	}
}
Пример #2
0
static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *reports, const char *name, int from_mix)
{
	Scene *scene= CTX_data_scene(C);
	KeyBlock *kb= NULL;

	if((kb=object_insert_shape_key(scene, ob, name, from_mix))) {
		PointerRNA keyptr;

		RNA_pointer_create((ID *)ob->data, &RNA_ShapeKey, kb, &keyptr);
		WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
		
		return keyptr;
	}
	else {
		BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes", ob->id.name+2);
		return PointerRNA_NULL;
	}
}