Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/freestyle.py
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | type = EnumProperty( | ||||
| ) | ) | ||||
| name = StringProperty( | name = StringProperty( | ||||
| name="Name", | name="Name", | ||||
| description="Name of the modifier to work on", | description="Name of the modifier to work on", | ||||
| ) | ) | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| rl = context.scene.render_layers.active | view_layer = context.scene.view_layers.active | ||||
| return rl and rl.freestyle_settings.linesets.active | return view_layer and view_layer.freestyle_settings.linesets.active | ||||
| def execute(self, context): | def execute(self, context): | ||||
| import sys | import sys | ||||
| scene = context.scene | scene = context.scene | ||||
| rl = scene.render_layers.active | view_layer = scene.view_layers.active | ||||
| lineset = rl.freestyle_settings.linesets.active | lineset = view_layer.freestyle_settings.linesets.active | ||||
| linestyle = lineset.linestyle | linestyle = lineset.linestyle | ||||
| # Find the modifier to work on | # Find the modifier to work on | ||||
| if self.type == 'COLOR': | if self.type == 'COLOR': | ||||
| m = linestyle.color_modifiers[self.name] | m = linestyle.color_modifiers[self.name] | ||||
| elif self.type == 'ALPHA': | elif self.type == 'ALPHA': | ||||
| m = linestyle.alpha_modifiers[self.name] | m = linestyle.alpha_modifiers[self.name] | ||||
| else: | else: | ||||
| m = linestyle.thickness_modifiers[self.name] | m = linestyle.thickness_modifiers[self.name] | ||||
| ▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | class SCENE_OT_freestyle_module_open(bpy.types.Operator): | ||||
| make_internal = BoolProperty( | make_internal = BoolProperty( | ||||
| name="Make internal", | name="Make internal", | ||||
| description="Make module file internal after loading", | description="Make module file internal after loading", | ||||
| default=True) | default=True) | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| rl = context.scene.render_layers.active | view_layer = context.scene.view_layers.active | ||||
| return rl and rl.freestyle_settings.mode == 'SCRIPT' | return view_layer and view_layer.freestyle_settings.mode == 'SCRIPT' | ||||
| def invoke(self, context, event): | def invoke(self, context, event): | ||||
| self.freestyle_module = context.freestyle_module | self.freestyle_module = context.freestyle_module | ||||
| wm = context.window_manager | wm = context.window_manager | ||||
| wm.fileselect_add(self) | wm.fileselect_add(self) | ||||
| return {'RUNNING_MODAL'} | return {'RUNNING_MODAL'} | ||||
| def execute(self, context): | def execute(self, context): | ||||
| Show All 11 Lines | |||||