Beispiel #1
0
void BKE_linestyle_init(FreestyleLineStyle *linestyle)
{
	BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(linestyle, id));

	linestyle->panel = LS_PANEL_STROKES;
	linestyle->r = linestyle->g = linestyle->b = 0.0f;
	linestyle->alpha = 1.0f;
	linestyle->thickness = 3.0f;
	linestyle->thickness_position = LS_THICKNESS_CENTER;
	linestyle->thickness_ratio = 0.5f;
	linestyle->flag = LS_SAME_OBJECT | LS_NO_SORTING | LS_TEXTURE;
	linestyle->chaining = LS_CHAINING_PLAIN;
	linestyle->rounds = 3;
	linestyle->min_angle = DEG2RADF(0.0f);
	linestyle->max_angle = DEG2RADF(0.0f);
	linestyle->min_length = 0.0f;
	linestyle->max_length = 10000.0f;
	linestyle->split_length = 100;
	linestyle->chain_count = 10;
	linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
	linestyle->integration_type = LS_INTEGRATION_MEAN;
	linestyle->texstep = 1.0f;
	linestyle->pr_texture = TEX_PR_TEXTURE;

	BLI_listbase_clear(&linestyle->color_modifiers);
	BLI_listbase_clear(&linestyle->alpha_modifiers);
	BLI_listbase_clear(&linestyle->thickness_modifiers);
	BLI_listbase_clear(&linestyle->geometry_modifiers);

	BKE_linestyle_geometry_modifier_add(linestyle, NULL, LS_MODIFIER_SAMPLING);

	linestyle->caps = LS_CAPS_BUTT;
}
Beispiel #2
0
void BKE_mball_init(MetaBall *mb)
{
	BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(mb, id));

	mb->size[0] = mb->size[1] = mb->size[2] = 1.0;
	mb->texflag = MB_AUTOSPACE;
	
	mb->wiresize = 0.4f;
	mb->rendersize = 0.2f;
	mb->thresh = 0.6f;
}
Beispiel #3
0
void BKE_lattice_init(Lattice *lt)
{
	BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(lt, id));

	lt->flag = LT_GRID;
	
	lt->typeu = lt->typev = lt->typew = KEY_BSPLINE;
	
	lt->def = MEM_callocN(sizeof(BPoint), "lattvert"); /* temporary */
	BKE_lattice_resize(lt, 2, 2, 2, NULL);  /* creates a uniform lattice */
	lt->actbp = LT_ACTBP_NONE;
}
Beispiel #4
0
void BKE_brush_init(Brush *brush)
{
	BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(brush, id));

	/* enable fake user by default */
	id_fake_user_set(&brush->id);

	brush_defaults(brush);

	brush->sculpt_tool = SCULPT_TOOL_DRAW; /* sculpting defaults to the draw tool for new brushes */

	/* the default alpha falloff curve */
	BKE_brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
}
Beispiel #5
0
void BKE_lamp_init(Lamp *la)
{
	BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(la, id));

	la->r = la->g = la->b = la->k = 1.0f;
	la->haint = la->energy = 1.0f;
	la->dist = 25.0f;
	la->spotsize = DEG2RADF(45.0f);
	la->spotblend = 0.15f;
	la->att2 = 1.0f;
	la->mode = LA_SHAD_BUF;
	la->bufsize = 512;
	la->clipsta = 0.5f;
	la->clipend = 40.0f;
	la->samp = 3;
	la->bias = 1.0f;
	la->soft = 3.0f;
	la->compressthresh = 0.05f;
	la->ray_samp = la->ray_sampy = la->ray_sampz = 1;
	la->area_size = la->area_sizey = la->area_sizez = 0.1f;
	la->buffers = 1;
	la->buftype = LA_SHADBUF_HALFWAY;
	la->ray_samp_method = LA_SAMP_HALTON;
	la->adapt_thresh = 0.001f;
	la->preview = NULL;
	la->falloff_type = LA_FALLOFF_INVSQUARE;
	la->coeff_const = 1.0f;
	la->coeff_lin = 0.0f;
	la->coeff_quad = 0.0f;
	la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
	la->sun_effect_type = 0;
	la->horizon_brightness = 1.0;
	la->spread = 1.0;
	la->sun_brightness = 1.0;
	la->sun_size = 1.0;
	la->backscattered_light = 1.0f;
	la->atm_turbidity = 2.0f;
	la->atm_inscattering_factor = 1.0f;
	la->atm_extinction_factor = 1.0f;
	la->atm_distance_factor = 1.0f;
	la->sun_intensity = 1.0f;
	la->skyblendtype = MA_RAMP_ADD;
	la->skyblendfac = 1.0f;
	la->sky_colorspace = BLI_XYZ_CIE;
	la->sky_exposure = 1.0f;
	la->shadow_frustum_size = 10.0f;
	
	curvemapping_initialize(la->curfalloff);
}
Beispiel #6
0
void BKE_camera_init(Camera *cam)
{
	BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(cam, id));

	cam->lens = 35.0f;
	cam->sensor_x = DEFAULT_SENSOR_WIDTH;
	cam->sensor_y = DEFAULT_SENSOR_HEIGHT;
	cam->clipsta = 0.1f;
	cam->clipend = 100.0f;
	cam->drawsize = 0.5f;
	cam->ortho_scale = 6.0;
	cam->flag |= CAM_SHOWPASSEPARTOUT;
	cam->passepartalpha = 0.5f;

	GPU_fx_compositor_init_dof_settings(&cam->gpu_dof);

	/* stereoscopy 3d */
	cam->stereo.interocular_distance = 0.065f;
	cam->stereo.convergence_distance = 30.f * 0.065f;
	cam->stereo.pole_merge_angle_from = DEG2RADF(60.0f);
	cam->stereo.pole_merge_angle_to = DEG2RADF(75.0f);
}