fanim_timeline.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:gimp-fanim 作者: douglasvini 项目源码 文件源码
def on_add(self,widget,copy=False):
        """
        Add new layer to the image and a new frame to the Timeline.
        if copy is true them the current layer will be copy.
        """
        # starting gimp undo group
        self.image.undo_group_start()

        name = "Frame " + str(len(self.frames))
        # create the layer to add
        l = None
        if not copy:
            l = gimp.Layer(self.image,name, self.image.width,self.image.height,RGBA_IMAGE,100,NORMAL_MODE)

        else: # copy current layer to add
            l = self.frames[self.active].layer.copy()
            l.name = name

        # adding layer
        self.image.add_layer(l,self.active+1)
        if self.new_layer_type == TRANSPARENT_FILL and not copy:
            pdb.gimp_edit_clear(l)

        self._scan_image_layers()
        self.on_goto(None,NEXT,True)

        if len(self.frames) == 1 :
            self._toggle_enable_buttons(NO_FRAMES)

        # ending gimp undo group
        self.image.undo_group_end()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号