diff --git a/CMakeLists.txt b/CMakeLists.txt index ad7c684807f..f3331606b68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -777,7 +777,7 @@ elseif(WIN32) set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib") else() - # keep GCC spesific stuff here + # keep GCC specific stuff here if(CMAKE_COMPILER_IS_GNUCC) set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32") set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing") diff --git a/GNUmakefile b/GNUmakefile index 52f36b218d8..af953143b82 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -34,10 +34,13 @@ OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]') # Source and Build DIR's BLENDER_DIR:=$(shell pwd -P) -BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE) BUILD_TYPE:=Release BUILD_CMAKE_ARGS:= +ifndef BUILD_DIR + BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE) +endif + # ----------------------------------------------------------------------------- # additional targets for the build configuration @@ -120,6 +123,9 @@ help: @echo " * headless - build without an interface (renderfarm or server automation)" @echo " * bpy - build as a python module which can be loaded from python directly" @echo "" + @echo " Note, passing the argument 'BUILD_DIR=path' when calling make will override the default build dir." + @echo "" + @echo "" @echo "Project Files for IDE's" @echo " * project_qtcreator - QtCreator Project Files" @echo " * project_netbeans - NetBeans Project Files" @@ -130,9 +136,8 @@ help: @echo " * package_pacman - build an arch linux pacmanpackage" @echo " * package_archive - build an archive package" @echo "" - @echo "Other Targets" + @echo "Other Targets (not assosiated with building blender)" @echo " * translations - update blenders translation files in po/" - # TODO, doxygen and sphinx docs @echo "" @echo "Testing Targets (not assosiated with building blender)" @echo " * test - run ctest, currently tests import/export, operator execution and that python modules load" @@ -145,8 +150,10 @@ help: @echo " * check_splint - run blenders source through splint (C only)" @echo " * check_sparse - run blenders source through sparse (C only)" @echo "" - @echo "Documentation Targets" + @echo "Documentation Targets (not assosiated with building blender)" @echo " * doc_py - generate sphinx python api docs" + @echo " * doc_dna - generate blender file format reference" + @echo " * doc_man - generate manpage" @echo "" # ----------------------------------------------------------------------------- @@ -235,6 +242,13 @@ doc_py: cd doc/python_api ; sphinx-build -n -b html sphinx-in sphinx-out @echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'" +doc_dna: + $(BUILD_DIR)/bin/blender --background --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py + @echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'" + +doc_man: + python3 doc/manpage/blender.1.py $(BUILD_DIR)/bin/blender + clean: $(MAKE) -C $(BUILD_DIR) clean diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py index 60a46d3a1dd..86f51273ff5 100644 --- a/build_files/cmake/cmake_consistency_check_config.py +++ b/build_files/cmake/cmake_consistency_check_config.py @@ -27,6 +27,10 @@ IGNORE = ( "extern/eltopo/common/openglutils.cpp", "extern/eltopo/eltopo3d/broadphase_blenderbvh.cpp", "source/blender/imbuf/intern/imbuf_cocoa.m", + "extern/recastnavigation/Recast/Source/RecastLog.cpp", + "extern/recastnavigation/Recast/Source/RecastTimer.cpp", + "entern/audaspace/SRC/AUD_SRCResampleFactory.cpp", + "entern/audaspace/SRC/AUD_SRCResampleReader.cpp", "extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h", "extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h", @@ -41,6 +45,10 @@ IGNORE = ( "extern/eltopo/common/meshes/TriangleIndex.hpp", "extern/eltopo/common/meshes/meshloader.h", "extern/eltopo/eltopo3d/broadphase_blenderbvh.h" + "extern/recastnavigation/Recast/Include/RecastLog.h", + "extern/recastnavigation/Recast/Include/RecastTimer.h", + "intern/audaspace/SRC/AUD_SRCResampleFactory.h", + "intern/audaspace/SRC/AUD_SRCResampleReader.h", ) UTF8_CHECK = True diff --git a/doc/manpage/blender.1 b/doc/manpage/blender.1 index 20cd40e32ee..620a90e61d2 100644 --- a/doc/manpage/blender.1 +++ b/doc/manpage/blender.1 @@ -1,4 +1,4 @@ -.TH "BLENDER" "1" "September 22, 2011" "Blender Blender 2\&.59 (sub 3)" +.TH "BLENDER" "1" "October 17, 2011" "Blender Blender 2\&.60 (sub 0)" .SH NAME blender \- a 3D modelling and rendering package @@ -15,7 +15,7 @@ Use Blender to create TV commercials, to make technical visualizations, business http://www.blender.org .SH OPTIONS -Blender 2.59 (sub 3) +Blender 2.59 (sub 4) Usage: blender [args ...] [file] [args ...] .br .SS "Render Options:" @@ -382,6 +382,7 @@ Arguments are executed in the order they are given. eg \fIBLENDER_SYSTEM_DATAFILES\fR Directory for system wide data files. \fIBLENDER_SYSTEM_PYTHON\fR Directory for system python libraries. \fITMP\fR or \fITMPDIR\fR Store temporary files here. + \fISDL_AUDIODRIVER\fR LibSDL audio driver \- alsa, esd, dma. \fIPYTHONHOME\fR Path to the python directory, eg. /usr/lib/python. .br .br diff --git a/doc/manpage/blender.1.py b/doc/manpage/blender.1.py index 40234300994..21df42a4082 100644 --- a/doc/manpage/blender.1.py +++ b/doc/manpage/blender.1.py @@ -22,6 +22,7 @@ import subprocess import os +import sys import time import datetime @@ -43,10 +44,15 @@ def man_format(data): return data +# allow passing blender as argument +if sys.argv[-1].endswith(os.sep + "blender"): + blender_bin = sys.argv[-1] +else: + blender_bin = os.path.join(os.path.dirname(__file__), "../../blender.bin") -blender_bin = os.path.join(os.path.dirname(__file__), "../../blender.bin") - -blender_help = subprocess.Popen([blender_bin, "--help"], stdout=subprocess.PIPE).communicate()[0].decode() +cmd = [blender_bin, "--help"] +print(" executing:", " ".join(cmd)) +blender_help = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].decode() blender_version = subprocess.Popen([blender_bin, "--version"], stdout=subprocess.PIPE).communicate()[0].decode().strip() blender_version = blender_version.split("Build")[0] diff --git a/doc/python_api/examples/mathutils.Color.py b/doc/python_api/examples/mathutils.Color.py new file mode 100644 index 00000000000..a55f1195bf6 --- /dev/null +++ b/doc/python_api/examples/mathutils.Color.py @@ -0,0 +1,30 @@ +import mathutils + +# color values are represented as RGB values from 0 - 1, this is blue +col = mathutils.Color((0.0, 0.0, 1.0)) + +# as well as r/g/b attribute access you can adjust them by h/s/v +col.s *= 0.5 + +# you can access its components by attribute or index +print("Color R:", col.r) +print("Color G:", col[1]) +print("Color B:", col[-1]) +print("Color HSV: %.2f, %.2f, %.2f", col[:]) + + +# components of an existing color can be set +col[:] = 0.0, 0.5, 1.0 + +# components of an existing color can use slice notation to get a tuple +print("Values: %f, %f, %f" % col[:]) + +# colors can be added and subtracted +col += mathutils.Color((0.25, 0.0, 0.0)) + +# Color can be multiplied, in this example color is scaled to 0-255 +# can printed as integers +print("Color: %d, %d, %d" % (col * 255.0)[:]) + +# This example prints the color as hexidecimal +print("Hexidecimal: %.2x%.2x%.2x" % (col * 255.0)[:]) diff --git a/doc/python_api/examples/mathutils.Euler.py b/doc/python_api/examples/mathutils.Euler.py index bc7702c1d53..3f87cc0ab04 100644 --- a/doc/python_api/examples/mathutils.Euler.py +++ b/doc/python_api/examples/mathutils.Euler.py @@ -1,3 +1,32 @@ import mathutils +import math -# todo +# create a new euler with default axis rotation order +eul = mathutils.Euler((0.0, math.radians(45.0), 0.0), 'XYZ') + +# rotate the euler +eul.rotate_axis(math.radians(10.0), 'Z') + +# you can access its components by attribute or index +print("Euler X", eul.x) +print("Euler Y", eul[1]) +print("Euler Z", eul[-1]) + +# components of an existing euler can be set +eul[:] = 1.0, 2.0, 3.0 + +# components of an existing euler can use slice notation to get a tuple +print("Values: %f, %f, %f" % eul[:]) + +# the order can be set at any time too +eul.order = 'ZYX' + +# eulers can be used to rotate vectors +vec = mathutils.Vector((0.0, 0.0, 1.0)) +vec.rotate(eul) + +# often its useful to convert the euler into a matrix so it can be used as +# transformations with more flexibility +mat_rot = eul.to_matrix() +mat_loc = mathutils.Matrix.Translation((2.0, 3.0, 4.0)) +mat = mat_loc * mat_rot.to_4x4() diff --git a/doc/python_api/examples/mathutils.Matrix.py b/doc/python_api/examples/mathutils.Matrix.py index bc7702c1d53..079070a5ec7 100644 --- a/doc/python_api/examples/mathutils.Matrix.py +++ b/doc/python_api/examples/mathutils.Matrix.py @@ -1,3 +1,28 @@ import mathutils +import math -# todo +# create a location matrix +mat_loc = mathutils.Matrix.Translation((2.0, 3.0, 4.0)) + +# create an identitiy matrix +mat_sca = mathutils.Matrix.Scale(0.5, 4, (0.0, 0.0, 1.0)) + +# create a rotation matrix +mat_rot = mathutils.Matrix.Rotation(math.radians(45.0), 4, 'X') + +# combine transformations +mat_out = mat_loc * mat_rot * mat_sca +print(mat_out) + +# extract components back out of the matrix +loc, rot, sca = mat_out.decompose() +print(loc, rot, sca) + +# it can also be useful to access components of a matrix directly +mat = mathutils.Matrix() +mat[0][0], mat[1][0], mat[2][0] = 0.0, 1.0, 2.0 + +mat[0][0:3] = 0.0, 1.0, 2.0 + +# each item in a matrix is a vector so vector utility functions can be used +mat[0].xyz = 0.0, 1.0, 2.0 diff --git a/doc/python_api/examples/mathutils.Quaternion.py b/doc/python_api/examples/mathutils.Quaternion.py index bc7702c1d53..d8c696e6ba6 100644 --- a/doc/python_api/examples/mathutils.Quaternion.py +++ b/doc/python_api/examples/mathutils.Quaternion.py @@ -1,3 +1,23 @@ import mathutils +import math -# todo +# a new rotation 90 degrees about the Y axis +quat_a = mathutils.Quaternion((0.7071068, 0.0, 0.7071068, 0.0)) + +# passing values to Quaternion's directly can be confusing so axis, angle +# is supported for initializing too +quat_b = mathutils.Quaternion((0.0, 1.0, 0.0), math.radians(90.0)) + +print("Check quaternions match", quat_a == quat_b) + +# like matrices, quaternions can be multiplied to accumulate rotational values +quat_a = mathutils.Quaternion((0.0, 1.0, 0.0), math.radians(90.0)) +quat_b = mathutils.Quaternion((0.0, 0.0, 1.0), math.radians(45.0)) +quat_out = quat_a * quat_b + +# print the quat, euler degrees for mear mortals and (axis, angle) +print("Final Rotation:") +print(quat_out) +print("%.2f, %.2f, %.2f" % tuple(math.degrees(a) for a in quat_out.to_euler())) +print("(%.2f, %.2f, %.2f), %.2f" % (quat_out.axis[:] + + (math.degrees(quat_out.angle), ))) diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst index 798491b4710..82e69965840 100644 --- a/doc/python_api/rst/bge.logic.rst +++ b/doc/python_api/rst/bge.logic.rst @@ -106,7 +106,7 @@ There are also methods to access the current :class:`bge.types.KX_Scene` Matricies as used by the game engine are **row major** ``matrix[row][col] = float`` -:class:`bge.types.KX_Camera` has some examples using matricies. +:class:`bge.types.KX_Camera` has some examples using matrices. ********* Variables diff --git a/doc/python_api/rst/bgl.rst b/doc/python_api/rst/bgl.rst index 61400351d16..8fe765836a1 100644 --- a/doc/python_api/rst/bgl.rst +++ b/doc/python_api/rst/bgl.rst @@ -20,7 +20,7 @@ OpenGL}" and the online NeHe tutorials are two of the best resources. See :class:`Image.gl_load` and :class:`Image.gl_load`, for example. `OpenGL.org `_ - `NeHe GameDev `_ + `NeHe GameDev `_ .. function:: glAccum(op, value): diff --git a/doc/python_api/rst/info_best_practice.rst b/doc/python_api/rst/info_best_practice.rst index 2fbc636613c..180a9fd1aa3 100644 --- a/doc/python_api/rst/info_best_practice.rst +++ b/doc/python_api/rst/info_best_practice.rst @@ -2,8 +2,9 @@ Best Practice ************* +When writing you're own scripts python is great for new developers to pick up and become productive, but you can also pick up odd habits or at least write scripts that are not easy for others to understand. -TODO: Intro text +For you're own work this is of course fine, but if you want to collaborate with others or have you're work included with blender there are practices we encourage. Style Conventions @@ -61,5 +62,233 @@ TODO: Thomas Script Efficiency ================= -TODO: Campbell +List Manipulation (General Python Tips) +--------------------------------------- + +Searching for list items +^^^^^^^^^^^^^^^^^^^^^^^^ + +In Python there are some handy list functions that save you having to search through the list. + +Even though you're not looping on the list data **python is**, so you need to be aware of functions that will slow down your script by searching the whole list. + +.. code-block:: python + + my_list.count(list_item) + my_list.index(list_item) + my_list.remove(list_item) + if list_item in my_list: ... + + +Modifying Lists +^^^^^^^^^^^^^^^ +In python we can add and remove from a list, This is slower when the list length is modifier, especially at the start of the list, since all the data after the index of modification needs to be moved up or down 1 place. + +The most simple way to add onto the end of the list is to use ``my_list.append(list_item)`` or ``my_list.extend(some_list)`` and the fastest way to remove an item is ``my_list.pop()`` or ``del my_list[-1]``. + +To use an index you can use ``my_list.insert(index, list_item)`` or ``list.pop(index)`` for list removal, but these are slower. + +Sometimes its faster (but more memory hungry) to just rebuild the list. + + +Say you want to remove all triangle faces in a list. + +Rather than... + +.. code-block:: python + + faces = mesh.faces[:] # make a list copy of the meshes faces + f_idx = len(faces) # Loop backwards + while f_idx: # while the value is not 0 + f_idx -= 1 + + if len(faces[f_idx].vertices) == 3: + faces.pop(f_idx) # remove the triangle + + +It's faster to build a new list with list comprehension. + +.. code-block:: python + + faces = [f for f in mesh.faces if len(f.vertices) != 3] + + +Adding List Items +^^^^^^^^^^^^^^^^^ + +If you have a list that you want to add onto another list, rather then... + +.. code-block:: python + + for l in some_list: + my_list.append(l) + +Use... + +.. code-block:: python + + my_list.extend([a, b, c...]) + + +Note that insert can be used when needed, but it is slower than append especially when inserting at the start of a long list. + +This example shows a very sub-optimal way of making a reversed list. + + +.. code-block:: python + + reverse_list = [] + for list_item in some_list: + reverse_list.insert(0, list_item) + + +Removing List Items +^^^^^^^^^^^^^^^^^^^ + +Use ``my_list.pop(index)`` rather than ``my_list.remove(list_item)`` + +This requires you to have the index of the list item but is faster since ``remove()`` will search the list. + +Here is an example of how to remove items in 1 loop, removing the last items first, which is faster (as explained above). + +.. code-block:: python + + list_index = len(my_list) + + while list_index: + list_index -= 1 + if my_list[list_index].some_test_attribute == 1: + my_list.pop(list_index) + + +This example shows a fast way of removing items, for use in cases were where you can alter the list order without breaking the scripts functionality. This works by swapping 2 list items, so the item you remove is always last. + +.. code-block:: python + + pop_index = 5 + + # swap so the pop_index is last. + my_list[-1], my_list[pop_index] = my_list[pop_index], my_list[-1] + + # remove last item (pop_index) + my_list.pop() + + +When removing many items in a large list this can provide a good speedup. + + +Avoid Copying Lists +^^^^^^^^^^^^^^^^^^^ + +When passing a list/dictionary to a function, it is faster to have the function modify the list rather then returning a new list so python dosn't have tp duplicate the list in memory. + +Functions that modify a list in-place are more efficient then functions that create new lists. + + +This is generally slower so only use for functions when it makes sense not to modify the list in place. + +>>> my_list = some_list_func(my_list) + + +This is generally faster since there is no re-assignment and no list duplication. + +>>> some_list_func(vec) + + +Also note that passing a sliced list makes a copy of the list in python memory + +>>> foobar(my_list[:]) + +If my_list was a large array containing 10000's of items, a copy could use a lot of extra memory. + + +Writing Strings to a File (Python General) +------------------------------------------ + +Here are 3 ways of joining multiple strings into 1 string for writing + +This really applies to any area of your code that involves a lot of string joining. + + +Pythons string addition, *don't use if you can help it, especially when writing data in a loop.* + +>>> file.write(str1 + " " + str2 + " " + str3 + "\n") + + +String formatting. Use this when you're writing string data from floats and int's + +>>> file.write("%s %s %s\n" % (str1, str2, str3)) + + +Pythons string joining function. To join a list of strings + +>>> file.write(" ".join([str1, str2, str3, "\n"])) + + +join is fastest on many strings, string formatting is quite fast too (better for converting data types). String arithmetic is slowest. + + +Parsing Strings (Import/Exporting) +---------------------------------- + +Since many file formats are ASCII, the way you parse/export strings can make a large difference in how fast your script runs. + +When importing strings to make into blender there are a few ways to parse the string. + +Parsing Numbers +^^^^^^^^^^^^^^^ + +Use ``float(string)`` rather than ``eval(string)``, if you know the value will be an int then ``int(string)``, float() will work for an int too but its faster to read ints with int(). + +Checking String Start/End +^^^^^^^^^^^^^^^^^^^^^^^^^ + +If your checking the start of a string for a keyword, rather than... + +>>> if line[0:5] == "vert ": ... + +Use... + +>>> if line.startswith("vert "): + +Using ``startswith()`` is slightly faster (approx 5%) and also avoids a possible error with the slice length not matching the string length. + +my_string.endswith("foo_bar") can be used for line endings too. + +if your unsure whether the text is upper or lower case use lower or upper string function. + +>>> if line.lower().startswith("vert ") + + +Use try/except Sparingly +------------------------ + +The **try** statement useful to save time writing error checking code. + +However **try** is significantly slower then an **if** since an exception has to be set each time, so avoid using **try** in areas of your code that execute in a loop and runs many times. + +There are cases where using **try** is faster than checking weather the condition will raise an error, so it is worth experimenting. + + +Value Comparison +---------------- + +Python has two ways to compare values ``a == b`` and ``a is b``, The difference is that ``==`` may run the objects comparison function ``__cmp__()`` where as ``is`` compares identity, that both variables reference the same item in memory. + +In cases where you know you are checking for the same value which is referenced from multiple places, ``is`` is faster. + + +Time You're Code +---------------- + +While developing a script its good to time it to be aware of any changes in performance, this can be done simply. + +.. code-block:: python + + import time + time_start = time.time() + + # do something... + + print("My Script Finished: %.4f sec" % time.time() - time_start) diff --git a/doc/python_api/rst/info_gotcha.rst b/doc/python_api/rst/info_gotcha.rst index e7903dcf96a..b17debbb15c 100644 --- a/doc/python_api/rst/info_gotcha.rst +++ b/doc/python_api/rst/info_gotcha.rst @@ -223,6 +223,26 @@ While writing scripts that deal with armatures you may find you have to switch b This is mainly an issue with editmode since pose data can be manipulated without having to be in pose mode, however for operator access you may still need to enter pose mode. +Relative File Paths +=================== + +Blenders relative file paths are not compatible with standard python modules such as ``sys`` and ``os``. + +Built in python functions don't understand blenders ``//`` prefix which denotes the blend file path. + +A common case where you would run into this problem is when exporting a material with assosiated image paths. + +>>> bpy.path.abspath(image.filepath) + + +When using blender data from linked libraries there is an unfortunate complication since the path will be relative to the library rather then the open blend file. When the data block may be from an external blend file pass the library argument from the `bpy.types.ID`. + +>>> bpy.path.abspath(image.filepath, library=image.library) + + +These returns the absolute path which can be used with native python modules. + + Unicode Problems ================ diff --git a/intern/ghost/intern/GHOST_SystemSDL.h b/intern/ghost/intern/GHOST_SystemSDL.h index 87d288117c5..d70bec610d6 100644 --- a/intern/ghost/intern/GHOST_SystemSDL.h +++ b/intern/ghost/intern/GHOST_SystemSDL.h @@ -110,7 +110,7 @@ private: const GHOST_TEmbedderWindowID parentWindow ); - /* SDL spesific */ + /* SDL specific */ GHOST_WindowSDL * findGhostWindow(SDL_Window *sdl_win); bool diff --git a/intern/ghost/intern/GHOST_WindowSDL.h b/intern/ghost/intern/GHOST_WindowSDL.h index 6b016b85126..62e1a71227f 100644 --- a/intern/ghost/intern/GHOST_WindowSDL.h +++ b/intern/ghost/intern/GHOST_WindowSDL.h @@ -70,7 +70,7 @@ public: ~GHOST_WindowSDL(); - /* SDL spesific */ + /* SDL specific */ SDL_Window * getSDLWindow() { diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index ef9a4615ff2..26611fb93ad 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -165,7 +165,7 @@ def modules(module_cache): if mod: module_cache[mod_name] = mod - # just incase we get stale modules, not likely + # just in case we get stale modules, not likely for mod_stale in modules_stale: del module_cache[mod_stale] del modules_stale @@ -209,7 +209,7 @@ def enable(module_name, default_set=True): :arg module_name: The name of the addon and module. :type module_name: string - :return: the loaded module or None on failier. + :return: the loaded module or None on failure. :rtype: module """ @@ -262,7 +262,7 @@ def enable(module_name, default_set=True): # * OK loaded successfully! * if default_set: - # just incase its enabled alredy + # just in case its enabled already ext = _bpy.context.user_preferences.addons.get(module_name) if not ext: ext = _bpy.context.user_preferences.addons.new() @@ -286,7 +286,7 @@ def disable(module_name, default_set=True): import sys mod = sys.modules.get(module_name) - # possible this addon is from a previous session and didnt load a + # possible this addon is from a previous session and didn't load a # module this time. So even if the module is not found, still disable # the addon in the user prefs. if mod: @@ -300,7 +300,7 @@ def disable(module_name, default_set=True): else: print("addon_utils.disable", module_name, "not loaded") - # could be in more then once, unlikely but better do this just incase. + # could be in more then once, unlikely but better do this just in case. addons = _bpy.context.user_preferences.addons if default_set: diff --git a/release/scripts/modules/animsys_refactor.py b/release/scripts/modules/animsys_refactor.py index 88097ed3d28..64110b0f620 100644 --- a/release/scripts/modules/animsys_refactor.py +++ b/release/scripts/modules/animsys_refactor.py @@ -73,7 +73,7 @@ class DataPathBuilder(object): try: print("base." + item_new) base_new = eval("base." + item_new) - break # found, dont keep looking + break # found, don't keep looking except: pass diff --git a/release/scripts/modules/blend_render_info.py b/release/scripts/modules/blend_render_info.py index 43820e82340..7c30b480d6b 100755 --- a/release/scripts/modules/blend_render_info.py +++ b/release/scripts/modules/blend_render_info.py @@ -69,7 +69,7 @@ def read_blend_rend_chunk(path): struct.unpack('>i' if is_big_endian else '= 3600.0: # hours hours = int(time / 3600.0) time = time % 3600.0 - if time >= 60.0: # mins + if time >= 60.0: # minutes minutes = int(time / 60.0) time = time % 60.0 diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py index 9848586a144..6b0ab1c3adc 100644 --- a/release/scripts/modules/bpy_extras/anim_utils.py +++ b/release/scripts/modules/bpy_extras/anim_utils.py @@ -158,7 +158,7 @@ def bake_action(frame_start, # ------------------------------------------------------------------------- # Create action - # incase animation data hassnt been created + # in case animation data hassnt been created atd = obj.animation_data_create() if action is None: action = bpy.data.actions.new("Action") diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index 02959fae534..52050b08bc7 100644 --- a/release/scripts/modules/bpy_extras/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py @@ -43,10 +43,10 @@ def load_image(imagepath, the end will be ignored. :type dirname: string :arg place_holder: if True a new place holder image will be created. - this is usefull so later you can relink the image to its original data. + this is useful so later you can relink the image to its original data. :type place_holder: bool - :arg recursive: If True, directories will be recursivly searched. - Be carefull with this if you have files in your root directory because + :arg recursive: If True, directories will be recursively searched. + Be careful with this if you have files in your root directory because it may take a long time. :type recursive: bool :arg ncase_cmp: on non windows systems, find the correct case for the file. diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index 5d28ceaa34c..3d71feaf79e 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -114,7 +114,7 @@ class ImportHelper: # Axis conversion function, not pretty LUT -# use lookup tabes to convert between any axis +# use lookup table to convert between any axis _axis_convert_matrix = ( ((-1.0, 0.0, 0.0), (0.0, -1.0, 0.0), (0.0, 0.0, 1.0)), ((-1.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, -1.0, 0.0)), @@ -302,7 +302,7 @@ def free_derived_objects(ob): def unpack_list(list_of_tuples): flat_list = [] - flat_list_extend = flat_list.extend # a tich faster + flat_list_extend = flat_list.extend # a tiny bit faster for t in list_of_tuples: flat_list_extend(t) return flat_list @@ -318,7 +318,7 @@ def unpack_face_list(list_of_tuples): if len(t) == 3: if t[2] == 0: t = t[1], t[2], t[0] - else: # assuem quad + else: # assume quad if t[3] == 0 or t[2] == 0: t = t[2], t[3], t[0], t[1] @@ -371,7 +371,7 @@ def path_reference(filepath, :arg copy_subdir: the subdirectory of *base_dst* to use when mode='COPY'. :type copy_subdir: string :arg copy_set: collect from/to pairs when mode='COPY', - pass to *path_reference_copy* when exportign is done. + pass to *path_reference_copy* when exporting is done. :type copy_set: set :arg library: The library this path is relative to. :type library: :class:`bpy.types.Library` or None @@ -450,7 +450,7 @@ def unique_name(key, name, name_dict, name_max=-1, clean_func=None, sep="."): :arg key: unique item this name belongs to, name_dict[key] will be reused when available. This can be the object, mesh, material, etc instance its self. - :type key: any hashable object assosiated with the *name*. + :type key: any hashable object associated with the *name*. :arg name: The name used to create a unique value in *name_dict*. :type name: string :arg name_dict: This is used to cache namespace to ensure no collisions diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index b0ff787fc69..53297dbea32 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -21,7 +21,7 @@ KM_HIERARCHY = [ ('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit ('Screen', 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot - ('Screen Editing', 'EMPTY', 'WINDOW', []), # resizing, action corners + ('Screen Editing', 'EMPTY', 'WINDOW', []), # re-sizing, action corners ]), ('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region) diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py index 7bc6dae3cc6..8149675000f 100644 --- a/release/scripts/modules/bpy_extras/mesh_utils.py +++ b/release/scripts/modules/bpy_extras/mesh_utils.py @@ -50,7 +50,7 @@ def mesh_linked_faces(mesh): face_groups = [[f] for f in mesh.faces] face_mapping = list(range(len(mesh.faces))) # map old, new face location - # Now clump faces iterativly + # Now clump faces iteratively ok = True while ok: ok = False diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 3081e6f172e..c9c1dc05476 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -119,7 +119,7 @@ def object_data_add(context, obdata, operator=None): obj_act = scene.objects.active # XXX - # caused because entering editmodedoes not add a empty undo slot! + # caused because entering edit-mode does not add a empty undo slot! if context.user_preferences.edit.use_enter_edit_mode: if not (obj_act and obj_act.mode == 'EDIT' and diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index c18a74bbb09..32f7b654690 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -27,7 +27,7 @@ __all__ = ( def region_2d_to_vector_3d(region, rv3d, coord): """ - Return a direction vector from the viewport at the spesific 2d region + Return a direction vector from the viewport at the specific 2d region coordinate. :arg region: region of the 3D viewport, typically bpy.context.region. diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 6b65f720a5c..cee0712e814 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -49,7 +49,7 @@ class Library(bpy_types.ID): @property def users_id(self): - """ID datablocks which use this library""" + """ID data blocks which use this library""" import bpy # See: readblenentry.c, IDTYPE_FLAGS_ISLINKABLE, we could make this an attribute in rna. @@ -220,9 +220,9 @@ class _GenericBone: @property def children_recursive_basename(self): """ - Returns a chain of children with the same base name as this bone - Only direct chains are supported, forks caused by multiple children with matching basenames will - terminate the function and not be returned. + Returns a chain of children with the same base name as this bone. + Only direct chains are supported, forks caused by multiple children + with matching base names will terminate the function and not be returned. """ basename = self.basename chain = [] @@ -256,7 +256,7 @@ class _GenericBone: bones = id_data.pose.bones elif id_data_type == bpy_types.Armature: bones = id_data.edit_bones - if not bones: # not in editmode + if not bones: # not in edit mode bones = id_data.bones return bones @@ -284,11 +284,11 @@ class EditBone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup): def transform(self, matrix, scale=True, roll=True): """ - Transform the the bones head, tail, roll and envalope (when the matrix has a scale component). + Transform the the bones head, tail, roll and envelope (when the matrix has a scale component). :arg matrix: 3x3 or 4x4 transformation matrix. :type matrix: :class:`mathutils.Matrix` - :arg scale: Scale the bone envalope by the matrix. + :arg scale: Scale the bone envelope by the matrix. :type scale: bool :arg roll: Correct the roll to point in the same relative direction to the head and tail. :type roll: bool @@ -318,7 +318,7 @@ class Mesh(bpy_types.ID): def from_pydata(self, vertices, edges, faces): """ - Make a mesh from a list of verts/edges/faces + Make a mesh from a list of vertices/edges/faces Until we have a nicer way to make geometry, use this. :arg vertices: float triplets each representing (X, Y, Z) eg: [(0.0, 1.0, 0.5), ...]. @@ -553,7 +553,7 @@ class _GenericUI: operator_context_default = self.layout.operator_context for func in draw_ls._draw_funcs: - # so bad menu functions dont stop the entire menu from drawing. + # so bad menu functions don't stop the entire menu from drawing try: func(self, context) except: diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py index 94d0c8c8614..f11ccf84f0b 100644 --- a/release/scripts/modules/console_python.py +++ b/release/scripts/modules/console_python.py @@ -50,7 +50,7 @@ def replace_help(namespace): def get_console(console_id): ''' helper function for console operators - currently each text datablock gets its own + currently each text data block gets its own console - code.InteractiveConsole() ...which is stored in this function. @@ -65,7 +65,7 @@ def get_console(console_id): consoles = get_console.consoles = {} get_console.consoles_namespace_hash = hash_next else: - # check if clearning the namespace is needed to avoid a memory leak. + # check if clearing the namespace is needed to avoid a memory leak. # the window manager is normally loaded with new blend files # so this is a reasonable way to deal with namespace clearing. # bpy.data hashing is reset by undo so cant be used. @@ -135,7 +135,7 @@ def execute(context): sys.stdout = stdout sys.stderr = stderr - # dont allow the stdin to be used, can lock blender. + # don't allow the stdin to be used, can lock blender. stdin_backup = sys.stdin sys.stdin = None @@ -143,14 +143,14 @@ def execute(context): main_mod_back = sys.modules["__main__"] sys.modules["__main__"] = console._bpy_main_mod - # incase exception happens - line = "" # incase of encodingf error + # in case exception happens + line = "" # in case of encoding error is_multiline = False try: line = line_object.body - # run the console, "\n" executes a multiline statement + # run the console, "\n" executes a multi line statement line_exec = line if line.strip() else "\n" is_multiline = console.push(line_exec) @@ -222,8 +222,8 @@ def autocomplete(context): if not console: return {'CANCELLED'} - # dont allow the stdin to be used, can lock blender. - # note: unlikely stdin would be used for autocomp. but its possible. + # don't allow the stdin to be used, can lock blender. + # note: unlikely stdin would be used for autocomplete. but its possible. stdin_backup = sys.stdin sys.stdin = None @@ -238,8 +238,8 @@ def autocomplete(context): current_line = sc.history[-1] line = current_line.body - # This function isnt aware of the text editor or being an operator - # just does the autocomp then copy its results back + # This function isn't aware of the text editor or being an operator + # just does the autocomplete then copy its results back result = intellisense.expand( line=line, cursor=current_line.current_character, @@ -250,7 +250,7 @@ def autocomplete(context): current_line.body, current_line.current_character, scrollback = result del result - # update sel. setting body should really do this! + # update selection. setting body should really do this! ofs = len(line_new) - len(line) sc.select_start += ofs sc.select_end += ofs @@ -263,12 +263,12 @@ def autocomplete(context): if _BPY_MAIN_OWN: sys.modules["__main__"] = main_mod_back - # Separate automplete output by command prompts + # Separate autocomplete output by command prompts if scrollback != '': bpy.ops.console.scrollback_append(text=sc.prompt + current_line.body, type='INPUT') # Now we need to copy back the line from blender back into the - # text editor. This will change when we dont use the text editor + # text editor. This will change when we don't use the text editor # anymore if scrollback: add_scrollback(scrollback, 'INFO') diff --git a/release/scripts/modules/console_shell.py b/release/scripts/modules/console_shell.py index 7a6f45c426f..772d46c8bf3 100644 --- a/release/scripts/modules/console_shell.py +++ b/release/scripts/modules/console_shell.py @@ -64,7 +64,7 @@ def execute(context): def autocomplete(context): - # sc = context.space_data + #~ sc = context.space_data # TODO return {'CANCELLED'} diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py index d95c3920cf9..4116bfda0c7 100644 --- a/release/scripts/modules/rna_info.py +++ b/release/scripts/modules/rna_info.py @@ -292,7 +292,7 @@ class InfoPropertyRNA: elif as_arg: if not self.is_required: type_info.append("optional") - else: # readonly is only useful for selfs, not args + else: # readonly is only useful for self's, not args if self.is_readonly: type_info.append("readonly") @@ -519,7 +519,7 @@ def BuildRNAInfo(): # Done ordering structs - # precalc vars to avoid a lot of looping + # precalculate vars to avoid a lot of looping for (rna_base, identifier, rna_struct) in structs: # rna_struct_path = full_rna_struct_path(rna_struct) @@ -634,7 +634,7 @@ if __name__ == "__main__": struct = rna_info.BuildRNAInfo()[0] data = [] for struct_id, v in sorted(struct.items()): - struct_id_str = v.identifier # "".join(sid for sid in struct_id if struct_id) + struct_id_str = v.identifier #~ "".join(sid for sid in struct_id if struct_id) for base in v.get_bases(): struct_id_str = base.identifier + "|" + struct_id_str diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py index 7d1f3b8f5f0..3051914cf00 100644 --- a/release/scripts/startup/bl_operators/anim.py +++ b/release/scripts/startup/bl_operators/anim.py @@ -87,7 +87,7 @@ class ANIM_OT_keying_set_export(Operator): # -------------------------------------------------------- # generate and write set of lookups for id's used in paths - # cache for syncing ID-blocks to bpy paths + shorthands + # cache for syncing ID-blocks to bpy paths + shorthand's id_to_paths_cache = {} for ksp in ks.paths: diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py index 109ca758ea8..8afcdf5f67e 100644 --- a/release/scripts/startup/bl_operators/console.py +++ b/release/scripts/startup/bl_operators/console.py @@ -62,7 +62,7 @@ class ConsoleAutocomplete(Operator): class ConsoleBanner(Operator): - '''Print a message whem the terminal initializes''' + '''Print a message when the terminal initializes''' bl_idname = "console.banner" bl_label = "Console Banner" @@ -97,7 +97,7 @@ class ConsoleLanguage(Operator): def execute(self, context): sc = context.space_data - # defailt to python + # default to python sc.language = self.language bpy.ops.console.banner() diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index d7c6cfc0565..51c530db672 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -174,7 +174,7 @@ class SelectHierarchy(Operator): select_new.sort(key=lambda obj_iter: obj_iter.name) act_new = select_new[0] - # dont edit any object settings above this + # don't edit any object settings above this if select_new: if not self.extend: bpy.ops.object.select_all(action='DESELECT') @@ -331,7 +331,7 @@ class ShapeTransfer(Operator): orig_shape_coords = me_cos(ob_act.active_shape_key.data) orig_normals = me_nos(me.vertices) - # the actual mverts location isnt as relyable as the base shape :S + # the actual mverts location isn't as reliable as the base shape :S # orig_coords = me_cos(me.vertices) orig_coords = me_cos(me.shape_keys.key_blocks[0].data) @@ -721,8 +721,8 @@ class TransformsToDeltasAnim(Operator): fcu.data_path = "delta_rotation_quaternion" obj.rotation_quaternion.identity() # XXX: currently not implemented - # elif fcu.data_path == "rotation_axis_angle": - # fcu.data_path = "delta_rotation_axis_angle" + #~ elif fcu.data_path == "rotation_axis_angle": + #~ fcu.data_path = "delta_rotation_axis_angle" elif fcu.data_path == "scale": fcu.data_path = "delta_scale" obj.scale = 1.0, 1.0, 1.0 diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py index 05656f5397d..324414b8bcb 100644 --- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py +++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py @@ -104,13 +104,13 @@ def extend(obj, operator, EXTEND_MODE): uvs_vhash_target[edgepair_inner_target[1]][:] = uvs_vhash_source[edgepair_inner_source[iB]] # Set the 2 UV's on the target face that are not touching - # for this we need to do basic expaning on the source faces UV's + # for this we need to do basic expanding on the source faces UV's if EXTEND_MODE == 'LENGTH': try: # divide by zero is possible ''' measure the length of each face from the middle of each edge to the opposite - allong the axis we are copying, use this + along the axis we are copying, use this ''' i1a = edgepair_outer_target[iB] i2a = edgepair_inner_target[iA] @@ -158,11 +158,11 @@ def extend(obj, operator, EXTEND_MODE): # Modes # 0 unsearched # 1:mapped, use search from this face. - removed!! - # 2:all siblings have been searched. dont search again. + # 2:all siblings have been searched. don't search again. face_modes = [0] * len(face_sel) face_modes[face_act_local_index] = 1 # extend UV's from this face. - # Edge connectivty + # Edge connectivity edge_faces = {} for i, f in enumerate(face_sel): for edkey in f.edge_keys: @@ -181,7 +181,7 @@ def extend(obj, operator, EXTEND_MODE): looplen[0] += (me_verts[ed[0]].co - me_verts[ed[1]].co).length looplen[0] = looplen[0] / len(loop) - # remove seams, so we dont map accross seams. + # remove seams, so we don't map across seams. for ed in me.edges: if ed.use_seam: # remove the edge pair if we can @@ -213,7 +213,7 @@ def extend(obj, operator, EXTEND_MODE): face_modes[i] = 1 # we can map from this one now. ok = True # keep searching - face_modes[i] = 2 # dont search again + face_modes[i] = 2 # don't search again if is_editmode: bpy.ops.object.mode_set(mode='EDIT') diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py index d9cdb1794c2..52548817620 100644 --- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py +++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py @@ -36,7 +36,7 @@ class prettyface(object): def __init__(self, data): self.has_parent = False - self.rot = False # only used for triables + self.rot = False # only used for triangles self.xoff = 0 self.yoff = 0 @@ -157,7 +157,7 @@ class prettyface(object): angles_co.sort() I = [i for a, i in angles_co] - # fuv = f.uv + #~ fuv = f.uv fuv = f.id_data.uv_textures.active.data[f.index].uv # XXX25 if self.rot: @@ -200,8 +200,8 @@ def lightmap_uvpack(meshes, ''' BOX_DIV if the maximum division of the UV map that a box may be consolidated into. - Basicly, a lower value will be slower but waist less space - and a higher value will have more clumpy boxes but more waisted space + Basically, a lower value will be slower but waist less space + and a higher value will have more clumpy boxes but more wasted space ''' import time from math import sqrt @@ -321,7 +321,7 @@ def lightmap_uvpack(meshes, lengths.append(curr_len) curr_len = curr_len / 2.0 - # Dont allow boxes smaller then the margin + # Don't allow boxes smaller then the margin # since we contract on the margin, boxes that are smaller will create errors # print(curr_len, side_len/MARGIN_DIV) if curr_len / 4.0 < side_len / PREF_MARGIN_DIV: @@ -371,9 +371,9 @@ def lightmap_uvpack(meshes, print("...done") # Since the boxes are sized in powers of 2, we can neatly group them into bigger squares - # this is done hierarchily, so that we may avoid running the pack function + # this is done hierarchically, so that we may avoid running the pack function # on many thousands of boxes, (under 1k is best) because it would get slow. - # Using an off and even dict us usefull because they are packed differently + # Using an off and even dict us useful because they are packed differently # where w/h are the same, their packed in groups of 4 # where they are different they are packed in pairs # @@ -393,14 +393,14 @@ def lightmap_uvpack(meshes, # Count the number of boxes consolidated, only used for stats. c = 0 - # This is tricky. the total area of all packed boxes, then squt that to get an estimated size + # This is tricky. the total area of all packed boxes, then sqrt() that to get an estimated size # this is used then converted into out INT space so we can compare it with # the ints assigned to the boxes size - # and divided by BOX_DIV, basicly if BOX_DIV is 8 - # ...then the maximum box consolidataion (recursive grouping) will have a max width & height + # and divided by BOX_DIV, basically if BOX_DIV is 8 + # ...then the maximum box consolidation (recursive grouping) will have a max width & height # ...1/8th of the UV size. # ...limiting this is needed or you end up with bug unused texture spaces - # ...however if its too high, boxpacking is way too slow for high poly meshes. + # ...however if its too high, box-packing is way too slow for high poly meshes. float_to_int_factor = lengths_to_ints[0][0] if float_to_int_factor > 0: max_int_dimension = int(((side_len / float_to_int_factor)) / PREF_BOX_DIV) @@ -409,7 +409,7 @@ def lightmap_uvpack(meshes, max_int_dimension = 0.0 # wont be used ok = False - # RECURSIVE prettyface grouping + # RECURSIVE pretty face grouping while ok: ok = False @@ -456,7 +456,7 @@ def lightmap_uvpack(meshes, pretty_faces = [pf for pf in pretty_faces if not pf.has_parent] - # spin every second prettyface + # spin every second pretty-face # if there all vertical you get less efficiently used texture space i = len(pretty_faces) d = 0 diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index 5985a37a0c9..1248fc24ed7 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -34,7 +34,7 @@ USER_FILL_HOLES_QUALITY = None def pointInTri2D(v, v1, v2, v3): key = v1.x, v1.y, v2.x, v2.y, v3.x, v3.y - # Commented because its slower to do the bounds check, we should realy cache the bounds info for each face. + # Commented because its slower to do the bounds check, we should really cache the bounds info for each face. ''' # BOUNDS CHECK xmin= 1000000 @@ -119,7 +119,7 @@ def boundsEdgeLoop(edges): """ # Turns the islands into a list of unpordered edges (Non internal) -# Onlt for UV's +# Only for UV's # only returns outline edges for intersection tests. and unique points. def island2Edge(island): @@ -141,7 +141,7 @@ def island2Edge(island): else: i1= vIdx; i2= vIdx-1 - try: edges[ f_uvkey[i1], f_uvkey[i2] ] *= 0 # sets eny edge with more then 1 user to 0 are not returned. + try: edges[ f_uvkey[i1], f_uvkey[i2] ] *= 0 # sets any edge with more then 1 user to 0 are not returned. except: edges[ f_uvkey[i1], f_uvkey[i2] ] = (f.uv[i1] - f.uv[i2]).length, # If 2 are the same then they will be together, but full [a,b] order is not correct. @@ -162,10 +162,10 @@ def island2Edge(island): return length_sorted_edges, [v.to_3d() for v in unique_points.values()] # ========================= NOT WORKING???? -# Find if a points inside an edge loop, un-orderd. +# Find if a points inside an edge loop, un-ordered. # pt is and x/y # edges are a non ordered loop of edges. -# #offsets are the edge x and y offset. +# offsets are the edge x and y offset. """ def pointInEdges(pt, edges): # @@ -223,7 +223,7 @@ def islandIntersectUvIsland(source, target, SourceOffset): if pointInIsland(pv+SourceOffset, target[0]): return 2 # SOURCE INSIDE TARGET - # 2 test for a part of the target being totaly inside the source. + # 2 test for a part of the target being totally inside the source. for pv in target[7]: if pointInIsland(pv-SourceOffset, source[0]): return 3 # PART OF TARGET INSIDE SOURCE. @@ -242,7 +242,7 @@ def testNewVecLs2DRotIsBetter(vecs, mat=-1, bestAreaSoFar = -1): for i, v in enumerate(vecs): - # Do this allong the way + # Do this along the way if mat != -1: v = vecs[i] = mat * v x= v.x @@ -252,7 +252,7 @@ def testNewVecLs2DRotIsBetter(vecs, mat=-1, bestAreaSoFar = -1): if x>maxx: maxx= x if y>maxy: maxy= y - # Spesific to this algo, bail out if we get bigger then the current area + # Specific to this algo, bail out if we get bigger then the current area if bestAreaSoFar != -1 and (maxx-minx) * (maxy-miny) > bestAreaSoFar: return (BIG_NUM, None), None w = maxx-minx @@ -262,7 +262,7 @@ def testNewVecLs2DRotIsBetter(vecs, mat=-1, bestAreaSoFar = -1): def optiRotateUvIsland(faces): global currentArea - # Bestfit Rotation + # Best-fit Rotation def best2dRotation(uvVecs, MAT1, MAT2): global currentArea @@ -318,7 +318,7 @@ def optiRotateUvIsland(faces): currentArea = newAreaPos # 45d done - # Testcase different rotations and find the onfe that best fits in a square + # Testcase different rotations and find the one that best fits in a square for ROTMAT in RotMatStepRotation: uvVecs = best2dRotation(uvVecs, ROTMAT[0], ROTMAT[1]) @@ -409,7 +409,7 @@ def mergeUvIslands(islandList): BREAK= False while areaIslandIdx < len(decoratedIslandListAreaSort) and not BREAK: sourceIsland = decoratedIslandListAreaSort[areaIslandIdx] - # Alredy packed? + # Already packed? if not sourceIsland[0]: areaIslandIdx+=1 else: @@ -420,7 +420,7 @@ def mergeUvIslands(islandList): BREAK= True break - # Now we have 2 islands, is the efficience of the islands lowers theres an + # Now we have 2 islands, if the efficiency of the islands lowers theres an # increasing likely hood that we can fit merge into the bigger UV island. # this ensures a tight fit. @@ -435,12 +435,12 @@ def mergeUvIslands(islandList): pass else: - # ([island, totFaceArea, efficiency, islandArea, w,h]) - # Waisted space on target is greater then UV bounding island area. + #~ ([island, totFaceArea, efficiency, islandArea, w,h]) + # Wasted space on target is greater then UV bounding island area. - # if targetIsland[3] > (sourceIsland[2]) and\ # - # print USER_FREE_SPACE_TO_TEST_QUALITY + #~ if targetIsland[3] > (sourceIsland[2]) and\ # + #~ print USER_FREE_SPACE_TO_TEST_QUALITY if targetIsland[2] > (sourceIsland[1] * USER_FREE_SPACE_TO_TEST_QUALITY) and\ targetIsland[4] > sourceIsland[4] and\ targetIsland[5] > sourceIsland[5]: @@ -456,7 +456,7 @@ def mergeUvIslands(islandList): boxLeft = 0 - # Distllllance we can move between whilst staying inside the targets bounds. + # Distance we can move between whilst staying inside the targets bounds. testWidth = targetIsland[4] - sourceIsland[4] testHeight = targetIsland[5] - sourceIsland[5] @@ -474,25 +474,25 @@ def mergeUvIslands(islandList): boxLeft = 0 # Start 1 back so we can jump into the loop. boxBottom= 0 #-yIncrement - ##testcount= 0 + #~ testcount= 0 while boxBottom <= testHeight: # Should we use this? - not needed for now. - #if Window.GetKeyQualifiers() & ctrl: - # BREAK= True - # break + #~ if Window.GetKeyQualifiers() & ctrl: + #~ BREAK= True + #~ break ##testcount+=1 #print 'Testing intersect' Intersect = islandIntersectUvIsland(sourceIsland, targetIsland, Vector((boxLeft, boxBottom))) #print 'Done', Intersect - if Intersect == 1: # Line intersect, dont bother with this any more + if Intersect == 1: # Line intersect, don't bother with this any more pass if Intersect == 2: # Source inside target ''' We have an intersection, if we are inside the target - then move us 1 whole width accross, + then move us 1 whole width across, Its possible this is a bad idea since 2 skinny Angular faces could join without 1 whole move, but its a lot more optimal to speed this up since we have already tested for it. @@ -500,7 +500,7 @@ def mergeUvIslands(islandList): It gives about 10% speedup with minimal errors. ''' #print 'ass' - # Move the test allong its width + SMALL_NUM + # Move the test along its width + SMALL_NUM #boxLeft += sourceIsland[4] + SMALL_NUM boxLeft += sourceIsland[4] elif Intersect == 0: # No intersection?? Place it. @@ -551,7 +551,7 @@ def mergeUvIslands(islandList): break - # INCREMENR NEXT LOCATION + # INCREMENT NEXT LOCATION if boxLeft > testWidth: boxBottom += yIncrement boxLeft = 0.0 @@ -572,8 +572,8 @@ def mergeUvIslands(islandList): # Takes groups of faces. assumes face groups are UV groups. def getUvIslands(faceGroups, me): - # Get seams so we dont cross over seams - edge_seams = {} # shoudl be a set + # Get seams so we don't cross over seams + edge_seams = {} # should be a set for ed in me.edges: if ed.use_seam: edge_seams[ed.key] = None # dummy var- use sets! @@ -609,7 +609,7 @@ def getUvIslands(faceGroups, me): # Modes # 0 - face not yet touched. # 1 - added to island list, and need to search - # 2 - touched and searched - dont touch again. + # 2 - touched and searched - don't touch again. face_modes = [0] * len(faces) # initialize zero - untested. face_modes[0] = 1 # start the search with face 1 @@ -633,7 +633,7 @@ def getUvIslands(faceGroups, me): face_modes[ii] = ok = 1 # mark as searched newIsland.append(faces[ii]) - # mark as searched, dont look again. + # mark as searched, don't look again. face_modes[i] = 2 islandList.append(newIsland) @@ -664,8 +664,8 @@ def packIslands(islandList): # Now we have UV islands, we need to pack them. - # Make a synchronised list with the islands - # so we can box pak the islands. + # Make a synchronized list with the islands + # so we can box pack the islands. packBoxes = [] # Keep a list of X/Y offset so we can save time by writing the @@ -716,14 +716,14 @@ def packIslands(islandList): # print 'Box Packing Time:', time.time() - time1 #if len(pa ckedLs) != len(islandList): - # raise "Error packed boxes differes from original length" + # raise "Error packed boxes differs from original length" #print '\tWriting Packed Data to faces' #XXX Window.DrawProgressBar(0.8, 'Writing Packed Data to faces') # Sort by ID, so there in sync again islandIdx = len(islandList) - # Having these here avoids devide by 0 + # Having these here avoids divide by 0 if islandIdx: if USER_STRETCH_ASPECT: @@ -845,9 +845,9 @@ def main(context, time.sleep(10) ''' -#XXX if not Draw.PupBlock(ob % len(obList), pup_block): -#XXX return -#XXX del ob +#~ XXX if not Draw.PupBlock(ob % len(obList), pup_block): +#~ XXX return +#~ XXX del ob # Convert from being button types @@ -859,10 +859,10 @@ def main(context, is_editmode = (context.active_object.mode == 'EDIT') if is_editmode: bpy.ops.object.mode_set(mode='OBJECT') - # Assume face select mode! an annoying hack to toggle face select mode because Mesh dosent like faceSelectMode. + # Assume face select mode! an annoying hack to toggle face select mode because Mesh doesn't like faceSelectMode. if USER_SHARE_SPACE: - # Sort by data name so we get consistant results + # Sort by data name so we get consistent results obList.sort(key = lambda ob: ob.data.name) collected_islandList= [] @@ -870,7 +870,7 @@ def main(context, time1 = time.time() - # Tag as False se we dont operate on the same mesh twice. + # Tag as False so we don't operate on the same mesh twice. #XXX bpy.data.meshes.tag = False for me in bpy.data.meshes: me.tag = False @@ -885,7 +885,7 @@ def main(context, # Tag as used me.tag = True - if not me.uv_textures: # Mesh has no UV Coords, dont bother. + if not me.uv_textures: # Mesh has no UV Coords, don't bother. me.uv_textures.new() uv_layer = me.uv_textures.active.data @@ -902,7 +902,7 @@ def main(context, #XXX Window.DrawProgressBar(0.1, 'SmartProj UV Unwrapper, mapping "%s", %i faces.' % (me.name, len(meshFaces))) # ======= - # Generate a projection list from face normals, this is ment to be smart :) + # Generate a projection list from face normals, this is meant to be smart :) # make a list of face props that are in sync with meshFaces # Make a Face List that is sorted by area. @@ -928,7 +928,7 @@ def main(context, # Initialize projectVecs if USER_VIEW_INIT: # Generate Projection - projectVecs = [Vector(Window.GetViewVector()) * ob.matrix_world.inverted().to_3x3()] # We add to this allong the way + projectVecs = [Vector(Window.GetViewVector()) * ob.matrix_world.inverted().to_3x3()] # We add to this along the way else: projectVecs = [] @@ -936,7 +936,7 @@ def main(context, newProjectMeshFaces = [] # Popping stuffs it up. - # Predent that the most unique angke is ages away to start the loop off + # Pretend that the most unique angle is ages away to start the loop off mostUniqueAngle = -1.0 # This is popped @@ -950,7 +950,7 @@ def main(context, # add all the faces that are close. for fIdx in range(len(tempMeshFaces)-1, -1, -1): - # Use half the angle limit so we dont overweight faces towards this + # Use half the angle limit so we don't overweight faces towards this # normal and hog all the faces. if newProjectVec.dot(tempMeshFaces[fIdx].no) > USER_PROJECTION_LIMIT_HALF_CONVERTED: newProjectMeshFaces.append(tempMeshFaces.pop(fIdx)) diff --git a/release/scripts/startup/bl_operators/vertexpaint_dirt.py b/release/scripts/startup/bl_operators/vertexpaint_dirt.py index 4c78adb7161..ce4942ae238 100644 --- a/release/scripts/startup/bl_operators/vertexpaint_dirt.py +++ b/release/scripts/startup/bl_operators/vertexpaint_dirt.py @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# ***** END GPL LICENCE BLOCK ***** +# ***** END GPL LICENSE BLOCK ***** # -------------------------------------------------------------------------- # @@ -69,7 +69,7 @@ def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean, vec /= tot_con - # angle is the acos of the dot product between vert and connected verts normals + # angle is the acos() of the dot product between vert and connected verts normals ang = acos(no.dot(vec)) # enforce min/max diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py index 05b53219119..315b7e5c4fc 100644 --- a/release/scripts/startup/bl_operators/view3d.py +++ b/release/scripts/startup/bl_operators/view3d.py @@ -33,7 +33,7 @@ class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator): totface = mesh.total_face_sel totedge = mesh.total_edge_sel - # totvert = mesh.total_vert_sel + #~ totvert = mesh.total_vert_sel if select_mode[2] and totface == 1: bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', @@ -65,7 +65,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator): totface = mesh.total_face_sel totedge = mesh.total_edge_sel - # totvert = mesh.total_vert_sel + #~ totvert = mesh.total_vert_sel if totface >= 1: bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 85e79914ce3..63104ca00c3 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -70,7 +70,7 @@ def context_path_validate(context, data_path): # One of the items in the rna path is None, just ignore this value = Ellipsis else: - # We have a real error in the rna path, dont ignore that + # We have a real error in the rna path, don't ignore that raise return value @@ -103,7 +103,7 @@ def operator_value_is_undo(value): def operator_path_is_undo(context, data_path): # note that if we have data paths that use strings this could fail - # luckily we dont do this! + # luckily we don't do this! # # When we cant find the data owner assume no undo is needed. data_path_head, data_path_sep, data_path_tail = data_path.rpartition(".") @@ -425,7 +425,7 @@ class WM_OT_context_cycle_enum(Operator): rna_struct_str, rna_prop_str = data_path.rsplit('.', 1) i = rna_prop_str.find('[') - # just incse we get "context.foo.bar[0]" + # just in case we get "context.foo.bar[0]" if i != -1: rna_prop_str = rna_prop_str[0:i] @@ -820,8 +820,7 @@ class WM_OT_doc_view(Operator): class_name = rna_parent.identifier rna_parent = rna_parent.base - # It so happens that epydoc nests these, not sphinx - # class_name_full = self._nested_class_string(class_name) + #~ class_name_full = self._nested_class_string(class_name) url = ("%s/bpy.types.%s.html#bpy.types.%s.%s" % (self._prefix, class_name, class_name, class_prop)) @@ -1014,7 +1013,7 @@ class WM_OT_properties_edit(Operator): item = eval("context.%s" % data_path) # setup defaults - prop_ui = rna_idprop_ui_prop_get(item, self.property, False) # dont create + prop_ui = rna_idprop_ui_prop_get(item, self.property, False) # don't create if prop_ui: self.min = prop_ui.get("min", -1000000000) self.max = prop_ui.get("max", 1000000000) @@ -1171,7 +1170,7 @@ class WM_OT_copy_prev_settings(Operator): shutil.rmtree(os.path.join(path_dst, 'scripts')) shutil.rmtree(os.path.join(path_dst, 'plugins')) - # dont loose users work if they open the splash later. + # don't loose users work if they open the splash later. if bpy.data.is_saved is bpy.data.is_dirty is False: bpy.ops.wm.read_homefile() else: @@ -1372,9 +1371,9 @@ class WM_OT_keyitem_add(Operator): km = context.keymap if km.is_modal: - km.keymap_items.new_modal("", 'A', 'PRESS') # kmi + km.keymap_items.new_modal("", 'A', 'PRESS') #~ kmi else: - km.keymap_items.new("none", 'A', 'PRESS') # kmi + km.keymap_items.new("none", 'A', 'PRESS') #~ kmi # clear filter and expand keymap so we can see the newly added item if context.space_data.filter_text != "": @@ -1556,7 +1555,7 @@ class WM_OT_addon_install(Operator): pyfile = self.filepath if self.target == 'DEFAULT': - # dont use bpy.utils.script_paths("addons") because we may not be able to write to it. + # don't use bpy.utils.script_paths("addons") because we may not be able to write to it. path_addons = bpy.utils.user_resource('SCRIPTS', "addons", create=True) else: path_addons = bpy.context.user_preferences.filepaths.script_directory @@ -1637,7 +1636,7 @@ class WM_OT_addon_install(Operator): addons_new.discard("modules") # disable any addons we may have enabled previously and removed. - # this is unlikely but do just incase. bug [#23978] + # this is unlikely but do just in case. bug [#23978] for new_addon in addons_new: addon_utils.disable(new_addon) @@ -1652,11 +1651,11 @@ class WM_OT_addon_install(Operator): context.window_manager.addon_search = info["name"] break - # incase a new module path was created to install this addon. + # in case a new module path was created to install this addon. bpy.utils.refresh_script_paths() # TODO, should not be a warning. - # self.report({'WARNING'}, "File installed to '%s'\n" % path_dest) + #~ self.report({'WARNING'}, "File installed to '%s'\n" % path_dest) return {'FINISHED'} def invoke(self, context, event): @@ -1699,7 +1698,7 @@ class WM_OT_addon_remove(Operator): self.report('WARNING', "Addon path %r could not be found" % path) return {'CANCELLED'} - # incase its enabled + # in case its enabled addon_utils.disable(self.module) import shutil diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py index 3b33a7ccc61..93feb8adc7a 100644 --- a/release/scripts/startup/bl_ui/properties_animviz.py +++ b/release/scripts/startup/bl_ui/properties_animviz.py @@ -21,8 +21,8 @@ # Generic Panels (Independent of DataType) # NOTE: -# The specialised panel types are derived in their respective UI modules -# dont register these classes since they are only helpers. +# The specialized panel types are derived in their respective UI modules +# don't register these classes since they are only helpers. class MotionPathButtonsPanel(): diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index e4744fdb04f..5dadcba2621 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -214,7 +214,7 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel): layout.prop(pose_marker_active, "name") -# TODO: this panel will soon be depreceated too +# TODO: this panel will soon be deprecated deprecated too class DATA_PT_ghost(ArmatureButtonsPanel, Panel): bl_label = "Ghost" @@ -301,7 +301,7 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel): @classmethod def poll(cls, context): - # XXX: include posemode check? + # XXX: include pose-mode check? return (context.object) and (context.armature) def draw(self, context): @@ -324,7 +324,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from @classmethod def poll(cls, context): - # XXX: include posemode check? + # XXX: include pose-mode check? return (context.object) and (context.armature) def draw(self, context): diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py index b3eaf88d5bf..807e5e63bc5 100644 --- a/release/scripts/startup/bl_ui/properties_data_bone.py +++ b/release/scripts/startup/bl_ui/properties_data_bone.py @@ -189,7 +189,7 @@ class BONE_PT_display(BoneButtonsPanel, Panel): return context.bone def draw(self, context): - # note. this works ok in editmode but isnt + # note. this works ok in edit-mode but isn't # all that useful so disabling for now. layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 5b00402520e..62cb735fda9 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -87,7 +87,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): - # An exception, dont call the parent poll func because + # An exception, don't call the parent poll func because # this manages materials for all engine types engine = context.scene.render.engine @@ -537,7 +537,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, Panel): def draw(self, context): layout = self.layout - mat = context.material # dont use node material + mat = context.material # don't use node material halo = mat.halo def number_but(layout, toggle, number, name, color): @@ -595,7 +595,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, Panel): def draw(self, context): layout = self.layout - mat = context.material # dont use node material + mat = context.material # don't use node material halo = mat.halo layout.active = halo.use_flare_mode @@ -622,7 +622,7 @@ class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel): def draw(self, context): layout = self.layout - game = context.material.game_settings # dont use node material + game = context.material.game_settings # don't use node material row = layout.row() row.prop(game, "use_backface_culling") @@ -653,7 +653,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel): layout = self.layout layout.active = context.material.game_settings.physics - phys = context.material.physics # dont use node material + phys = context.material.physics # don't use node material split = layout.split() row = split.row() @@ -686,7 +686,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, Panel): def draw(self, context): layout = self.layout - mat = context.material # dont use node material + mat = context.material # don't use node material tan = mat.strand split = layout.split() @@ -862,7 +862,7 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel, Panel): def draw(self, context): layout = self.layout - vol = context.material.volume # dont use node material + vol = context.material.volume # don't use node material row = layout.row() row.prop(vol, "density") @@ -876,7 +876,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel, Panel): def draw(self, context): layout = self.layout - vol = context.material.volume # dont use node material + vol = context.material.volume # don't use node material split = layout.split() @@ -901,7 +901,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, Panel): def draw(self, context): layout = self.layout - vol = context.material.volume # dont use node material + vol = context.material.volume # don't use node material split = layout.split() @@ -942,7 +942,7 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel, Panel): def draw(self, context): layout = self.layout - mat = context.material # dont use node material + mat = context.material # don't use node material layout.prop(mat, "transparency_method", expand=True) @@ -954,7 +954,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel, Panel): def draw(self, context): layout = self.layout - vol = context.material.volume # dont use node material + vol = context.material.volume # don't use node material split = layout.split() diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index 69fc51145a7..0b543dbdc74 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -658,7 +658,7 @@ class ConstraintButtonsPanel(): row.label(text="Source to Destination Mapping:") # note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't - # open it. Thus we are using the hardcoded value instead. + # open it. Thus we are using the hard-coded value instead. row = col.row() row.prop(con, "map_to_x_from", expand=False, text="") row.label(text=" %s X" % chr(187)) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index eceefc70b5c..0e7fccae8df 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -405,9 +405,12 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel): layout.enabled = particle_panel_enabled(context, psys) - row = layout.row() - row.label(text="Initial Rotation:") - row.prop(part, "use_dynamic_rotation") + layout.prop(part, "use_dynamic_rotation") + + if part.use_dynamic_rotation: + layout.label(text="Initial Rotation Axis:") + else: + layout.label(text="Rotation Axis:") split = layout.split() @@ -419,12 +422,17 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel): col.prop(part, "phase_factor", slider=True) col.prop(part, "phase_factor_random", text="Random", slider=True) - col = layout.column() - col.label(text="Angular Velocity:") - col.row().prop(part, "angular_velocity_mode", expand=True) - - if part.angular_velocity_mode != 'NONE': - col.prop(part, "angular_velocity_factor", text="") + if part.type != 'HAIR': + col = layout.column() + if part.use_dynamic_rotation: + col.label(text="Initial Angular Velocity:") + else: + col.label(text="Angular Velocity:") + sub = col.row(align=True) + sub.prop(part, "angular_velocity_mode", text="") + subsub = sub.column() + subsub.active = part.angular_velocity_mode != 'NONE' + subsub.prop(part, "angular_velocity_factor", text="") class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): @@ -832,7 +840,9 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): elif part.render_type == 'OBJECT': col.prop(part, "dupli_object") - col.prop(part, "use_global_dupli") + sub = col.row() + sub.prop(part, "use_global_dupli") + sub.prop(part, "use_rotation_dupli") elif part.render_type == 'GROUP': col.prop(part, "dupli_group") split = layout.split() @@ -841,13 +851,14 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): col.prop(part, "use_whole_group") sub = col.column() sub.active = (part.use_whole_group is False) + sub.prop(part, "use_group_pick_random") sub.prop(part, "use_group_count") col = split.column() sub = col.column() sub.active = (part.use_whole_group is False) sub.prop(part, "use_global_dupli") - sub.prop(part, "use_group_pick_random") + sub.prop(part, "use_rotation_dupli") if part.use_group_count and not part.use_whole_group: row = layout.row() diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 204e25d9f01..64dad98d99a 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -76,7 +76,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel): physics_add(self, col, context.smoke, "Smoke", 'SMOKE', 'MOD_SMOKE', True) -#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc +# cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc def point_cache_ui(self, context, cache, enabled, cachetype): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 34f5a948ee7..73947c21a80 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -927,9 +927,9 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): factor_but(col, "use_map_warp", "warp_factor", "Warp") factor_but(col, "use_map_displacement", "displacement_factor", "Displace") - #sub = col.column() - #sub.active = tex.use_map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror - #sub.prop(tex, "default_value", text="Amount", slider=True) + #~ sub = col.column() + #~ sub.active = tex.use_map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror + #~ sub.prop(tex, "default_value", text="Amount", slider=True) elif idblock.type == 'HALO': layout.label(text="Halo:") @@ -1014,7 +1014,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): col = split.column() col.prop(tex, "blend_type", text="Blend") col.prop(tex, "use_rgb_to_intensity") - # color is used on grayscale textures even when use_rgb_to_intensity is disabled. + # color is used on gray-scale textures even when use_rgb_to_intensity is disabled. col.prop(tex, "color", text="") col = split.column() @@ -1027,14 +1027,14 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): if isinstance(idblock, bpy.types.Material): layout.label(text="Bump Mapping:") - # only show bump settings if activated but not for normalmap images + # only show bump settings if activated but not for normal-map images row = layout.row() sub = row.row() sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map)) sub.prop(tex, "bump_method", text="Method") - # the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps + # the space setting is supported for: derivative-maps + bump-maps (DEFAULT,BEST_QUALITY), not for normal-maps sub = row.row() sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) sub.prop(tex, "bump_objectspace", text="Space") diff --git a/release/scripts/startup/bl_ui/space_logic.py b/release/scripts/startup/bl_ui/space_logic.py index 869a91124d3..1ae8095fab3 100644 --- a/release/scripts/startup/bl_ui/space_logic.py +++ b/release/scripts/startup/bl_ui/space_logic.py @@ -45,7 +45,7 @@ class LOGIC_PT_properties(Panel): row = box.row() row.prop(prop, "name", text="") row.prop(prop, "type", text="") - row.prop(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly + row.prop(prop, "value", text="", toggle=True) # we don't care about the type. rna will display correctly row.prop(prop, "show_debug", text="", toggle=True, icon='INFO') row.operator("object.game_property_remove", text="", icon='X', emboss=False).index = i diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 1ec6cc39164..96a08e57157 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -426,8 +426,8 @@ class USERPREF_PT_system(Panel): col.label(text="Anisotropic Filtering") col.prop(system, "anisotropic_filter", text="") col.prop(system, "use_vertex_buffer_objects") - #Anti-aliasing is disabled as it breaks broder/lasso select - #col.prop(system, "use_antialiasing") + # Anti-aliasing is disabled as it breaks border/lasso select + #~ col.prop(system, "use_antialiasing") col.label(text="Window Draw Method:") col.prop(system, "window_draw_method", text="") col.label(text="Text Draw Options:") diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index c2e3a145f36..2c537efa61b 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -262,7 +262,7 @@ class InputKeyMapPanel: row = subcol.row(align=True) - #row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config:") + #~ row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config:") text = bpy.path.display_name(context.window_manager.keyconfigs.active.name) if not text: text = "Blender (default)" @@ -270,8 +270,8 @@ class InputKeyMapPanel: row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMIN") row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMOUT").remove_active = True -# layout.context_pointer_set("keyconfig", wm.keyconfigs.active) -# row.operator("wm.keyconfig_remove", text="", icon='X') + #~ layout.context_pointer_set("keyconfig", wm.keyconfigs.active) + #~ row.operator("wm.keyconfig_remove", text="", icon='X') row.prop(context.space_data, "filter_text", icon="VIEWZOOM") diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 01156196908..a42753afa3b 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1142,7 +1142,7 @@ class VIEW3D_MT_sculpt(Menu): layout.prop(sculpt, "use_threaded", text="Threaded Sculpt") layout.prop(sculpt, "show_brush") - # TODO, make availabel from paint menu! + # TODO, make available from paint menu! layout.prop(tool_settings, "sculpt_paint_use_unified_size", text="Unify Size") layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Unify Strength") @@ -1413,7 +1413,7 @@ class BoneOptions: data_path_iter = "selected_bones" opt_suffix = "" options.append("lock") - else: # posemode + else: # pose-mode bone_props = bpy.types.Bone.bl_rna.properties data_path_iter = "selected_pose_bones" opt_suffix = "bone." @@ -2182,7 +2182,7 @@ class VIEW3D_PT_view3d_meshdisplay(Panel): @classmethod def poll(cls, context): - # The active object check is needed because of localmode + # The active object check is needed because of local-mode return (context.active_object and (context.mode == 'EDIT_MESH')) def draw(self, context): @@ -2243,7 +2243,7 @@ class VIEW3D_PT_background_image(Panel): @classmethod def poll(cls, context): view = context.space_data - # bg = context.space_data.background_image + #~ bg = context.space_data.background_image return (view) def draw_header(self, context): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 8f1833f952b..a78992d4a07 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -63,7 +63,7 @@ def draw_gpencil_tools(context, layout): row.prop(context.tool_settings, "use_grease_pencil_sessions") -# ********** default tools for objectmode **************** +# ********** default tools for object-mode **************** class VIEW3D_PT_tools_objectmode(View3DPanel, Panel): bl_context = "objectmode" @@ -385,7 +385,7 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel, Panel): draw_gpencil_tools(context, layout) -# ********** default tools for posemode **************** +# ********** default tools for pose-mode **************** class VIEW3D_PT_tools_posemode(View3DPanel, Panel): @@ -1043,7 +1043,7 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, Panel): row = col.row(align=True) row.prop(brush, "icon_filepath", text="") -# ********** default tools for weightpaint **************** +# ********** default tools for weight-paint **************** class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel): @@ -1097,9 +1097,9 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel): # col.prop(wpaint, "mul", text="") # Also missing now: -# Soft, Vgroup, X-Mirror and "Clear" Operator. +# Soft, Vertex-Group, X-Mirror and "Clear" Operator. -# ********** default tools for vertexpaint **************** +# ********** default tools for vertex-paint **************** class VIEW3D_PT_tools_vertexpaint(View3DPanel, Panel): @@ -1128,7 +1128,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel, Panel): # col.label(text="Multiply:") # col.prop(vpaint, "mul", text="") -# ********** default tools for texturepaint **************** +# ********** default tools for texture-paint **************** class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): diff --git a/release/scripts/templates/gamelogic_module.py b/release/scripts/templates/gamelogic_module.py index fcc8a8839c9..88c8cf0d75b 100644 --- a/release/scripts/templates/gamelogic_module.py +++ b/release/scripts/templates/gamelogic_module.py @@ -8,7 +8,7 @@ import bge # variables defined here will only be set once when the -# module is first imported. Set object spesific vars +# module is first imported. Set object specific vars # inside the function if you intend to use the module # with multiple objects. diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index bf619d76e68..cf49c479fe3 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -146,7 +146,7 @@ void BKE_animsys_evaluate_animdata(struct Scene *scene, struct ID *id, struct An void BKE_animsys_evaluate_all_animation(struct Main *main, struct Scene *scene, float ctime); -/* ------------ Specialised API --------------- */ +/* ------------ Specialized API --------------- */ /* There are a few special tools which require these following functions. They are NOT to be used * for standard animation evaluation UNDER ANY CIRCUMSTANCES! * diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index f6910fede8e..e01586cb7d0 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -43,8 +43,8 @@ extern "C" { /* these lines are grep'd, watch out for our not-so-awesome regex * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ -#define BLENDER_VERSION 259 -#define BLENDER_SUBVERSION 4 +#define BLENDER_VERSION 260 +#define BLENDER_SUBVERSION 0 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 @@ -53,7 +53,7 @@ extern "C" { /* can be left blank, otherwise a,b,c... etc with no quotes */ #define BLENDER_VERSION_CHAR /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE rc +#define BLENDER_VERSION_CYCLE release struct ListBase; struct MemFile; diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index f8463bab55f..89733f1623c 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -84,7 +84,7 @@ typedef struct SculptSession { int modifiers_active; /* object is deformed with some modifiers */ float (*orig_cos)[3]; /* coords of undeformed mesh */ float (*deform_cos)[3]; /* coords of deformed mesh but without stroke displacement */ - float (*deform_imats)[3][3]; /* crazyspace deformation matricies */ + float (*deform_imats)[3][3]; /* crazyspace deformation matrices */ /* Partial redraw */ int partial_redraw; diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 87684e4895d..f65b937a54b 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -29,7 +29,7 @@ /** \file BKE_utildefines.h * \ingroup bke - * \brief blender format spesific macros + * \brief blender format specific macros * \note generic defines should go in BLI_utildefines.h */ diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index cd2c272a1c2..da6dd5bd39d 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1430,6 +1430,16 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p VECCOPY(vec, obmat[3]); obmat[3][0] = obmat[3][1] = obmat[3][2] = 0.0f; + + /* particle rotation uses x-axis as the aligned axis, so pre-rotate the object accordingly */ + if((part->draw & PART_DRAW_ROTATE_OB) == 0) { + float xvec[3], q[4]; + xvec[0] = -1.f; + xvec[1] = xvec[2] = 0; + vec_to_quat(q, xvec, ob->trackflag, ob->upflag); + quat_to_mat4(obmat, q); + obmat[3][3]= 1.0f; + } /* Normal particles and cached hair live in global space so we need to * remove the real emitter's transformation before 2nd order duplication. @@ -1448,7 +1458,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p copy_m4_m4(mat, tmat); if(part->draw & PART_DRAW_GLOBAL_OB) - VECADD(mat[3], mat[3], vec); + add_v3_v3v3(mat[3], mat[3], vec); dob= new_dupli_object(lb, ob, mat, ob->lay, counter, GS(id->name) == ID_GR ? OB_DUPLIGROUP : OB_DUPLIPARTS, animated); copy_m4_m4(dob->omat, oldobmat); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 1ec573c853a..260b51bc321 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -974,7 +974,7 @@ static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm ) * SPRING NETWORK BUILDING IMPLEMENTATION BEGIN ***************************************************************************************/ -// be carefull: implicit solver has to be resettet when using this one! +// be careful: implicit solver has to be resettet when using this one! // --> only for implicit handling of this spring! int cloth_add_spring ( ClothModifierData *clmd, unsigned int indexA, unsigned int indexB, float restlength, int spring_type) { diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 1b2e2819315..a3b1a1b1e0a 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -4572,7 +4572,7 @@ short proxylocked_constraints_owner (Object *ob, bPoseChannel *pchan) * constraints either had one or no targets. It used to be called during the main constraint solving * loop, but is now only used for the remaining cases for a few constraints. * - * None of the actual calculations of the matricies should be done here! Also, this function is + * None of the actual calculations of the matrices should be done here! Also, this function is * not to be used by any new constraints, particularly any that have multiple targets. */ void get_constraint_target_matrix (struct Scene *scene, bConstraint *con, int n, short ownertype, void *ownerdata, float mat[][4], float ctime) diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index e2326b005c1..0303f580e67 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -705,7 +705,7 @@ void bezt_add_to_cfra_elem (ListBase *lb, BezTriple *bezt) /* ***************************** Samples Utilities ******************************* */ /* Some utilities for working with FPoints (i.e. 'sampled' animation curve data, such as - * data imported from BVH/Mocap files), which are specialised for use with high density datasets, + * data imported from BVH/Mocap files), which are specialized for use with high density datasets, * which BezTriples/Keyframe data are ill equipped to do. */ diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 806a7871948..8669c4e0efd 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -4384,33 +4384,50 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa psys_particle_on_emitter(psmd,sim->psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc,nor,0,0,0,0); else psys_particle_on_emitter(psmd,PART_FROM_FACE,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,loc,nor,0,0,0,0); - - copy_m3_m4(nmat, ob->imat); - transpose_m3(nmat); - mul_m3_v3(nmat, nor); - normalize_v3(nor); - /* make sure that we get a proper side vector */ - if(fabs(dot_v3v3(nor,vec))>0.999999) { - if(fabs(dot_v3v3(nor,xvec))>0.999999) { - nor[0] = 0.0f; - nor[1] = 1.0f; - nor[2] = 0.0f; + if(psys->part->rotmode == PART_ROT_VEL) { + copy_m3_m4(nmat, ob->imat); + transpose_m3(nmat); + mul_m3_v3(nmat, nor); + normalize_v3(nor); + + /* make sure that we get a proper side vector */ + if(fabs(dot_v3v3(nor,vec))>0.999999) { + if(fabs(dot_v3v3(nor,xvec))>0.999999) { + nor[0] = 0.0f; + nor[1] = 1.0f; + nor[2] = 0.0f; + } + else { + nor[0] = 1.0f; + nor[1] = 0.0f; + nor[2] = 0.0f; + } } - else { - nor[0] = 1.0f; - nor[1] = 0.0f; - nor[2] = 0.0f; + cross_v3_v3v3(side, nor, vec); + normalize_v3(side); + + /* rotate side vector around vec */ + if(psys->part->phasefac != 0) { + float q_phase[4]; + float phasefac = psys->part->phasefac; + if(psys->part->randphasefac != 0.0f) + phasefac += psys->part->randphasefac * PSYS_FRAND((pa-psys->particles) + 20); + axis_angle_to_quat( q_phase, vec, phasefac*(float)M_PI); + + mul_qt_v3(q_phase, side); } + + cross_v3_v3v3(nor, vec, side); + + unit_m4(mat); + VECCOPY(mat[0], vec); + VECCOPY(mat[1], side); + VECCOPY(mat[2], nor); + } + else { + quat_to_mat4(mat, pa->state.rot); } - cross_v3_v3v3(side, nor, vec); - normalize_v3(side); - cross_v3_v3v3(nor, vec, side); - - unit_m4(mat); - VECCOPY(mat[0], vec); - VECCOPY(mat[1], side); - VECCOPY(mat[2], nor); *scale= len; } diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index d8d6ed6ea6d..943066537d5 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -827,7 +827,7 @@ static void do_cross_effect_float(float facf0, float facf1, int x, int y, } } -/* carefull: also used by speed effect! */ +/* careful: also used by speed effect! */ static struct ImBuf* do_cross_effect( SeqRenderData context, Sequence *UNUSED(seq), float UNUSED(cfra), diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 88f72c33802..65b4a21d0ee 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -2818,7 +2818,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow); /* finish matrix and solve */ -#if (0) // remove onl linking for now .. still i am not sure .. the jacobian can be usefull .. so keep that BM +#if (0) // remove onl linking for now .. still i am not sure .. the jacobian can be useful .. so keep that BM if(nl_flags & NLF_SOLVE){ //double sct,sst=PIL_check_seconds_timer(); for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { @@ -3540,7 +3540,7 @@ static void lattice_to_softbody(Scene *scene, Object *ob) } } - /* create some helper edges to enable SB lattice to be usefull at all */ + /* create some helper edges to enable SB lattice to be useful at all */ if (ob->softflag & OB_SB_EDGES){ makelatticesprings(lt,ob->soft->bspring,ob->softflag & OB_SB_QUADS,ob); build_bps_springlist(ob); /* link bps to springs */ diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index c53ce9dced5..3ac8dba106a 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -147,6 +147,10 @@ void BLI_ascii_strtoupper(char *str, int len); char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy); int BLI_utf8_invalid_byte(const char *str, int length); int BLI_utf8_invalid_strip(char *str, int length); + /* copied from glib */ +char *BLI_str_find_prev_char_utf8(const char *str, const char *p); +char *BLI_str_find_next_char_utf8(const char *p, const char *end); +char *BLI_str_prev_char_utf8(const char *p); #ifdef __cplusplus } diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index fe1d869f898..21f91ce8f14 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1681,7 +1681,7 @@ void BLI_where_am_i(char *fullname, const size_t maxlen, const char *name) #ifdef WITH_BINRELOC - /* linux uses binreloc since argv[0] is not relyable, call br_init( NULL ) first */ + /* linux uses binreloc since argv[0] is not reliable, call br_init( NULL ) first */ path = br_find_exe( NULL ); if (path) { BLI_strncpy(fullname, path, maxlen); diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 961a41690f7..dc6cb0ef228 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -183,3 +183,83 @@ char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy) return dst_r; } +/* copied from glib */ +/** + * g_utf8_find_prev_char: + * @str: pointer to the beginning of a UTF-8 encoded string + * @p: pointer to some position within @str + * + * Given a position @p with a UTF-8 encoded string @str, find the start + * of the previous UTF-8 character starting before @p. Returns %NULL if no + * UTF-8 characters are present in @str before @p. + * + * @p does not have to be at the beginning of a UTF-8 character. No check + * is made to see if the character found is actually valid other than + * it starts with an appropriate byte. + * + * Return value: a pointer to the found character or %NULL. + **/ +char * BLI_str_find_prev_char_utf8(const char *str, const char *p) +{ + for (--p; p >= str; --p) { + if ((*p & 0xc0) != 0x80) { + return (char *)p; + } + } + return NULL; +} + +/** + * g_utf8_find_next_char: + * @p: a pointer to a position within a UTF-8 encoded string + * @end: a pointer to the byte following the end of the string, + * or %NULL to indicate that the string is nul-terminated. + * + * Finds the start of the next UTF-8 character in the string after @p. + * + * @p does not have to be at the beginning of a UTF-8 character. No check + * is made to see if the character found is actually valid other than + * it starts with an appropriate byte. + * + * Return value: a pointer to the found character or %NULL + **/ +char *BLI_str_find_next_char_utf8(const char *p, const char *end) +{ + if (*p) { + if (end) { + for (++p; p < end && (*p & 0xc0) == 0x80; ++p) { + /* do nothing */ + } + } + else { + for (++p; (*p & 0xc0) == 0x80; ++p) { + /* do nothing */ + } + } + } + return (p == end) ? NULL : (char *)p; +} + +/** + * g_utf8_prev_char: + * @p: a pointer to a position within a UTF-8 encoded string + * + * Finds the previous UTF-8 character in the string before @p. + * + * @p does not have to be at the beginning of a UTF-8 character. No check + * is made to see if the character found is actually valid other than + * it starts with an appropriate byte. If @p might be the first + * character of the string, you must use g_utf8_find_prev_char() instead. + * + * Return value: a pointer to the found character. + **/ +char *BLI_str_prev_char_utf8(const char *p) +{ + while (1) { + p--; + if ((*p & 0xc0) != 0x80) { + return (char *)p; + } + } +} +/* end glib copy */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c8e237753ef..844c499375e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12317,6 +12317,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main) do_versions_nodetree_image_default_alpha_output(ntree); } + { + /* support old particle dupliobject rotation settings */ + ParticleSettings *part; + + for (part=main->particle.first; part; part=part->id.next) { + if(ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { + part->draw |= PART_DRAW_ROTATE_OB; + + if(part->rotmode == 0) + part->rotmode = PART_ROT_VEL; + } + } + } + { bScreen *sc; Camera *cam; @@ -13485,7 +13499,7 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const if( ob->id.flag & LIB_INDIRECT ) { /* IF below is quite confusing! - if we are appending, but this object wasnt just added allong with a group, + if we are appending, but this object wasnt just added along with a group, then this is already used indirectly in the scene somewhere else and we didnt just append it. (ob->id.flag & LIB_PRE_EXISTING)==0 means that this is a newly appended object - Campbell */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 7f05a7c2b1a..b4a86e5d74c 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2447,7 +2447,7 @@ void ED_keymap_animchannels(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_disable", WKEY, KM_PRESS, KM_ALT, 0); - /* settings - specialised hotkeys */ + /* settings - specialized hotkeys */ WM_keymap_add_item(keymap, "ANIM_OT_channels_editable_toggle", TABKEY, KM_PRESS, 0, 0); /* expand/collapse */ diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 3c810f7da2d..0ac5a9e46ce 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -123,7 +123,7 @@ typedef struct bAnimListElem { /* Some types for easier type-testing - * NOTE: need to keep the order of these synchronised with the channels define code + * NOTE: need to keep the order of these synchronized with the channels define code * which is used for drawing and handling channel lists for */ typedef enum eAnim_ChannelType { diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 4bd2a52e963..d649a5e920b 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1263,6 +1263,86 @@ static short test_special_char(char ch) return 0; } +static int ui_textedit_step_next_utf8(const char *str, size_t maxlen, short *pos) +{ + const char *str_end= str + (maxlen + 1); + const char *str_pos= str + (*pos); + const char *str_next= BLI_str_find_next_char_utf8(str_pos, str_end); + if (str_next) { + (*pos) += (str_next - str_pos); + if((*pos) > maxlen) (*pos)= maxlen; + return TRUE; + } + + return FALSE; +} + +static int ui_textedit_step_prev_utf8(const char *str, size_t UNUSED(maxlen), short *pos) +{ + if((*pos) > 0) { + const char *str_pos= str + (*pos); + const char *str_prev= BLI_str_find_prev_char_utf8(str, str_pos); + if (str_prev) { + (*pos) -= (str_pos - str_prev); + return TRUE; + } + } + + return FALSE; +} + +static void ui_textedit_step_utf8(const char *str, size_t maxlen, + short *pos, const char direction, + const short do_jump, const short do_all) +{ + const short pos_prev= *pos; + + if(direction) { /* right*/ + if(do_jump) { + /* jump between special characters (/,\,_,-, etc.), + * look at function test_special_char() for complete + * list of special character, ctr -> */ + while((*pos) < maxlen) { + if (ui_textedit_step_next_utf8(str, maxlen, pos)) { + if(!do_all && test_special_char(str[(*pos)])) break; + } + else { + break; /* unlikely but just incase */ + } + } + } + else { + ui_textedit_step_next_utf8(str, maxlen, pos); + } + } + else { /* left */ + if(do_jump) { + /* left only: compensate for index/change in direction */ + ui_textedit_step_prev_utf8(str, maxlen, pos); + + /* jump between special characters (/,\,_,-, etc.), + * look at function test_special_char() for complete + * list of special character, ctr -> */ + while ((*pos) > 0) { + if (ui_textedit_step_prev_utf8(str, maxlen, pos)) { + if(!do_all && test_special_char(str[(*pos)])) break; + } + else { + break; + } + } + + /* left only: compensate for index/change in direction */ + if(((*pos) != 0) && ABS(pos_prev - (*pos)) > 1) { + ui_textedit_step_next_utf8(str, maxlen, pos); + } + } + else { + ui_textedit_step_prev_utf8(str, maxlen, pos); + } + } +} + static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data) { char *str= data->str; @@ -1305,13 +1385,17 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho /* mouse dragged outside the widget to the left */ if (x < startx && but->ofs > 0) { - int i= but->ofs; + short i= but->ofs; origstr[but->ofs] = 0; while (i > 0) { - i--; - if (BLF_width(fstyle->uifont_id, origstr+i) > (startx - x)*0.25f) break; // 0.25 == scale factor for less sensitivity + if (ui_textedit_step_prev_utf8(origstr, but->ofs, &i)) { + if (BLF_width(fstyle->uifont_id, origstr+i) > (startx - x)*0.25f) break; // 0.25 == scale factor for less sensitivity + } + else { + break; /* unlikely but possible */ + } } but->ofs = i; but->pos = but->ofs; @@ -1325,9 +1409,13 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho /* XXX does not take zoom level into account */ while (startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) { if (but->pos <= 0) break; - but->pos--; - origstr[but->pos+but->ofs] = 0; - } + if (ui_textedit_step_prev_utf8(origstr, but->ofs, &but->pos)) { + origstr[but->pos+but->ofs] = 0; + } + else { + break; /* unlikely but possible */ + } + } but->pos += but->ofs; if(but->pos<0) but->pos= 0; } @@ -1402,48 +1490,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction data->selextend = 0; } else { - if(direction) { /* right*/ - if(jump) { - /* jump between special characters (/,\,_,-, etc.), - * look at function test_special_char() for complete - * list of special character, ctr -> */ - while(but->pos < len) { - but->pos++; - if(!jump_all && test_special_char(str[but->pos])) break; - } - } - else { - but->pos++; - if(but->pos > len) but->pos= len; - } - } - else { /* left */ - if(jump) { - - /* left only: compensate for index/change in direction */ - if(but->pos > 0) { - but->pos--; - } - - /* jump between special characters (/,\,_,-, etc.), - * look at function test_special_char() for complete - * list of special character, ctr -> */ - while(but->pos > 0){ - but->pos--; - if(!jump_all && test_special_char(str[but->pos])) break; - } - - /* left only: compensate for index/change in direction */ - if((but->pos != 0) && ABS(pos_prev - but->pos) > 1) { - but->pos++; - } - - } - else { - if(but->pos>0) but->pos--; - } - } - + ui_textedit_step_utf8(str, len, &but->pos, direction, jump, jump_all); if(select) { /* existing selection */ @@ -1509,21 +1556,10 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio changed= ui_textedit_delete_selection(but, data); } else if(but->pos>=0 && but->pospos; int step; - - if (jump) { - x = but->pos; - step= 0; - while(x < len) { - x++; - step++; - if(test_special_char(str[x])) break; - } - } - else { - step= 1; - } - + ui_textedit_step_utf8(str, len, &pos, direction, jump, all); + step= pos - but->pos; for(x=but->pos; xpos>0) { + short pos= but->pos; int step; - if (jump) { - x = but->pos; - step= 0; - while(x > 0) { - x--; - step++; - if((step > 1) && test_special_char(str[x])) break; - } - } - else { - step= 1; - } + ui_textedit_step_utf8(str, len, &pos, direction, jump, all); + step= but->pos - pos; for(x=but->pos; xdata; float vec[3]={0,0,0}; - if (ese->prev) { /*use previously selected data to make a usefull vertex plane */ + if (ese->prev) { /*use previously selected data to make a useful vertex plane */ EM_editselection_center(vec, ese->prev); sub_v3_v3v3(plane, vec, eve->co); } else { @@ -361,7 +361,7 @@ void EM_editselection_plane(float *plane, EditSelection *ese) } else if (ese->type==EDITEDGE) { EditEdge *eed= ese->data; - /*the plane is simple, it runs allong the edge + /*the plane is simple, it runs along the edge however selecting different edges can swap the direction of the y axis. this makes it less likely for the y axis of the manipulator (running along the edge).. to flip less often. diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 526bf177ab7..e6836d7d5aa 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -957,7 +957,7 @@ long mesh_mirrtopo_table(Object *ob, char mode) } } else { for(a=0, medge=me->medge; atotedge; a++, medge++) { - /* This can make realy big numbers, wrapping around here is fine */ + /* This can make really big numbers, wrapping around here is fine */ MirrTopoHash[medge->v1] += MirrTopoHash_Prev[medge->v2]; MirrTopoHash[medge->v2] += MirrTopoHash_Prev[medge->v1]; } diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 019d6df9b73..740fd5137de 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -2970,7 +2970,7 @@ static void brush_puff(PEData *data, int point_index) VECSUB(dco, lastco, co); mul_mat3_m4_v3(imat, dco); /* into particle space */ - /* move the point allong a vector perpendicular to the + /* move the point along a vector perpendicular to the * hairs direction, reduces odd kinks, */ cross_v3_v3v3(c1, ofs, dco); cross_v3_v3v3(c2, c1, dco); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 5b7712ceb77..1dca08baacb 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -3387,7 +3387,7 @@ static void project_paint_end(ProjPaintState *ps) } /* This is a BIT ODD, but overwrite the undo tiles image info with this pixels original color - * because allocating the tiles allong the way slows down painting */ + * because allocating the tiles along the way slows down painting */ if (is_float) { float *rgba_fp = (float *)tilerect + (((projPixel->x_px - x_round) + (projPixel->y_px - y_round) * IMAPAINT_TILE_SIZE)) * 4; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 6bfe370d105..1d1abf80fe4 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -947,7 +947,7 @@ void OUTLINER_OT_show_hierarchy(wmOperatorType *ot) /* ANIMATO OPERATIONS */ /* KeyingSet and Driver Creation - Helper functions */ -/* specialised poll callback for these operators to work in Datablocks view only */ +/* specialized poll callback for these operators to work in Datablocks view only */ static int ed_operator_outliner_datablocks_active(bContext *C) { ScrArea *sa= CTX_wm_area(C); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 7e718dc176a..53a520a355d 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -530,7 +530,7 @@ void SEQUENCER_OT_select(wmOperatorType *ot) -/* run recursivly to select linked */ +/* run recursively to select linked */ static int select_more_less_seq__internal(Scene *scene, int sel, int linked) { Editing *ed= seq_give_editing(scene, FALSE); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 0854f9f3685..115b3756029 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -450,7 +450,7 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event) sub_v3_v3v3(my_pivot, rv3d->ofs, upvec); negate_v3(my_pivot); /* ofs is flipped */ - /* find a new ofs value that is allong the view axis (rather than the mouse location) */ + /* find a new ofs value that is along the view axis (rather than the mouse location) */ closest_to_line_v3(dvec, vod->dyn_ofs, my_pivot, my_origin); vod->dist0 = rv3d->dist = len_v3v3(my_pivot, dvec); diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 02a6cee5140..b66440738b2 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -179,7 +179,7 @@ typedef struct FlyInfo { /* fly state state */ float speed; /* the speed the view is moving per redraw */ - short axis; /* Axis index to move allong by default Z to move allong the view */ + short axis; /* Axis index to move along by default Z to move along the view */ short pan_view; /* when true, pan the view instead of rotating */ /* relative view axis locking - xlock, zlock @@ -725,7 +725,7 @@ static int flyApply(bContext *C, FlyInfo *fly) RegionView3D *rv3d= fly->rv3d; ARegion *ar = fly->ar; - float mat[3][3], /* 3x3 copy of the view matrix so we can move allong the view axis */ + float mat[3][3], /* 3x3 copy of the view matrix so we can move along the view axis */ dvec[3]={0,0,0}, /* this is the direction thast added to the view offset per redraw */ /* Camera Uprighting variables */ diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 9560924941d..53ccd37952d 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -384,7 +384,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3 int totleft= sculpt_get_first_deform_matrices(scene, ob, deformmats, deformcos); if(totleft) { - /* there are deformation modifier which doesn't support deformation matricies + /* there are deformation modifier which doesn't support deformation matrices calculation. Need additional crazyspace correction */ float (*deformedVerts)[3]= *deformcos; diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h index bd5a455df98..08fa51966f2 100644 --- a/source/blender/imbuf/intern/IMB_indexer.h +++ b/source/blender/imbuf/intern/IMB_indexer.h @@ -37,7 +37,7 @@ #include "IMB_anim.h" /* - seperate animation index files to solve the following problems: + separate animation index files to solve the following problems: a) different timecodes within one file (like DTS/PTS, Timecode-Track, "implicit" timecodes within DV-files and HDV-files etc.) diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 9fec5207dbb..da2fce4da82 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -386,7 +386,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PART_DRAW_HEALTH 16 #define PART_ABS_PATH_TIME 32 #define PART_DRAW_COUNT_GR 64 -#define PART_DRAW_BB_LOCK 128 +#define PART_DRAW_BB_LOCK 128 /* used with billboards */ +#define PART_DRAW_ROTATE_OB 128 /* used with dupliobjects/groups */ #define PART_DRAW_PARENT 256 #define PART_DRAW_NUM 512 #define PART_DRAW_RAND_GR 1024 diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 50ce816d7a1..473278440e6 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -157,7 +157,7 @@ static void rna_Image_unpack(Image *image, ReportList *reports, int method) return; } else { - /* reports its own error on failier */ + /* reports its own error on failure */ unpackImage (reports, image, method); } } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 3c6b9859edb..5c248709f4a 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1871,7 +1871,7 @@ static void def_cmp_id_mask(StructRNA *srna) prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom1"); - RNA_def_property_range(prop, 0, 10000); + RNA_def_property_range(prop, 0, 32767); RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 49005e56367..43d5f87f0d5 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1478,7 +1478,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) static EnumPropertyItem rot_mode_items[] = { {0, "NONE", 0, "None", ""}, {PART_ROT_NOR, "NOR", 0, "Normal", ""}, - {PART_ROT_VEL, "VEL", 0, "Velocity", ""}, + {PART_ROT_VEL, "VEL", 0, "Velocity / Hair", ""}, {PART_ROT_GLOB_X, "GLOB_X", 0, "Global X", ""}, {PART_ROT_GLOB_Y, "GLOB_Y", 0, "Global Y", ""}, {PART_ROT_GLOB_Z, "GLOB_Z", 0, "Global Z", ""}, @@ -1733,7 +1733,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, rot_mode_items); - RNA_def_property_ui_text(prop, "Rotation", "Particles initial rotation"); + RNA_def_property_ui_text(prop, "Rotation", "Particle rotation axis"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE); @@ -1798,7 +1798,12 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_global_dupli", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_GLOBAL_OB); - RNA_def_property_ui_text(prop, "Use Global", "Use object's global coordinates for duplication"); + RNA_def_property_ui_text(prop, "Global", "Use object's global coordinates for duplication"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); + + prop= RNA_def_property(srna, "use_rotation_dupli", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_ROTATE_OB); + RNA_def_property_ui_text(prop, "Rotation", "Use object's rotation for duplication (global x-axis is aligned particle rotation axis)"); RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "use_render_adaptive", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 2fc70eb70e3..75493a27758 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2624,7 +2624,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) {24, "KOREAN", 0, N_("Korean (한국 언어)"), "ko_KR"}, /*{25, "NEPALI", 0, N_("Nepali (नेपाली)"), "ne_NP"},*/ /* using the utf8 flipped form of Persian (فارسی) */ - {26, "PERSIAN", 0, N_("Persian (ﺱﺭﺎﻓ)"), "fa_PE"}, + {26, "PERSIAN", 0, N_("Persian (ﯽﺳﺭﺎﻓ)"), "fa_PE"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL); diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 486c98f82a0..663faf0ed19 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -357,7 +357,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (!totedge) { for (i=0; i < totvert; i++, mv_orig++, mv_new++) { copy_v3_v3(mv_new->co, mv_orig->co); - normalize_v3_v3(vc->no, mv_new->co); /* no edges- this is realy a dummy normal */ + normalize_v3_v3(vc->no, mv_new->co); /* no edges- this is really a dummy normal */ } } else { diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index b2e3c9532b6..7c852527c3d 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -326,7 +326,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *dm = derivedData; CustomDataMask dataMask = requiredDataMask(ob, md); - /* we implement requiredDataMask but thats not really usefull since + /* we implement requiredDataMask but thats not really useful since mesh_calc_modifiers pass a NULL derivedData */ if(dataMask) dm= get_dm(ob, NULL, dm, NULL, 0); @@ -346,7 +346,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, DerivedMesh *dm = derivedData; CustomDataMask dataMask = requiredDataMask(ob, md); - /* we implement requiredDataMask but thats not really usefull since + /* we implement requiredDataMask but thats not really useful since mesh_calc_modifiers pass a NULL derivedData */ if(dataMask) dm= get_dm(ob, editData, dm, NULL, 0); diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index d3963458298..5a78ac8e094 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -359,7 +359,7 @@ static int bpy_struct_id_used(StructRNA *srna, char *identifier) #endif -/* Function that sets RNA, NOTE - self is NULL when called from python, but being abused from C so we can pass the srna allong +/* Function that sets RNA, NOTE - self is NULL when called from python, but being abused from C so we can pass the srna along * This isnt incorrect since its a python object - but be careful */ PyDoc_STRVAR(BPy_BoolProperty_doc, ".. function:: BoolProperty(name=\"\", description=\"\", default=False, options={'ANIMATABLE'}, subtype='NONE', update=None)\n" diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 76dcf9729ca..e52df8f9320 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2218,7 +2218,7 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject } /* generic check to see if a PyObject is compatible with a collection - * -1 on failier, 0 on success, sets the error */ + * -1 on failure, 0 on success, sets the error */ static int pyrna_prop_collection_type_check(BPy_PropertyRNA *self, PyObject *value) { StructRNA *prop_srna; @@ -3800,7 +3800,7 @@ PyDoc_STRVAR(pyrna_struct_get_doc, " Returns the value of the custom property assigned to key or default\n" " when not found (matches pythons dictionary function of the same name).\n" "\n" -" :arg key: The key assosiated with the custom property.\n" +" :arg key: The key associated with the custom property.\n" " :type key: string\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 502fa25c872..98afad38abe 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -149,7 +149,7 @@ typedef struct { PyObject *in_weakreflist; #endif - /* collection iterator spesific parts */ + /* collection iterator specific parts */ CollectionPropertyIterator iter; } BPy_PropertyCollectionIterRNA; diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index d9f741d841a..c6be461a227 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -75,7 +75,7 @@ static PyObject *Euler_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return newEulerObject(eul, order, Py_NEW, type); } -/* internal use, assuem read callback is done */ +/* internal use, assume read callback is done */ static const char *euler_order_str(EulerObject *self) { static const char order[][4] = {"XYZ", "XZY", "YXZ", "YZX", "ZXY", "ZYX"}; diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index b1700aa53c6..7570b5642ef 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -1089,7 +1089,7 @@ static PyObject *Matrix_decompose(MatrixObject *self) PyDoc_STRVAR(Matrix_lerp_doc, ".. function:: lerp(other, factor)\n" "\n" -" Returns the interpolation of two matricies.\n" +" Returns the interpolation of two matrices.\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Matrix`\n" @@ -1669,7 +1669,7 @@ static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item) } else { PyErr_SetString(PyExc_IndexError, - "slice steps not supported with matricies"); + "slice steps not supported with matrices"); return NULL; } } @@ -1701,7 +1701,7 @@ static int Matrix_ass_subscript(MatrixObject* self, PyObject* item, PyObject* va return Matrix_ass_slice(self, start, stop, value); else { PyErr_SetString(PyExc_IndexError, - "slice steps not supported with matricies"); + "slice steps not supported with matrices"); return -1; } } diff --git a/source/blender/render/intern/include/raycounter.h b/source/blender/render/intern/include/raycounter.h index 4d4952cb6c3..7acef6d3c67 100644 --- a/source/blender/render/intern/include/raycounter.h +++ b/source/blender/render/intern/include/raycounter.h @@ -35,7 +35,7 @@ #ifndef RE_RAYCOUNTER_H #define RE_RAYCOUNTER_H -//#define RE_RAYCOUNTER /* enable counters per ray, usefull for measuring raytrace structures performance */ +//#define RE_RAYCOUNTER /* enable counters per ray, useful for measuring raytrace structures performance */ #ifdef __cplusplus extern "C" { diff --git a/source/blender/render/intern/raytrace/bvh.h b/source/blender/render/intern/raytrace/bvh.h index 3ba5bbc624e..c7a1b002d61 100644 --- a/source/blender/render/intern/raytrace/bvh.h +++ b/source/blender/render/intern/raytrace/bvh.h @@ -167,7 +167,7 @@ static inline void bvh_node_merge_bb(Node *node, float *min, float *max) /* - * recursivly transverse a BVH looking for a rayhit using a local stack + * recursively transverse a BVH looking for a rayhit using a local stack */ template static inline void bvh_node_push_childs(Node *node, Isect *isec, Node **stack, int &stack_pos); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 13f22c96ac6..e2935f76999 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3586,8 +3586,8 @@ static void gesture_circle_modal_keymap(wmKeyConfig *keyconf) WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_SHIFT, 0, GESTURE_MODAL_DESELECT); WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_RELEASE, KM_SHIFT, 0, GESTURE_MODAL_NOP); #else - WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_PRESS, 0, 0, GESTURE_MODAL_DESELECT); // defailt 2.4x - WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, 0, 0, GESTURE_MODAL_NOP); // defailt 2.4x + WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_PRESS, 0, 0, GESTURE_MODAL_DESELECT); // default 2.4x + WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, 0, 0, GESTURE_MODAL_NOP); // default 2.4x #endif WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_RELEASE, 0, 0, GESTURE_MODAL_NOP); diff --git a/source/darwin/blender.app/Contents/Info.plist b/source/darwin/blender.app/Contents/Info.plist index 7fab4a98c4b..9aeb617a051 100644 --- a/source/darwin/blender.app/Contents/Info.plist +++ b/source/darwin/blender.app/Contents/Info.plist @@ -46,7 +46,7 @@ LSEnvironment OMP_NUM_THREADS - 2 + diff --git a/source/darwin/set_simulation_threads.app/Contents/Info.plist b/source/darwin/set_simulation_threads.app/Contents/Info.plist index 71ec4a4d0c1..44d6783599c 100644 --- a/source/darwin/set_simulation_threads.app/Contents/Info.plist +++ b/source/darwin/set_simulation_threads.app/Contents/Info.plist @@ -34,9 +34,9 @@ name ScriptWindowState positionOfDivider - 400 + 470 savedFrame - 424 473 1435 704 0 0 1920 1178 + 199 169 1197 810 0 0 1920 1178 selectedTabView result diff --git a/source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scpt b/source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scpt index 7a0e345348c..d905e27cb6d 100644 Binary files a/source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scpt and b/source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scpt differ diff --git a/source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrc b/source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrc index 44dcf1a9f60..54735c5cb04 100644 Binary files a/source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrc and b/source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrc differ diff --git a/source/darwin/set_simulation_threads_applescript.scpt b/source/darwin/set_simulation_threads_applescript.scpt index ba05af64178..82ea5357de5 100644 Binary files a/source/darwin/set_simulation_threads_applescript.scpt and b/source/darwin/set_simulation_threads_applescript.scpt differ diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index c5bf28b9b8d..43c9bd434c5 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -663,7 +663,7 @@ KX_PYMETHODDEF_DOC_NOARGS(BL_ArmatureObject, update, "update()\n" "Make sure that the armature will be updated on next graphic frame.\n" "This is automatically done if a KX_ArmatureActuator with mode run is active\n" - "or if an action is playing. This function is usefull in other cases.\n") + "or if an action is playing. This function is useful in other cases.\n") { SetActiveAction(NULL, 0, KX_GetActiveEngine()->GetFrameTime()); Py_RETURN_NONE; diff --git a/source/gameengine/Expressions/ConstExpr.cpp b/source/gameengine/Expressions/ConstExpr.cpp index 8d5a47b2d0d..c41cf5a54f5 100644 --- a/source/gameengine/Expressions/ConstExpr.cpp +++ b/source/gameengine/Expressions/ConstExpr.cpp @@ -99,7 +99,7 @@ bool CConstExpr::NeedsRecalculated() CExpression* CConstExpr::CheckLink(std::vector& brokenlinks) { -// parent checks if child is still usefull. +// parent checks if child is still useful. // When for example it's value it's deleted flag set // then release Value, and return NULL in case of constexpression // else return this... diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index a795a4eddc6..7e496136ce2 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -146,7 +146,7 @@ bool KX_NetworkMessageSensor::Evaluate() // Return always true if a message was received otherwise we can loose messages if (m_IsUp) return true; - // Is it usefull to return also true when the first frame without a message?? + // Is it useful to return also true when the first frame without a message?? // This will cause a fast on/off cycle that seems useless! return result; }