Ejemplo n.º 1
0
static void rna_Action_groups_remove(bAction *act, ReportList *reports, PointerRNA *agrp_ptr)
{
    bActionGroup *agrp = agrp_ptr->data;
    FCurve *fcu, *fcn;

    /* try to remove the F-Curve from the action */
    if (BLI_remlink_safe(&act->groups, agrp) == false) {
        BKE_reportf(reports, RPT_ERROR, "Action group '%s' not found in action '%s'", agrp->name, act->id.name + 2);
        return;
    }

    /* move every one one of the group's F-Curves out into the Action again */
    for (fcu = agrp->channels.first; (fcu) && (fcu->grp == agrp); fcu = fcn) {
        fcn = fcu->next;

        /* remove from group */
        action_groups_remove_channel(act, fcu);

        /* tack onto the end */
        BLI_addtail(&act->curves, fcu);
    }

    MEM_freeN(agrp);
    RNA_POINTER_INVALIDATE(agrp_ptr);
}
Ejemplo n.º 2
0
/* Remove the given KeyingSetInfo from the list of type infos, and also remove the builtin set if appropriate */
void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *ksi)
{
	KeyingSet *ks, *ksn;

	/* find relevant builtin KeyingSets which use this, and remove them */
	/* TODO: this isn't done now, since unregister is really only used atm when we
	 * reload the scripts, which kindof defeats the purpose of "builtin"? */
	for (ks = builtin_keyingsets.first; ks; ks = ksn) {
		ksn = ks->next;

		/* remove if matching typeinfo name */
		if (strcmp(ks->typeinfo, ksi->idname) == 0) {
			Scene *scene;
			BKE_keyingset_free(ks);
			BLI_remlink(&builtin_keyingsets, ks);

			for (scene = bmain->scene.first; scene; scene = scene->id.next)
				BLI_remlink_safe(&scene->keyingsets, ks);

			MEM_freeN(ks);
		}
	}
	
	/* free the type info */
	BLI_freelinkN(&keyingset_type_infos, ksi);
}
Ejemplo n.º 3
0
static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, TimeMarker *marker)
{
	if (!BLI_remlink_safe(&act->markers, marker)) {
		BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in Action '%s'", marker->name, act->id.name+2);
		return;
	}

	/* XXX, invalidates PyObject */
	MEM_freeN(marker);
}
Ejemplo n.º 4
0
static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, PointerRNA *marker_ptr)
{
    TimeMarker *marker = marker_ptr->data;
    if (!BLI_remlink_safe(&act->markers, marker)) {
        BKE_reportf(reports, RPT_ERROR, "Timeline marker '%s' not found in action '%s'", marker->name, act->id.name + 2);
        return;
    }

    MEM_freeN(marker);
    RNA_POINTER_INVALIDATE(marker_ptr);
}
Ejemplo n.º 5
0
static void rna_Sequences_remove(ID *id, Editing *ed, ReportList *reports, PointerRNA *seq_ptr)
{
	Sequence *seq = seq_ptr->data;
	Scene *scene = (Scene *)id;

	if (BLI_remlink_safe(&ed->seqbase, seq) == false) {
		BKE_reportf(reports, RPT_ERROR, "Sequence '%s' not in scene '%s'", seq->name + 2, scene->id.name + 2);
		return;
	}

	BKE_sequence_free(scene, seq);
	RNA_POINTER_INVALIDATE(seq_ptr);

	WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene);
}
Ejemplo n.º 6
0
static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, PointerRNA *ml_ptr)
{
	MetaElem *ml = ml_ptr->data;

	if (BLI_remlink_safe(&mb->elems, ml) == FALSE) {
		BKE_reportf(reports, RPT_ERROR, "Metaball '%s' does not contain spline given", mb->id.name + 2);
		return;
	}

	MEM_freeN(ml);
	RNA_POINTER_INVALIDATE(ml_ptr);

	/* cheating way for importers to avoid slow updates */
	if (mb->id.us > 0) {
		DAG_id_tag_update(&mb->id, 0);
		WM_main_add_notifier(NC_GEOM | ND_DATA, &mb->id);
	}
}
Ejemplo n.º 7
0
static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, MetaElem *ml)
{
	int found= 0;

	found= BLI_remlink_safe(&mb->elems, ml);

	if(!found) {
		BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" does not contain spline given", mb->id.name+2);
		return;
	}

	MEM_freeN(ml);
	/* invalidate pointer!, no can do */

	/* cheating way for importers to avoid slow updates */
	if(mb->id.us > 0) {
		DAG_id_tag_update(&mb->id, 0);
		WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
	}
}
Ejemplo n.º 8
0
static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionGroup *agrp)
{
	FCurve *fcu, *fcn;
	
	/* try to remove the F-Curve from the action */
	if (!BLI_remlink_safe(&act->groups, agrp)) {
		BKE_reportf(reports, RPT_ERROR, "ActionGroup '%s' not found in action '%s'", agrp->name, act->id.name+2);
		return;
	}

	/* move every one one of the group's F-Curves out into the Action again */
	for (fcu= agrp->channels.first; (fcu) && (fcu->grp==agrp); fcu=fcn) {
		fcn= fcu->next;
		
		/* remove from group */
		action_groups_remove_channel(act, fcu);
		
		/* tack onto the end */
		BLI_addtail(&act->curves, fcu);
	}
	
	/* XXX, invalidates PyObject */
	MEM_freeN(agrp); 
}
Ejemplo n.º 9
0
void bpy_import_main_extra_remove(struct Main *maggie)
{
	BLI_remlink_safe(&bpy_import_main_list, maggie);
}