[Bf-blender-cvs] [7064313] viewport_experiments: More naming tidying up

Antony Riakiotakis noreply at git.blender.org
Thu Feb 12 16:40:26 CET 2015


Commit: 7064313ec645fdb85492c328d0ee2e6213b2a5e5
Author: Antony Riakiotakis
Date:   Thu Feb 12 15:38:27 2015 +0100
Branches: viewport_experiments
https://developer.blender.org/rB7064313ec645fdb85492c328d0ee2e6213b2a5e5

More naming tidying up

===================================================================

M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blenkernel/intern/camera.c
M	source/blender/blenkernel/intern/screen.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/render/render_opengl.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/gpu/intern/gpu_compositing.c
M	source/blender/makesdna/DNA_gpu_types.h
M	source/blender/makesdna/DNA_view3d_types.h
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 891278c..d61ab8f 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2934,14 +2934,14 @@ class VIEW3D_PT_view3d_shading(Panel):
             if obj and obj.mode == 'EDIT':
                 col.prop(view, "show_occlude_wire")
 
-            fxoptions = view.fxoptions
+            fx_options = view.fx_options
 
             col.prop(view, "depth_of_field")
             if view.depth_of_field:
                 if (view.region_3d.view_perspective == 'CAMERA'):
                     col.label("check dof properties in camera settings", icon='INFO')
                 else:
-                    dof_options = fxoptions.dof_options
+                    dof_options = fx_options.dof_options
                     subcol = col.column(align=True)
                     subcol.prop(dof_options, "focus_distance")
                     subcol.prop(dof_options, "fstop")
@@ -2950,7 +2950,7 @@ class VIEW3D_PT_view3d_shading(Panel):
 
             col.prop(view, "ssao")
             if view.ssao:
-                ssao_options = fxoptions.ssao_options
+                ssao_options = fx_options.ssao_options
                 subcol = col.column(align=True)
                 subcol.prop(ssao_options, "darkening")
                 subcol.prop(ssao_options, "distance_max")
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index b1ea339..572eab4 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -695,14 +695,15 @@ void BKE_GPU_dof_from_camera(struct Object *camera, struct GPUFXOptions *options
 {
 	if (camera->type == OB_CAMERA) {
 		Camera *cam = camera->data;
-		options->dof_options = &cam->gpu_dof;
+		options->dof = &cam->gpu_dof;
+		options->dof->focal_length = cam->lens;
 		if (cam->dof_ob) {
 			float vec[3];
 			sub_v3_v3v3(vec, cam->dof_ob->obmat[3], camera->obmat[3]);
-			options->dof_options->focus_distance = len_v3(vec);
+			options->dof->focus_distance = len_v3(vec);
 		}
 		else {
-			options->dof_options->focus_distance = cam->YF_dofdist;
+			options->dof->focus_distance = cam->YF_dofdist;
 		}
 	}
 }
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index efc50a1..d891818 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -601,19 +601,19 @@ float BKE_screen_view3d_zoom_from_fac(float zoomfac)
 
 void BKE_screen_view3d_ensure_FX(View3D *v3d)
 {
-	if (!v3d->fxoptions.dof_options || !v3d->fxoptions.ssao_options) {
-		v3d->fxoptions.dof_options = MEM_callocN(sizeof(GPUDOFOptions), "view3d dof options");
+	if (!v3d->fx_options.dof || !v3d->fx_options.ssao) {
+		v3d->fx_options.dof = MEM_callocN(sizeof(GPUDOFOptions), "view3d dof options");
 
-		v3d->fxoptions.dof_options->fstop = 128.0f;
-		v3d->fxoptions.dof_options->focal_length = 1.0f;
-		v3d->fxoptions.dof_options->focus_distance = 1.0f;
-		v3d->fxoptions.dof_options->sensor = 1.0f;
+		v3d->fx_options.dof->fstop = 128.0f;
+		v3d->fx_options.dof->focal_length = 1.0f;
+		v3d->fx_options.dof->focus_distance = 1.0f;
+		v3d->fx_options.dof->sensor = 1.0f;
 
-		v3d->fxoptions.ssao_options = MEM_callocN(sizeof(GPUSSAOOptions), "view3d ssao options");
+		v3d->fx_options.ssao = MEM_callocN(sizeof(GPUSSAOOptions), "view3d ssao options");
 
-		v3d->fxoptions.ssao_options->darkening = 1.0f;
-		v3d->fxoptions.ssao_options->distance_max = 0.2f;
-		v3d->fxoptions.ssao_options->attenuation = 1.0f;
-		v3d->fxoptions.ssao_options->num_samples = 4;
+		v3d->fx_options.ssao->darkening = 1.0f;
+		v3d->fx_options.ssao->distance_max = 0.2f;
+		v3d->fx_options.ssao->attenuation = 1.0f;
+		v3d->fx_options.ssao->num_samples = 4;
 	}
 }
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index daeba25..e8cc7d4 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6561,10 +6561,10 @@ static bool direct_link_screen(FileData *fd, bScreen *sc)
 				if (v3d->drawtype == OB_RENDER)
 					v3d->drawtype = OB_SOLID;
 
-				if (v3d->fxoptions.dof_options)
-					v3d->fxoptions.dof_options = newdataadr(fd, v3d->fxoptions.dof_options);
-				if (v3d->fxoptions.ssao_options)
-					v3d->fxoptions.ssao_options = newdataadr(fd, v3d->fxoptions.ssao_options);
+				if (v3d->fx_options.dof)
+					v3d->fx_options.dof = newdataadr(fd, v3d->fx_options.dof);
+				if (v3d->fx_options.ssao)
+					v3d->fx_options.ssao = newdataadr(fd, v3d->fx_options.ssao);
 				
 				blo_do_versions_view3d_split_250(v3d, &sl->regionbase);
 			}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 11e10ba..9d0e9c0 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2650,10 +2650,10 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
 						writestruct(wd, DATA, "BGpic", 1, bgpic);
 					if (v3d->localvd) writestruct(wd, DATA, "View3D", 1, v3d->localvd);
 
-					if (v3d->fxoptions.dof_options)
-						writestruct(wd, DATA, "GPUDOFOptions", 1, v3d->fxoptions.dof_options);
-					if (v3d->fxoptions.ssao_options)
-						writestruct(wd, DATA, "GPUSSAOOptions", 1, v3d->fxoptions.ssao_options);
+					if (v3d->fx_options.dof)
+						writestruct(wd, DATA, "GPUDOFOptions", 1, v3d->fx_options.dof);
+					if (v3d->fx_options.ssao)
+						writestruct(wd, DATA, "GPUSSAOOptions", 1, v3d->fx_options.ssao);
 				}
 				else if (sl->spacetype==SPACE_IPO) {
 					SpaceIpo *sipo= (SpaceIpo *)sl;
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index a0851f5..e2c56fe 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -214,7 +214,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
 		/* full copy */
 		GPUFXOptions options = {0};
 
-		options = v3d->fxoptions;
+		options = v3d->fx_options;
 
 		ED_view3d_draw_offscreen_init(scene, v3d);
 
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 3f5d8d4..8375f6f 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -420,10 +420,10 @@ static void view3d_free(SpaceLink *sl)
 		MEM_freeN(vd->defmaterial);
 	}
 
