diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-07-25 10:36:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-07-25 10:36:49 +0300 |
commit | 9bdd12d884c5130397e67f72caad2770d9524c9a (patch) | |
tree | f26951742aadf0c14810ed581bad9393cc2d23ec /release/scripts | |
parent | d99532e1d8fd49019003046dcf471c85a52e0398 (diff) | |
parent | d1dc5e0a53c5a3484b7d20eb3a9847b53a227791 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'release/scripts')
21 files changed, 73 insertions, 31 deletions
diff --git a/release/scripts/freestyle/styles/apriori_and_causal_density.py b/release/scripts/freestyle/styles/apriori_and_causal_density.py index 2ba768af835..42fc3370488 100644 --- a/release/scripts/freestyle/styles/apriori_and_causal_density.py +++ b/release/scripts/freestyle/styles/apriori_and_causal_density.py @@ -19,8 +19,8 @@ # Filename : apriori_and_causal_density.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : Selects the lines with high a priori density and -# subjects them to the causal density so as to avoid +# Purpose : Selects the lines with high a priori density and +# subjects them to the causal density so as to avoid # cluttering from freestyle.chainingiterators import ChainPredicateIterator diff --git a/release/scripts/freestyle/styles/cartoon.py b/release/scripts/freestyle/styles/cartoon.py index e630127db1a..87518bb832e 100644 --- a/release/scripts/freestyle/styles/cartoon.py +++ b/release/scripts/freestyle/styles/cartoon.py @@ -19,7 +19,7 @@ # Filename : cartoon.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : Draws colored lines. The color is automatically +# Purpose : Draws colored lines. The color is automatically # inferred from each object's material in a cartoon-like # fashion. diff --git a/release/scripts/freestyle/styles/external_contour_sketchy.py b/release/scripts/freestyle/styles/external_contour_sketchy.py index 44dbda4709f..6bccf23ac8d 100644 --- a/release/scripts/freestyle/styles/external_contour_sketchy.py +++ b/release/scripts/freestyle/styles/external_contour_sketchy.py @@ -19,8 +19,8 @@ # Filename : external_contour_sketchy.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : Draws the external contour of the scene using a sketchy -# chaining iterator (in particular each ViewEdge can be drawn +# Purpose : Draws the external contour of the scene using a sketchy +# chaining iterator (in particular each ViewEdge can be drawn # several times from freestyle.chainingiterators import pySketchyChainingIterator @@ -41,7 +41,7 @@ from freestyle.shaders import ( from freestyle.types import Operators -upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D()) +upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D()) Operators.select(upred) Operators.bidirectional_chain(pySketchyChainingIterator(), NotUP1D(upred)) shaders_list = [ diff --git a/release/scripts/freestyle/styles/haloing.py b/release/scripts/freestyle/styles/haloing.py index 6cd37779a42..34e4f65cf91 100644 --- a/release/scripts/freestyle/styles/haloing.py +++ b/release/scripts/freestyle/styles/haloing.py @@ -19,8 +19,8 @@ # Filename : haloing.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : This style module selects the lines that -# are connected (in the image) to a specific +# Purpose : This style module selects the lines that +# are connected (in the image) to a specific # object and trims them in order to produce # a haloing effect around the target shape @@ -42,14 +42,14 @@ from freestyle.shaders import ( from freestyle.types import Id, Operators -# id corresponds to the id of the target object +# id corresponds to the id of the target object # (accessed by SHIFT+click) id = Id(3,0) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyIsOccludedByUP1D(id)) Operators.select(upred) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred)) shaders_list = [ - IncreasingThicknessShader(3, 5), + IncreasingThicknessShader(3, 5), IncreasingColorShader(1,0,0, 1,0,1,0,1), SamplingShader(1.0), pyTVertexRemoverShader(), diff --git a/release/scripts/freestyle/styles/invisible_lines.py b/release/scripts/freestyle/styles/invisible_lines.py index 461429b6437..5506f4ef11f 100644 --- a/release/scripts/freestyle/styles/invisible_lines.py +++ b/release/scripts/freestyle/styles/invisible_lines.py @@ -19,7 +19,7 @@ # Filename : invisible_lines.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : Draws all lines whose Quantitative Invisibility +# Purpose : Draws all lines whose Quantitative Invisibility # is different from 0 from freestyle.chainingiterators import ChainSilhouetteIterator diff --git a/release/scripts/freestyle/styles/long_anisotropically_dense.py b/release/scripts/freestyle/styles/long_anisotropically_dense.py index 50bec4f1a79..bfd5910cefe 100644 --- a/release/scripts/freestyle/styles/long_anisotropically_dense.py +++ b/release/scripts/freestyle/styles/long_anisotropically_dense.py @@ -19,13 +19,13 @@ # Filename : long_anisotropically_dense.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : Selects the lines that are long and have a high anisotropic -# a priori density and uses causal density +# Purpose : Selects the lines that are long and have a high anisotropic +# a priori density and uses causal density # to draw without cluttering. Ideally, half of the # selected lines are culled using the causal density. # # ********************* WARNING ************************************* -# ******** The Directional a priori density maps must ****** +# ******** The Directional a priori density maps must ****** # ******** have been computed prior to using this style module ****** from freestyle.chainingiterators import ChainSilhouetteIterator @@ -75,7 +75,7 @@ Operators.sort(pyLengthBP1D()) shaders_list = [ SamplingShader(2.0), ConstantThicknessShader(2), - ConstantColorShader(0.2,0.2,0.25,1), + ConstantColorShader(0.2,0.2,0.25,1), ] ## uniform culling Operators.create(pyDensityUP1D(3.0,2.0e-2, IntegrationType.MEAN, 0.1), shaders_list) diff --git a/release/scripts/freestyle/styles/multiple_parameterization.py b/release/scripts/freestyle/styles/multiple_parameterization.py index 0e224c74bbf..c03a61c9a81 100644 --- a/release/scripts/freestyle/styles/multiple_parameterization.py +++ b/release/scripts/freestyle/styles/multiple_parameterization.py @@ -19,7 +19,7 @@ # Filename : multiple_parameterization.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : The thickness and the color of the strokes vary continuously +# Purpose : The thickness and the color of the strokes vary continuously # independently from occlusions although only # visible lines are actually drawn. This is equivalent # to assigning the thickness using a parameterization covering diff --git a/release/scripts/freestyle/styles/nature.py b/release/scripts/freestyle/styles/nature.py index 74a42e6b2e5..1061f22017a 100644 --- a/release/scripts/freestyle/styles/nature.py +++ b/release/scripts/freestyle/styles/nature.py @@ -22,7 +22,7 @@ # Purpose : Uses the NatureUP1D predicate to select the lines # of a given type (among Nature.SILHOUETTE, Nature.CREASE, Nature.SUGGESTIVE_CONTOURS, # Nature.BORDERS). -# The suggestive contours must have been enabled in the +# The suggestive contours must have been enabled in the # options dialog to appear in the View Map. from freestyle.chainingiterators import ChainSilhouetteIterator diff --git a/release/scripts/freestyle/styles/near_lines.py b/release/scripts/freestyle/styles/near_lines.py index 5e260a22382..14c8d2f9e01 100644 --- a/release/scripts/freestyle/styles/near_lines.py +++ b/release/scripts/freestyle/styles/near_lines.py @@ -19,7 +19,7 @@ # Filename : near_lines.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : Draws the lines that are "closer" than a threshold +# Purpose : Draws the lines that are "closer" than a threshold # (between 0 and 1) from freestyle.chainingiterators import ChainSilhouetteIterator diff --git a/release/scripts/freestyle/styles/qi1.py b/release/scripts/freestyle/styles/qi1.py index d70e56d401a..4d87055eafb 100644 --- a/release/scripts/freestyle/styles/qi1.py +++ b/release/scripts/freestyle/styles/qi1.py @@ -20,7 +20,7 @@ # Author : Stephane Grabli # Date : 04/08/2005 # Purpose : Draws lines hidden by one surface. -# *** Quantitative Invisibility must have been +# *** Quantitative Invisibility must have been # enabled in the options dialog to use this style module **** from freestyle.chainingiterators import ChainSilhouetteIterator diff --git a/release/scripts/freestyle/styles/qi2.py b/release/scripts/freestyle/styles/qi2.py index 6ac933ecc05..937b5db590a 100644 --- a/release/scripts/freestyle/styles/qi2.py +++ b/release/scripts/freestyle/styles/qi2.py @@ -20,7 +20,7 @@ # Author : Stephane Grabli # Date : 04/08/2005 # Purpose : Draws lines hidden by two surfaces. -# *** Quantitative Invisibility must have been +# *** Quantitative Invisibility must have been # enabled in the options dialog to use this style module **** from freestyle.chainingiterators import ChainSilhouetteIterator diff --git a/release/scripts/freestyle/styles/sequentialsplit_sketchy.py b/release/scripts/freestyle/styles/sequentialsplit_sketchy.py index b980fdc87d7..5755fd3b845 100644 --- a/release/scripts/freestyle/styles/sequentialsplit_sketchy.py +++ b/release/scripts/freestyle/styles/sequentialsplit_sketchy.py @@ -21,7 +21,7 @@ # Date : 04/08/2005 # Purpose : Use the sequential split with two different # predicates to specify respectively the starting and -# the stopping extremities for strokes +# the stopping extremities for strokes from freestyle.chainingiterators import ChainSilhouetteIterator from freestyle.predicates import ( diff --git a/release/scripts/freestyle/styles/sketchy_multiple_parameterization.py b/release/scripts/freestyle/styles/sketchy_multiple_parameterization.py index a3ce6112165..8302ec8e4c3 100644 --- a/release/scripts/freestyle/styles/sketchy_multiple_parameterization.py +++ b/release/scripts/freestyle/styles/sketchy_multiple_parameterization.py @@ -19,7 +19,7 @@ # Filename : sketchy_multiple_parameterization.py # Author : Stephane Grabli # Date : 04/08/2005 -# Purpose : Builds sketchy strokes whose topology relies on a +# Purpose : Builds sketchy strokes whose topology relies on a # parameterization that covers the complete lines (visible+invisible) # whereas only the visible portions are actually drawn diff --git a/release/scripts/freestyle/styles/uniformpruning_zsort.py b/release/scripts/freestyle/styles/uniformpruning_zsort.py index 814e140ee49..64e808d9f8a 100644 --- a/release/scripts/freestyle/styles/uniformpruning_zsort.py +++ b/release/scripts/freestyle/styles/uniformpruning_zsort.py @@ -17,7 +17,7 @@ # ##### END GPL LICENSE BLOCK ##### # Filename : uniformpruning_zsort.py -# Authors : Fredo Durand, Stephane Grabli, Francois Sillion, Emmanuel Turquin +# Authors : Fredo Durand, Stephane Grabli, Francois Sillion, Emmanuel Turquin # Date : 08/04/2005 from freestyle.chainingiterators import ChainSilhouetteIterator diff --git a/release/scripts/modules/bl_i18n_utils/utils_spell_check.py b/release/scripts/modules/bl_i18n_utils/utils_spell_check.py index 285e2ebe477..b33588c903b 100644 --- a/release/scripts/modules/bl_i18n_utils/utils_spell_check.py +++ b/release/scripts/modules/bl_i18n_utils/utils_spell_check.py @@ -128,7 +128,7 @@ class SpellChecker: "multisampling", "multiscatter", "multitexture", - "multithreaded", + "multithreaded", "multiuser", "multiview", "namespace", diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index 1d555ae7123..703a61f72f5 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -37,6 +37,7 @@ __all__ = ( "register_module", "register_manual_map", "unregister_manual_map", + "register_submodule_factory", "make_rna_paths", "manual_map", "previews", @@ -684,6 +685,47 @@ def unregister_module(module, verbose=False): print("done.\n") +def register_submodule_factory(module_name, submodule_names): + """ + Utility function to create register and unregister functions + which simply load submodules, + calling their register & unregister functions. + + .. note:: + + Modules are registered in the order given, + unregistered in reverse order. + + :arg module_name: The module name, typically ``__name__``. + :type module_name: string + :arg submodule_names: List of submodule names to load and unload. + :type submodule_names: list of strings + :return: register and unregister functions. + :rtype: tuple pair of functions + """ + + module = None + submodules = [] + + def register(): + nonlocal module + module = __import__(name=module_name, fromlist=submodule_names) + submodules[:] = [getattr(module, name) for name in submodule_names] + for mod in submodules: + mod.register() + + def unregister(): + from sys import modules + for mod in reversed(submodules): + mod.unregister() + name = mod.__name__ + delattr(module, name.partition(".")[2]) + del modules[name] + submodules.clear() + + return register, unregister + + # ----------------------------------------------------------------------------- # Manual lookups, each function has to return a basepath and a sequence # of... diff --git a/release/scripts/modules/keyingsets_utils.py b/release/scripts/modules/keyingsets_utils.py index 8cef64c3590..7ce5f3e029b 100644 --- a/release/scripts/modules/keyingsets_utils.py +++ b/release/scripts/modules/keyingsets_utils.py @@ -232,7 +232,7 @@ bbone_property_ids = ( "bbone_scalein", "bbone_scaleout", - # NOTE: These are in the nested bone struct + # NOTE: These are in the nested bone struct # Do it this way to force them to be included # in whatever actions are being keyed here "bone.bbone_in", diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index b7ef6856575..411c318643b 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -723,7 +723,7 @@ def main(context, global USER_FILL_HOLES_QUALITY global USER_STRETCH_ASPECT global USER_ISLAND_MARGIN - + from math import cos import time @@ -747,7 +747,7 @@ def main(context, USER_FILL_HOLES = 0 USER_FILL_HOLES_QUALITY = 50 # Only for hole filling. USER_VIEW_INIT = 0 # Only for hole filling. - + is_editmode = (context.active_object.mode == 'EDIT') if is_editmode: obList = [ob for ob in [context.active_object] if ob and ob.type == 'MESH'] diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index 00892d5f85b..9b61101778f 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -886,10 +886,10 @@ class ConstraintButtonsPanel: box.template_cache_file(con, "cache_file") cache_file = con.cache_file - + layout.label(text="Constraint Properties:") box = layout.box() - + if cache_file is not None: box.prop_search(con, "object_path", cache_file, "object_paths") diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index caef60980aa..4ce2d97d2a0 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -180,7 +180,7 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel): if poselib: # warning about poselib being in an invalid state if len(poselib.fcurves) > 0 and len(poselib.pose_markers) == 0: - layout.label(icon='ERROR', text="Error: Potentially corrupt library, run 'Sanitize' operator to fix") + layout.label(icon='ERROR', text="Error: Potentially corrupt library, run 'Sanitize' operator to fix") # list of poses in pose library row = layout.row() diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index f62e3602bb9..390c043bb31 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -494,7 +494,7 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): # bendy bone properties def doBBone(ksi, context, ks, pchan): bone = pchan.bone - + # This check is crude, but is the best we can do for now # It simply adds all of these if the bbone has segments # (and the bone is a control bone). This may lead to some |