forked from bartvdbraak/blender
cleanup: py imports
This commit is contained in:
parent
3e59092348
commit
e17c6f79a5
@ -30,17 +30,20 @@
|
||||
|
||||
import sys
|
||||
|
||||
try:
|
||||
if __package__ is None:
|
||||
import settings
|
||||
import utils
|
||||
except:
|
||||
from . import (settings, utils)
|
||||
else:
|
||||
from . import (
|
||||
settings,
|
||||
utils,
|
||||
)
|
||||
|
||||
|
||||
# XXX This is a quick hack to make it work with new I18n... objects! To be reworked!
|
||||
def main():
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description=""
|
||||
parser = argparse.ArgumentParser(description=
|
||||
"Merge one or more .po files into the first dest one.\n"
|
||||
"If a msgkey (msgctxt, msgid) is present in more than one merged po, the one in the first file "
|
||||
"wins, unless it’s marked as fuzzy and one later is not.\n"
|
||||
|
@ -31,9 +31,10 @@ import sys
|
||||
import tempfile
|
||||
#import time
|
||||
|
||||
from bl_i18n_utils import (settings,
|
||||
utils_rtl,
|
||||
)
|
||||
from bl_i18n_utils import (
|
||||
settings,
|
||||
utils_rtl,
|
||||
)
|
||||
|
||||
import bpy
|
||||
|
||||
|
@ -43,10 +43,11 @@ __all__ = (
|
||||
import bpy as _bpy
|
||||
import os as _os
|
||||
|
||||
from _bpy_path import (extensions_audio,
|
||||
extensions_movie,
|
||||
extensions_image,
|
||||
)
|
||||
from _bpy_path import (
|
||||
extensions_audio,
|
||||
extensions_movie,
|
||||
extensions_image,
|
||||
)
|
||||
|
||||
|
||||
def _getattr_bytes(var, attr):
|
||||
|
@ -51,12 +51,12 @@ __all__ = (
|
||||
)
|
||||
|
||||
from _bpy import (
|
||||
escape_identifier,
|
||||
register_class,
|
||||
unregister_class,
|
||||
blend_paths,
|
||||
resource_path,
|
||||
)
|
||||
escape_identifier,
|
||||
register_class,
|
||||
unregister_class,
|
||||
blend_paths,
|
||||
resource_path,
|
||||
)
|
||||
from _bpy import script_paths as _bpy_script_paths
|
||||
from _bpy import user_resource as _user_resource
|
||||
from _bpy import _utils_units as units
|
||||
|
@ -20,9 +20,10 @@
|
||||
import bpy
|
||||
from bpy.types import Operator
|
||||
|
||||
from bpy.props import (FloatProperty,
|
||||
IntProperty,
|
||||
)
|
||||
from bpy.props import (
|
||||
FloatProperty,
|
||||
IntProperty,
|
||||
)
|
||||
from bpy.app.translations import pgettext_data as data_
|
||||
|
||||
from bpy_extras import object_utils
|
||||
|
@ -27,11 +27,12 @@ if "bpy" in locals():
|
||||
|
||||
import bpy
|
||||
from bpy.types import Operator
|
||||
from bpy.props import (IntProperty,
|
||||
BoolProperty,
|
||||
EnumProperty,
|
||||
StringProperty,
|
||||
)
|
||||
from bpy.props import (
|
||||
IntProperty,
|
||||
BoolProperty,
|
||||
EnumProperty,
|
||||
StringProperty,
|
||||
)
|
||||
|
||||
|
||||
class ANIM_OT_keying_set_export(Operator):
|
||||
|
@ -20,9 +20,10 @@
|
||||
|
||||
import bpy
|
||||
from bpy.types import Operator
|
||||
from bpy.props import (BoolProperty,
|
||||
StringProperty,
|
||||
)
|
||||
from bpy.props import (
|
||||
BoolProperty,
|
||||
StringProperty,
|
||||
)
|
||||
|
||||
|
||||
def _lang_module_get(sc):
|
||||
|
@ -16,10 +16,13 @@
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
import sys
|
||||
import bpy
|
||||
|
||||
from bpy.props import (BoolProperty, EnumProperty, StringProperty)
|
||||
from bpy.props import (
|
||||
BoolProperty,
|
||||
EnumProperty,
|
||||
StringProperty,
|
||||
)
|
||||
|
||||
|
||||
class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
|
||||
@ -29,11 +32,16 @@ class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
|
||||
bl_label = "Fill Range by Selection"
|
||||
bl_options = {'INTERNAL'}
|
||||
|
||||
type = EnumProperty(name="Type", description="Type of the modifier to work on",
|
||||
items=(("COLOR", "Color", "Color modifier type"),
|
||||
("ALPHA", "Alpha", "Alpha modifier type"),
|
||||
("THICKNESS", "Thickness", "Thickness modifier type")))
|
||||
name = StringProperty(name="Name", description="Name of the modifier to work on")
|
||||
type = EnumProperty(
|
||||
name="Type", description="Type of the modifier to work on",
|
||||
items=(("COLOR", "Color", "Color modifier type"),
|
||||
("ALPHA", "Alpha", "Alpha modifier type"),
|
||||
("THICKNESS", "Thickness", "Thickness modifier type")),
|
||||
)
|
||||
name = StringProperty(
|
||||
name="Name",
|
||||
description="Name of the modifier to work on",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@ -41,6 +49,8 @@ class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
|
||||
return rl and rl.freestyle_settings.linesets.active
|
||||
|
||||
def execute(self, context):
|
||||
import sys
|
||||
|
||||
scene = context.scene
|
||||
rl = scene.render.layers.active
|
||||
lineset = rl.freestyle_settings.linesets.active
|
||||
|
@ -20,15 +20,17 @@
|
||||
|
||||
import bpy
|
||||
import nodeitems_utils
|
||||
from bpy.types import (Operator,
|
||||
PropertyGroup,
|
||||
)
|
||||
from bpy.props import (BoolProperty,
|
||||
CollectionProperty,
|
||||
EnumProperty,
|
||||
IntProperty,
|
||||
StringProperty,
|
||||
)
|
||||
from bpy.types import (
|
||||
Operator,
|
||||
PropertyGroup,
|
||||
)
|
||||
from bpy.props import (
|
||||
BoolProperty,
|
||||
CollectionProperty,
|
||||
EnumProperty,
|
||||
IntProperty,
|
||||
StringProperty,
|
||||
)
|
||||
|
||||
|
||||
class NodeSetting(PropertyGroup):
|
||||
|
@ -20,11 +20,13 @@
|
||||
|
||||
import bpy
|
||||
from bpy.types import Operator
|
||||
from bpy.props import (StringProperty,
|
||||
BoolProperty,
|
||||
EnumProperty,
|
||||
IntProperty,
|
||||
FloatProperty)
|
||||
from bpy.props import (
|
||||
StringProperty,
|
||||
BoolProperty,
|
||||
EnumProperty,
|
||||
IntProperty,
|
||||
FloatProperty,
|
||||
)
|
||||
|
||||
|
||||
class SelectPattern(Operator):
|
||||
|
@ -21,12 +21,13 @@
|
||||
from mathutils import Vector
|
||||
import bpy
|
||||
from bpy.types import Operator
|
||||
from bpy.props import (BoolProperty,
|
||||
EnumProperty,
|
||||
IntProperty,
|
||||
FloatProperty,
|
||||
FloatVectorProperty,
|
||||
)
|
||||
from bpy.props import (
|
||||
BoolProperty,
|
||||
EnumProperty,
|
||||
IntProperty,
|
||||
FloatProperty,
|
||||
FloatVectorProperty,
|
||||
)
|
||||
|
||||
|
||||
def object_ensure_material(obj, mat_name):
|
||||
|
@ -20,12 +20,13 @@
|
||||
|
||||
import bpy
|
||||
from bpy.types import Operator
|
||||
from bpy.props import (StringProperty,
|
||||
BoolProperty,
|
||||
IntProperty,
|
||||
FloatProperty,
|
||||
EnumProperty,
|
||||
)
|
||||
from bpy.props import (
|
||||
StringProperty,
|
||||
BoolProperty,
|
||||
IntProperty,
|
||||
FloatProperty,
|
||||
EnumProperty,
|
||||
)
|
||||
|
||||
from bpy.app.translations import pgettext_tip as tip_
|
||||
|
||||
|
@ -278,9 +278,10 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
row.prop(itasc, "damping_max", text="Damp", slider=True)
|
||||
row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
|
||||
|
||||
from bl_ui.properties_animviz import (MotionPathButtonsPanel,
|
||||
OnionSkinButtonsPanel,
|
||||
)
|
||||
from bl_ui.properties_animviz import (
|
||||
MotionPathButtonsPanel,
|
||||
OnionSkinButtonsPanel,
|
||||
)
|
||||
|
||||
|
||||
class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
|
||||
|
@ -230,9 +230,10 @@ class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
cam = context.camera
|
||||
safe_data = context.scene.safe_areas
|
||||
camera = context.camera
|
||||
|
||||
draw_display_safe_settings(layout, cam)
|
||||
draw_display_safe_settings(layout, safe_data, camera)
|
||||
|
||||
|
||||
class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):
|
||||
@ -241,9 +242,7 @@ class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):
|
||||
_property_type = bpy.types.Camera
|
||||
|
||||
|
||||
def draw_display_safe_settings(layout, settings):
|
||||
|
||||
safe_data = bpy.context.scene.safe_areas
|
||||
def draw_display_safe_settings(layout, safe_data, settings):
|
||||
show_safe_areas = settings.show_safe_areas
|
||||
show_safe_center = settings.show_safe_center
|
||||
|
||||
|
@ -323,8 +323,10 @@ class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
|
||||
layout.prop(ob, "use_extra_recalc_data")
|
||||
|
||||
|
||||
from bl_ui.properties_animviz import (MotionPathButtonsPanel,
|
||||
OnionSkinButtonsPanel)
|
||||
from bl_ui.properties_animviz import (
|
||||
MotionPathButtonsPanel,
|
||||
OnionSkinButtonsPanel,
|
||||
)
|
||||
|
||||
|
||||
class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
|
||||
|
@ -22,11 +22,12 @@ from bpy.types import Panel, Menu
|
||||
from rna_prop_ui import PropertyPanel
|
||||
from bpy.app.translations import pgettext_iface as iface_
|
||||
|
||||
from bl_ui.properties_physics_common import (point_cache_ui,
|
||||
effector_weights_ui,
|
||||
basic_force_field_settings_ui,
|
||||
basic_force_field_falloff_ui,
|
||||
)
|
||||
from bl_ui.properties_physics_common import (
|
||||
point_cache_ui,
|
||||
effector_weights_ui,
|
||||
basic_force_field_settings_ui,
|
||||
basic_force_field_falloff_ui,
|
||||
)
|
||||
|
||||
|
||||
def particle_panel_enabled(context, psys):
|
||||
|
@ -20,8 +20,10 @@
|
||||
import bpy
|
||||
from bpy.types import Menu, Panel
|
||||
|
||||
from bl_ui.properties_physics_common import (point_cache_ui,
|
||||
effector_weights_ui)
|
||||
from bl_ui.properties_physics_common import (
|
||||
point_cache_ui,
|
||||
effector_weights_ui,
|
||||
)
|
||||
|
||||
|
||||
def cloth_panel_enabled(md):
|
||||
|
@ -20,9 +20,10 @@
|
||||
import bpy
|
||||
from bpy.types import Panel, UIList
|
||||
|
||||
from bl_ui.properties_physics_common import (point_cache_ui,
|
||||
effector_weights_ui,
|
||||
)
|
||||
from bl_ui.properties_physics_common import (
|
||||
point_cache_ui,
|
||||
effector_weights_ui,
|
||||
)
|
||||
|
||||
|
||||
class PHYSICS_UL_dynapaint_surfaces(UIList):
|
||||
|
@ -20,9 +20,10 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
|
||||
from bl_ui.properties_physics_common import (basic_force_field_settings_ui,
|
||||
basic_force_field_falloff_ui,
|
||||
)
|
||||
from bl_ui.properties_physics_common import (
|
||||
basic_force_field_settings_ui,
|
||||
basic_force_field_falloff_ui,
|
||||
)
|
||||
|
||||
|
||||
class PhysicButtonsPanel():
|
||||
|
@ -20,8 +20,10 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
|
||||
from bl_ui.properties_physics_common import (point_cache_ui,
|
||||
effector_weights_ui)
|
||||
from bl_ui.properties_physics_common import (
|
||||
point_cache_ui,
|
||||
effector_weights_ui,
|
||||
)
|
||||
|
||||
|
||||
class PhysicButtonsPanel():
|
||||
|
@ -20,8 +20,10 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
|
||||
from bl_ui.properties_physics_common import (point_cache_ui,
|
||||
effector_weights_ui)
|
||||
from bl_ui.properties_physics_common import (
|
||||
point_cache_ui,
|
||||
effector_weights_ui,
|
||||
)
|
||||
|
||||
|
||||
def softbody_panel_enabled(md):
|
||||
|
@ -22,9 +22,9 @@ from bpy.types import Panel, UIList
|
||||
from rna_prop_ui import PropertyPanel
|
||||
|
||||
from bl_ui.properties_physics_common import (
|
||||
point_cache_ui,
|
||||
effector_weights_ui,
|
||||
)
|
||||
point_cache_ui,
|
||||
effector_weights_ui,
|
||||
)
|
||||
|
||||
|
||||
class SCENE_UL_keying_set_paths(UIList):
|
||||
|
@ -20,14 +20,16 @@
|
||||
import bpy
|
||||
from bpy.types import Menu, Panel, UIList
|
||||
|
||||
from bpy.types import (Brush,
|
||||
Lamp,
|
||||
Material,
|
||||
Object,
|
||||
ParticleSettings,
|
||||
FreestyleLineStyle,
|
||||
Texture,
|
||||
World)
|
||||
from bpy.types import (
|
||||
Brush,
|
||||
FreestyleLineStyle,
|
||||
Lamp,
|
||||
Material,
|
||||
Object,
|
||||
ParticleSettings,
|
||||
Texture,
|
||||
World,
|
||||
)
|
||||
|
||||
from rna_prop_ui import PropertyPanel
|
||||
|
||||
|
@ -1003,15 +1003,16 @@ class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel):
|
||||
# -----------------------------------------------------------------------------
|
||||
# Mask (similar code in space_image.py, keep in sync)
|
||||
|
||||
|
||||
from bl_ui.properties_mask_common import (MASK_PT_mask,
|
||||
MASK_PT_layers,
|
||||
MASK_PT_spline,
|
||||
MASK_PT_point,
|
||||
MASK_PT_display,
|
||||
MASK_PT_tools,
|
||||
MASK_PT_transforms,
|
||||
MASK_PT_add)
|
||||
from bl_ui.properties_mask_common import (
|
||||
MASK_PT_mask,
|
||||
MASK_PT_layers,
|
||||
MASK_PT_spline,
|
||||
MASK_PT_point,
|
||||
MASK_PT_display,
|
||||
MASK_PT_tools,
|
||||
MASK_PT_transforms,
|
||||
MASK_PT_add,
|
||||
)
|
||||
|
||||
|
||||
class CLIP_PT_mask_layers(MASK_PT_layers, Panel):
|
||||
|
@ -28,7 +28,7 @@ from bl_ui.properties_paint_common import (
|
||||
from bl_ui.properties_grease_pencil_common import (
|
||||
GreasePencilDrawingToolsPanel,
|
||||
GreasePencilStrokeEditPanel,
|
||||
GreasePencilDataPanel
|
||||
GreasePencilDataPanel,
|
||||
)
|
||||
from bpy.app.translations import pgettext_iface as iface_
|
||||
|
||||
@ -515,12 +515,14 @@ class MASK_MT_editor_menus(Menu):
|
||||
# Mask (similar code in space_clip.py, keep in sync)
|
||||
# note! - panel placement does _not_ fit well with image panels... need to fix
|
||||
|
||||
from bl_ui.properties_mask_common import (MASK_PT_mask,
|
||||
MASK_PT_layers,
|
||||
MASK_PT_spline,
|
||||
MASK_PT_point,
|
||||
MASK_PT_display,
|
||||
MASK_PT_tools)
|
||||
from bl_ui.properties_mask_common import (
|
||||
MASK_PT_mask,
|
||||
MASK_PT_layers,
|
||||
MASK_PT_spline,
|
||||
MASK_PT_point,
|
||||
MASK_PT_display,
|
||||
MASK_PT_tools,
|
||||
)
|
||||
|
||||
|
||||
class IMAGE_PT_mask(MASK_PT_mask, Panel):
|
||||
|
@ -22,7 +22,6 @@ from bpy.types import Header, Menu, Panel
|
||||
from bl_ui.properties_grease_pencil_common import GreasePencilDataPanel, GreasePencilToolsPanel
|
||||
from bpy.app.translations import pgettext_iface as iface_
|
||||
|
||||
from bl_ui.properties_data_camera import draw_display_safe_settings
|
||||
|
||||
def act_strip(context):
|
||||
try:
|
||||
@ -1000,10 +999,13 @@ class SEQUENCER_PT_view_safe_areas(SequencerButtonsPanel_Output, Panel):
|
||||
self.layout.prop(st, "show_safe_areas", text="")
|
||||
|
||||
def draw(self, context):
|
||||
from bl_ui.properties_data_camera import draw_display_safe_settings
|
||||
|
||||
layout = self.layout
|
||||
st = context.space_data
|
||||
safe_data = context.scene.safe_areas
|
||||
|
||||
draw_display_safe_settings(layout, st)
|
||||
draw_display_safe_settings(layout, safe_data, st)
|
||||
|
||||
|
||||
class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
|
||||
|
Loading…
Reference in New Issue
Block a user