-		if (vd->fxoptions.ssao_options)
-			MEM_freeN(vd->fxoptions.ssao_options);
-		if (vd->fxoptions.dof_options)
-			MEM_freeN(vd->fxoptions.dof_options);
+		if (vd->fx_options.ssao)
+			MEM_freeN(vd->fx_options.ssao);
+		if (vd->fx_options.dof)
+			MEM_freeN(vd->fx_options.dof);
 }
 
 
@@ -465,10 +465,10 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
 	}
 
 	v3dn->properties_storage = NULL;
-	if (v3dn->fxoptions.dof_options)
-		v3dn->fxoptions.dof_options = MEM_dupallocN(v3do->fxoptions.dof_options);
-	if (v3dn->fxoptions.ssao_options)
-		v3dn->fxoptions.ssao_options = MEM_dupallocN(v3do->fxoptions.ssao_options);
+	if (v3dn->fx_options.dof)
+		v3dn->fx_options.dof = MEM_dupallocN(v3do->fx_options.dof);
+	if (v3dn->fx_options.ssao)
+		v3dn->fx_options.ssao = MEM_dupallocN(v3do->fx_options.ssao);
 
 	return (SpaceLink *)v3dn;
 }
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index f17d39b..f497078 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3507,7 +3507,7 @@ static void view3d_main_area_draw_objects(const bContext *C, Scene *scene, View3
 	if (v3d->shader_fx) {
 		GPUFXOptions options;
 		BKE_screen_view3d_ensure_FX(v3d);
-		options = v3d->fxoptions;
+		options = v3d->fx_options;
 		if (!rv3d->compositor)
 			rv3d->compositor = GPU_create_fx_compositor();
 		
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 63a9273..3ac751d 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -267,10 +267,10 @@ bool GPU_initialize_fx_passes(GPUFX *fx, rcti *rect, rcti *scissor_rect, eGPUFXF
 	}
 
 	/* disable effects if no options passed for them */
-	if (!options->dof_options) {
+	if (!options->dof) {
 		fxflags &= ~GPU_FX_DEPTH_OF_FIELD;
 	}
-	if (!options->ssao_options || options->ssao_options->num_samples < 1) {
+	if (!options->ssao || options->ssao->num_samples < 1) {
 		fxflags &= ~GPU_FX_SSAO;
 	}
 
@@ -315,17 +315,17 @@ bool GPU_initialize_fx_passes(GPUFX *fx, rcti *rect, rcti *scissor_rect, eGPUFXF
 	}
 	
 	if (fxflags & GPU_FX_SSAO) {
-		if (options->ssao_options->num_samples != fx->ssao_sample_count || !fx->ssao_concentric_samples_tex) {
-			if (options->ssao_options->num_samples < 1)
-				options->ssao_options->num_samples = 1;
+		if (options->ssao->num_samples != fx->ssao_sample_count || !fx->ssao_concentric_samples_tex) {
+			if (options->ssao->num_samples < 1)
+				options->ssao->num_samples = 1;
 			
-			fx->ssao_sample_count = options->ssao_options->num_samples;
+			fx->ssao_sample_count = options->ssao->num_samples;
 			
 			if (fx->ssao_concentric_samples_tex) {
 				GPU_texture_free(fx->ssao_concentric_samples_tex);
 			}
 			
-			fx->ssao_concentric_samples_tex = create_concentric_sample_texture(options->ssao_options->num_samples);
+			fx->ssao_concentric_samples_tex = create_concentric_sample_texture(options->ssao->num_samples);
 		}
 	}
 	else {
@@ -506,7 +506,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
 		GPUShader *ssao_shader;
 		ssao_shader = GPU_shader_get_builtin_fx_shader(GPU_SHADER_FX_SSAO, is_persp);
 		if (ssao_shader) {
-			GPUSSAOOptions *options = fx->options.ssao_options;
+			GPUSSAOOptions *options = fx->options.ssao;
 			int color_uniform, depth_uniform;
 			int ssao_uniform, ssao_color_uniform, viewvecs_uniform, ssao_sample_params_uniform;
 			int ssao_jitter_uniform, ssao_concentric_tex;
@@ -578,7 +578,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float pr

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list