[Bf-taskforce25] data api proposal

André Pinto andresusanopinto at gmail.com
Mon Sep 29 20:51:50 CEST 2008


Well this mail is just some random thoughts, they might not be very
important or even useful as I still don't have enough insight on blender
code and previous problems.


===Random thoughts about UI===
- Having a function like set(..) to verify if the value is inside the valid
values isnt very usefull to the UI, as we may need to show what are the
min/max values possible.
Thats probably the reason why Brecht added min/max values.
But such a solution will add incoherence between the UI and code.. because
UI might show possible values are [-100,100].. but the code inside set
function  will for example have a limit like: [-(min Z of BB),  (max Z of
BB)].

As so I consider that if we need to callbacks todo data validation... we
also need a better mode(callbacks also?) to determine the min/max values
allowed on UI.


- ""Do we need nested property groups?""
If this is needed can we still use simple properties like:
"render.raytrace.max_ray_depth"?

- Also to kept the things cleaner and separated I suggest UI hints are
joined together on a nested struct inside PropertyDef.
struct PropUIHints
{

	const char *name; 	 /* user readable name */
	const char *description; /* single line description, displayed in the
tooltip for example */
	const char *group;	/* group in struct this belongs to (mostly for ui/docs) */


	int icon;		/* icon identifier */
	....
};


===Access to properties===
It would be useful to access char/int/long masks like different properties:
(at least on python this would be a must-have)
obj.renderable = true
obj.visible = true

This would make it easier to read and maintain,
and also create a good layer to separate UI from data internals.


===Some other questions/ideas===
Are callbacks like notify, set, unset, supposed to change on runtime?
Is there any real advantage if that is true?
Is this data only going to be used before the compile time to auto-generate
code?

If callbacks don't change at runtime then clever code with defines can
replace most of the get/set with direct code.

Since DataAPI will have a deep knowledge on the data structures used on
blender.. I guess it will also be used to generate the sdna data.
As so an useful thing to do could be a "don't save" property to avoid having
some data saved to files. (like caches, or other variables that might only
make sense at runtime).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-taskforce25/attachments/20080929/8e28559c/attachment.htm 


More information about the Bf-taskforce25 mailing list