8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita KitaevSynfig file format utilities
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita KitaevCopyright (C) 2011 Nikita Kitaev
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita KitaevThis program is free software; you can redistribute it and/or modify
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevit under the terms of the GNU General Public License as published by
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevthe Free Software Foundation; either version 2 of the License, or
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev(at your option) any later version.
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita KitaevThis program is distributed in the hope that it will be useful,
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevbut WITHOUT ANY WARRANTY; without even the implied warranty of
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita KitaevMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita KitaevGNU General Public License for more details.
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita KitaevYou should have received a copy of the GNU General Public License
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevalong with this program; if not, write to the Free Software
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita KitaevFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev###### Constants ##########################################
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevkux = 60.0 # Number of SVG units (pixels) per Synfig "unit"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevtangent_scale = 3.0 # Synfig tangents are scaled by a factor of 3
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev###### Layer parameters, types, and default values ########
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev# Layer_Composite is the parent of most layers
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevlayers["PasteCanvas"] = default_composite.copy()
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev## Layers in mod_geometry
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev## Layers in mod_gradient
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevlayers["linear_gradient"] = default_composite.copy()
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev "gradient": ["gradient", {0.0:[0,0,0,1], 1.0:[1,1,1,1]} ],
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevlayers["radial_gradient"] = default_composite.copy()
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev "gradient": ["gradient", {0.0:[0,0,0,1], 1.0:[1,1,1,1]} ],
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev## Layers in lyr_std
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev "filename": ["string", ""], # <string>foo</string>
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev# transforms are not blending
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev## Layers in mod_filter
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev "type": ["integer", 3] # 1 is fast gaussian, 3 is regular
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev###### Layer versions #####################################
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev###### Blend Methods ######################################
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaevblend_methods = dict((v, k) for (k, v) in blend_method_names.iteritems())
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev###### Functions ##########################################
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev raise Exception, "Invalid parameter type for layer"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev # Unknown layer, try to determine parameter type based on value
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev raise Exception, "No information for given layer"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "integer"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "real"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "bool"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "bline"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "gradient"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev raise Exception, "Could not automatically determine parameter type"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "vector"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "color"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev # The first two could also be canvases
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "canvas"
8fe37a993fbb0c0a84a7ab4a77cd83c87162c2daNikita Kitaev return "string"