Ejemplo n.º 1
0
void curvemapping_free(CurveMapping *cumap)
{
	if (cumap) {
		curvemapping_free_data(cumap);
		MEM_freeN(cumap);
	}
}
Ejemplo n.º 2
0
static void hue_correct_free_data(SequenceModifierData *smd)
{
	HueCorrectModifierData *hcmd = (HueCorrectModifierData *) smd;

	curvemapping_free_data(&hcmd->curve_mapping);
}
Ejemplo n.º 3
0
static void curves_free_data(SequenceModifierData *smd)
{
	CurvesModifierData *cmd = (CurvesModifierData *) smd;

	curvemapping_free_data(&cmd->curve_mapping);
}
Ejemplo n.º 4
0
bool RE_bake_engine(
        Render *re, Object *object,
        const int object_id, const BakePixel pixel_array[],
        const size_t num_pixels, const int depth,
        const ScenePassType pass_type, float result[])
{
	RenderEngineType *type = RE_engines_find(re->r.engine);
	RenderEngine *engine;
	bool persistent_data = (re->r.mode & R_PERSISTENT_DATA) != 0;

	/* set render info */
	re->i.cfra = re->scene->r.cfra;
	BLI_strncpy(re->i.scene_name, re->scene->id.name + 2, sizeof(re->i.scene_name) - 2);
	re->i.totface = re->i.totvert = re->i.totstrand = re->i.totlamp = re->i.tothalo = 0;

	/* render */
	engine = re->engine;

	if (!engine) {
		engine = RE_engine_create(type);
		re->engine = engine;
	}

	engine->flag |= RE_ENGINE_RENDERING;

	/* TODO: actually link to a parent which shouldn't happen */
	engine->re = re;

	engine->resolution_x = re->winx;
	engine->resolution_y = re->winy;

	RE_parts_init(re, false);
	engine->tile_x = re->r.tilex;
	engine->tile_y = re->r.tiley;

	/* update is only called so we create the engine.session */
	if (type->update)
		type->update(engine, re->main, re->scene);

	if (type->bake)
		type->bake(engine, re->scene, object, pass_type, object_id, pixel_array, num_pixels, depth, result);

	engine->tile_x = 0;
	engine->tile_y = 0;
	engine->flag &= ~RE_ENGINE_RENDERING;

	BLI_rw_mutex_lock(&re->partsmutex, THREAD_LOCK_WRITE);

	curvemapping_free_data(&re->r.mblur_shutter_curve);

	/* re->engine becomes zero if user changed active render engine during render */
	if (!persistent_data || !re->engine) {
		RE_engine_free(engine);
		re->engine = NULL;
	}

	RE_parts_free(re);
	BLI_rw_mutex_unlock(&re->partsmutex);

	if (BKE_reports_contain(re->reports, RPT_ERROR))
		G.is_break = true;

	return true;
}