[Bf-taskforce25] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19463] branches/blender2.5/blender/source /blender: 2.5

Ton Roosendaal ton at blender.org
Mon Mar 30 14:26:37 CEST 2009


Hi Michael,

You're running a bit ahead of the planning, but that's actually because  
I'm behind too. :) It's welcome to have a couple of extra panels  
wrapped in the layout engine test. But it's not the purpose to do more,  
the current layout code is a placeholder and for test only. Real  
layouts for buttons will go via a different route.

Thanks,

-Ton-

------------------------------------------------------------------------
Ton Roosendaal  Blender Foundation   ton at blender.org    www.blender.org
Blender Institute BV  Entrepotdok 57A  1018AD Amsterdam The Netherlands

On 30 Mar, 2009, at 10:17, Michael Fox wrote:

> Revision: 19463
>            
> http://projects.blender.org/plugins/scmsvn/viewcvs.php? 
> view=rev&root=bf-blender&revision=19463
> Author:   mfoxdogg
> Date:     2009-03-30 10:17:43 +0200 (Mon, 30 Mar 2009)
>
> Log Message:
> -----------
>   2.5
> *******
> ported some of the scene buttons to the new system
> 	- added RNA_SceneRenderData struct to rna
> 	- added a warning print to uiItemR when it can't find the property
> 	- what is not there is due to relating entry not being in RNA
> 	- anim button does not work
>
> Im commiting this so we have much more wider test area then text and  
> object buttons
>
> Modified Paths:
> --------------
>      
> branches/blender2.5/blender/source/blender/editors/interface/ 
> interface_layout.c
>      
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> buttons_intern.h
>      
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> buttons_scene.c
>      
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> space_buttons.c
>     branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
>
> Modified:  
> branches/blender2.5/blender/source/blender/editors/interface/ 
> interface_layout.c
> ===================================================================
> ---  
> branches/blender2.5/blender/source/blender/editors/interface/ 
> interface_layout.c	2009-03-30 07:28:37 UTC (rev 19462)
> +++  
> branches/blender2.5/blender/source/blender/editors/interface/ 
> interface_layout.c	2009-03-30 08:17:43 UTC (rev 19463)
> @@ -526,8 +526,10 @@
>  	uiItemRNA *rnaitem;
>  	
>  	prop= RNA_struct_find_property(ptr, propname);
> -	if(!prop)
> +	if(!prop){
> +		printf("Property not found : %s \n",propname);
>  		return;
> +	}
>  	
>  	rnaitem= MEM_callocN(sizeof(uiItemRNA), "uiItemRNA");
>
>
> Modified:  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> buttons_intern.h
> ===================================================================
> ---  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> buttons_intern.h	2009-03-30 07:28:37 UTC (rev 19462)
> +++  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> buttons_intern.h	2009-03-30 08:17:43 UTC (rev 19463)
> @@ -78,7 +78,7 @@
>
>  /* image_header.c */
>  void buttons_header_buttons(const struct bContext *C, struct ARegion  
> *ar);
> -void buttons_scene(const struct bContext *C, struct ARegion *ar);
> +void buttons_scene_register(struct ARegionType *art);
>  void buttons_object_register(struct ARegionType *art);
>
>  #endif /* ED_BUTTONS_INTERN_H */
>
> Modified:  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> buttons_scene.c
> ===================================================================
> ---  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> buttons_scene.c	2009-03-30 07:28:37 UTC (rev 19462)
> +++  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> buttons_scene.c	2009-03-30 08:17:43 UTC (rev 19463)
> @@ -29,14 +29,18 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>
> +#include "MEM_guardedalloc.h"
> +
>  #include "DNA_space_types.h"
>  #include "DNA_scene_types.h"
>  #include "DNA_screen_types.h"
>
>  #include "BLI_threads.h"
> +#include "BLI_listbase.h"
>
>  #include "BKE_context.h"
>  #include "BKE_global.h"
> +#include "BKE_screen.h"
>
>  #include "RE_pipeline.h"
>
> @@ -47,6 +51,7 @@
>  #include "UI_resources.h"
>
>  #include "WM_types.h"
> +#include "WM_api.h"
>
>  #include "buttons_intern.h"
>
> @@ -206,13 +211,124 @@
>
>  	uiEndBlock(C, block);
>  }
> +static void render_panel_shading(const bContext *C, Panel *pnl)
> +{
> +	uiLayout *layout= pnl->layout;
> +	Scene *scene= CTX_data_scene(C);
> +	PointerRNA sceneptr, renderptr;
>
> -static void render_panel_render(const bContext *C, ARegion *ar)
> +	RNA_id_pointer_create(&scene->id, &sceneptr);
> +	renderptr = RNA_pointer_get(&sceneptr, "render_data");
> +		
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Shadow", 0, &renderptr,  
> "render_shadows");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, "SSS", 0, &renderptr,  
> "render_sss");
> +	uiItemR(layout, UI_TSLOT_COLUMN_3, "EnvMap", 0, &renderptr,  
> "render_envmaps");
> +	uiItemR(layout, UI_TSLOT_COLUMN_4, "Radio", 0, &renderptr,  
> "render_radiosity");
> +	
> +	uiTemplateColumn(layout);
> +	uiItemLabel(layout, UI_TSLOT_COLUMN_1, "Ray Tracing:", 0);
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Enable", 0, &renderptr,  
> "render_raytracing");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, NULL, 0, &renderptr,  
> "octree_resolution");
> +	
> +	uiTemplateColumn(layout);
> +	uiItemLabel(layout, UI_TSLOT_COLUMN_1, "Alpha:", 0);
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, NULL, 0, &renderptr,  
> "alpha_mode");
> +	
> +}
> +static void render_panel_image(const bContext *C, Panel *pnl)
>  {
> -	uiBlock *block;
> +	uiLayout *layout= pnl->layout;
>  	Scene *scene= CTX_data_scene(C);
> -	char str[256];
> +	PointerRNA sceneptr, renderptr;
>
> +	RNA_id_pointer_create(&scene->id, &sceneptr);
> +	renderptr = RNA_pointer_get(&sceneptr, "render_data");
> +	
> +	uiTemplateColumn(layout);	
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "SizeX", 0, &renderptr,  
> "resolution_x");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, "SizeY", 0, &renderptr,  
> "resolution_y");
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "AspX", 0, &renderptr,  
> "pixel_aspect_x");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, "AspY", 0, &renderptr,  
> "pixel_aspect_y");
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, NULL, 0, &renderptr,  
> "crop_to_border");
> +
> +}
> +static void render_panel_antialiasing(const bContext *C, Panel *pnl)
> +{
> +	uiLayout *layout= pnl->layout;
> +	Scene *scene= CTX_data_scene(C);
> +	PointerRNA sceneptr, renderptr;
> +
> +	RNA_id_pointer_create(&scene->id, &sceneptr);
> +	renderptr = RNA_pointer_get(&sceneptr, "render_data");
> +	
> +	uiTemplateColumn(layout);	
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Enable", 0, &renderptr,  
> "antialiasing");
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Num Samples", 0, &renderptr,  
> "antialiasing_samples");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, NULL, 0, &renderptr,  
> "pixel_filter");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, NULL, 0, &renderptr,  
> "filter_size");
> +	
> +}
> +
> +static void render_panel_render(const bContext *C, Panel *pnl)
> +{
> +	uiLayout *layout= pnl->layout;
> +	Scene *scene= CTX_data_scene(C);
> +	PointerRNA sceneptr, renderptr, animptr;
> +
> +	RNA_id_pointer_create(&scene->id, &sceneptr);
> +	renderptr = RNA_pointer_get(&sceneptr, "render_data");
> +	WM_operator_properties_create(&animptr, "SCREEN_OT_render");
> +
> +	uiTemplateColumn(layout);
> +	uiItemO(layout, UI_TSLOT_COLUMN_1, "RENDER", ICON_SCENE,  
> "SCREEN_OT_render");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, "ANIM", 0, &animptr, "anim");
> +
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Sfra", 0, &sceneptr,  
> "start_frame");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, "Cfra", 0, &sceneptr,  
> "current_frame");
> +	uiItemR(layout, UI_TSLOT_COLUMN_3, "Efra", 0, &sceneptr,  
> "end_frame");
> +
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, NULL, 0, &renderptr,  
> "do_composite");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, NULL, 0, &renderptr,  
> "do_sequence");
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Camera:", 0, &sceneptr,  
> "camera");
> +	
> +	uiTemplateColumn(layout);
> +	uiItemLabel(layout, UI_TSLOT_COLUMN_1, "General:", 0);
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Size ", 0, &renderptr,  
> "resolution_percentage");
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, NULL, 0, &renderptr,  
> "dither_intensity");
> +	
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, NULL, 0, &renderptr, "parts_x");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, NULL, 0, &renderptr, "parts_y");
> +	
> +	uiTemplateColumn(layout);
> +	uiItemLabel(layout, UI_TSLOT_COLUMN_1, "Multi-Threading:", 0);
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, NULL, 0, &renderptr,  
> "threads_mode");
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, NULL, 0, &renderptr, "threads");
> +	
> +	uiTemplateColumn(layout);
> +	uiItemLabel(layout, UI_TSLOT_COLUMN_1, "Fields:", 0);
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Enable", 0, &renderptr,  
> "fields");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, NULL, 0, &renderptr,  
> "field_order");
> +	uiItemR(layout, UI_TSLOT_COLUMN_3, NULL, 0, &renderptr,  
> "fields_still");
> +	
> +	uiTemplateColumn(layout);
> +	uiItemLabel(layout, UI_TSLOT_COLUMN_1, "Extra:", 0);
> +	uiTemplateColumn(layout);
> +	uiItemR(layout, UI_TSLOT_COLUMN_1, "Border Render", 0, &renderptr,  
> "border");
> +	uiItemR(layout, UI_TSLOT_COLUMN_2, NULL, 0, &renderptr, "panorama");
> +
> +
> +#if 0
>  	block= uiBeginBlock(C, ar, "render_panel_render", UI_EMBOSS,  
> UI_HELV);
>  	if(uiNewPanel(C, ar, block, "Render", "Render", 320, 0, 318,  
> 204)==0) return;
>
> @@ -284,6 +400,7 @@
>  	uiBlockEndAlign(block);
>
>  	uiEndBlock(C, block);
> +#endif
>  }
>
>
> @@ -318,16 +435,40 @@
>  	uiEndBlock(C, block);
>  }
>
> -void buttons_scene(const bContext *C, ARegion *ar)
> +void buttons_scene_register(ARegionType *art)
>  {
> -	SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C);
> -	int tab= sbuts->tab[CONTEXT_SCENE];
> +	PanelType *pt;
>
> -	if(tab == TAB_SCENE_RENDER) {
> -		render_panel_output(C, ar);
> -		render_panel_render(C, ar);
> -		render_panel_anim(C, ar);
> -		render_panel_bake(C, ar);
> -	}
> +	/* panels: Render */
> +	pt= MEM_callocN(sizeof(PanelType), "spacetype buttons panel");
> +	pt->idname= "RENDER_PT_render";
> +	pt->name= "Render";
> +	pt->context= "render";
> +	pt->draw= render_panel_render;
> +	BLI_addtail(&art->paneltypes, pt);
> +	
> +	/* panels: Shading */
> +	pt= MEM_callocN(sizeof(PanelType), "spacetype buttons panel");
> +	pt->idname= "RENDER_PT_image";
> +	pt->name= "Image";
> +	pt->context= "render";
> +	pt->draw= render_panel_image;
> +	BLI_addtail(&art->paneltypes, pt);
> +		
> +	/* panels: AntiAliasing */
> +	pt= MEM_callocN(sizeof(PanelType), "spacetype buttons panel");
> +	pt->idname= "RENDER_PT_antialias";
> +	pt->name= "AntiAliasing";
> +	pt->context= "render";
> +	pt->draw= render_panel_antialiasing;
> +	BLI_addtail(&art->paneltypes, pt);
> +
> +	/* panels: Shading */
> +	pt= MEM_callocN(sizeof(PanelType), "spacetype buttons panel");
> +	pt->idname= "RENDER_PT_shading";
> +	pt->name= "Shading";
> +	pt->context= "render";
> +	pt->draw= render_panel_shading;
> +	BLI_addtail(&art->paneltypes, pt);
>  }
>
>
> Modified:  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> space_buttons.c
> ===================================================================
> ---  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> space_buttons.c	2009-03-30 07:28:37 UTC (rev 19462)
> +++  
> branches/blender2.5/blender/source/blender/editors/space_buttons/ 
> space_buttons.c	2009-03-30 08:17:43 UTC (rev 19463)
> @@ -166,6 +166,13 @@
>  		if(tab == TAB_OBJECT_OBJECT)
>  			uiRegionPanelLayout(C, ar, vertical, "object");
>  	}
> +	else if (sbuts->mainb == CONTEXT_SCENE){
> +		int tab= sbuts->tab[CONTEXT_SCENE];
> +		int vertical= (sbuts->align == 2);
> +
> +		if(tab == TAB_SCENE_RENDER)
> +			uiRegionPanelLayout(C, ar, vertical, "render");
> +	}	
>  	else {
>  		View2D *v2d= &ar->v2d;
>  		float col[3], fac;
> @@ -184,10 +191,7 @@
>  		glRecti(20, v2d->cur.ymin+2,  30, v2d->cur.ymin+12);
>  		
>  		/* panels */
> -		if(sbuts->mainb == CONTEXT_SCENE)
> -			buttons_scene(C, ar);
> -		else
> -			drawnewstuff();
> +		drawnewstuff();
>  		
>  #if 0
>  		if(sbuts->align)
> @@ -282,6 +286,7 @@
>  	art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES;
>
>  	buttons_object_register(art);
> +	buttons_scene_register(art);
>
>  	BLI_addhead(&st->regiontypes, art);
>  	
>
> Modified:  
> branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
> ===================================================================
> ---  
> branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009 
> -03-30 07:28:37 UTC (rev 19462)
> +++  
> branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009 
> -03-30 08:17:43 UTC (rev 19463)
> @@ -202,6 +202,7 @@
>
> @@ Diff output truncated at 10240 characters. @@
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>



More information about the Bf-taskforce25 mailing list