Implementation of "Blender Action for Software Box"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Phatch |
Fix Released
|
Undecided
|
Stani |
Bug Description
This patch implements https:/
Note that the .blend file provided with the tarball ~must~ be placed into /phatch/
The basic architecture is quite simple. It is split in two main sections: the Phatch related part and the Blender related part. The Phatch related part consists of two files, .py and .blend. The Phatch related part is implemented in blender.py action file by subclassing BlenderAction as follows:
class ProductBoxActio
name = _t('Product Box')
filename = 'box' # this refers to the name of the .blend and .py files provided for Blender in /data/blender! it might make sense to use convention here though so you would get the filename based on name (ie. product_box.py and product_box.blend in this case)
def __init__(self):
Note the way options are defined in __init__. The current implementation uses a model based on which user interface related aspects are generated. Currently there are only two types, ConstrainedFloat and Color, but the system is easy to extend on demand. Please see the implementation of these classes and their parent, Value, for more information. If you add a new type, remember to check out /data/blender/
The Blender related files (/data/
Note that the current implementation doesn't support concept of relevant fields yet. It can be extended to support it by extending the model architecture a bit (ie. Choice class or similar). Also it would be good to implement Options class as an ordered one instead of a regular. The same applies for the Actions class.
Changed in phatch: | |
milestone: | none → 0.2.1 |
status: | Fix Committed → Fix Released |
Hi Juho, OptionParser to parse the values, which Phatch uses? That allows defaults and type conversions. For an example see phatch/app.py
Thanks for your work.
- Could you use the standard lib optparse.
- Please use Fields and don't introduce options. As said before this action should be implemented as the imagemagick action for now. The reason is that in the next release all Imagemagick and Blender actions will be independent actions, next to the pil actions. So I prefer that both Imagemagick and Blender follow the same approach for now.
- I'll look into providing a FloatSliderField. So for now you can use a FloatField or SliderField, as you did now.