Lines Matching refs:layers
41 """A synfig document, with commands for adding layers and layer parameters"""
391 # "value" is a list of layers
406 ### Should be used by outside functions to create layers and set layer parameters
672 # Operations act on a series of layers, and (optionally) on a series of named parameters
673 # The "is_end" attribute should be set to true when the layers are at the end of a canvas
674 # (i.e. when adding transform layers on top of them does not require encapsulation)
676 def op_blur(self, layers, x, y, name="Blur", is_end=False):
677 """Gaussian blur the given layers by the given x and y amounts
680 layers -- list of layers
683 is_end -- set to True if layers are at the end of a canvas
685 Returns: list of layers
693 return layers + [blur]
695 return self.op_encapsulate(layers + [blur])
697 def op_color(self, layers, overlay, is_end=False):
698 """Apply a color overlay to the given layers
703 layers -- list of layers
705 is_end -- set to True if layers are at the end of a canvas
707 Returns: list of layers
709 if layers == []:
710 return layers
712 return layers
716 ret = layers + overlay_enc
723 def op_encapsulate(self, layers, name="Inline Canvas", is_end=False):
724 """Encapsulate the given layers
727 layers -- list of layers
729 is_end -- set to True if layers are at the end of a canvas
734 if layers == []:
735 return layers
737 layer = self.create_layer("PasteCanvas", name, params={"canvas":layers})
740 def op_fade(self, layers, opacity, is_end=False):
741 """Increase the opacity of the given layers by a certain amount
744 layers -- list of layers
747 is_end -- set to True if layers are at the end of a canvas
749 Returns: list of layers
751 # If there is blending involved, first encapsulate the layers
752 for layer in layers:
754 return self.op_fade(self.op_encapsulate(layers), opacity, is_end)
757 for layer in layers:
761 return layers
764 def op_filter(self, layers, filter_id, is_end=False):
765 """Apply a filter to the given layers
768 layers -- list of layers
770 is_end -- set to True if layers are at the end of a canvas
772 Returns: list of layers
778 ret = self.filters[filter_id](self, layers, is_end)
783 return layers
785 def op_set_blend(self, layers, blend_method, is_end=False):
786 """Set the blend method of the given group of layers
791 layers -- list of layers
792 blend_method -- blend method to give the layers
793 is_end -- set to True if layers are at the end of a canvas
795 Returns: list of layers
797 if layers == []:
798 return layers
800 return layers
802 layer = layers[0]
803 if len(layers) > 1 or self.get_param(layers[0], "amount") != 1.0:
804 layer = self.op_encapsulate(layers)[0]
812 def op_transform(self, layers, mtx, name="Transform", is_end=False):
813 """Apply a matrix transformation to the given layers
816 layers -- list of layers
819 is_end -- set to True if layers are at the end of a canvas
821 Returns: list of layers
823 if layers == []:
824 return layers
826 return layers
851 return layers + [warp]
853 return self.op_encapsulate(layers + [warp])
1067 layers = []
1069 layers += self.convert_node(node, d)
1072 for layer in layers:
1078 """Convert an SVG node to a list of Synfig layers"""
1079 # Parse tags that don't draw any layers
1095 layers = []
1098 layers += self.convert_node(subnode, d)
1101 layers = d.op_encapsulate(layers, name=name)
1107 layers += self.convert_node(subnode, d)
1109 layers = self.convert_path(node, d)
1114 layers = d.op_filter(layers, filter_id)
1118 layers = d.op_fade(layers, opacity)
1120 return layers
1183 def the_filter(d, layers, is_end=False):
1184 refs = { None : layers, #default
1185 "SourceGraphic" : layers }
1242 # Output the layers
1258 """Convert an SVG path node to a list of Synfig layers"""
1259 layers = []
1291 layers.append(layer)
1317 layers.append(layer)
1319 return layers
1322 """Return a list Synfig layers that represent the gradient with the given id"""