Commit Graph

176 Commits

Author SHA1 Message Date
Campbell Barton
b56d2f9766 fix [#30623] user-defined render presets bug
this report exposed multiple bugs in blender when using a non utf8 compatible home directory.

- bpy.utils.script_paths() would crash when homedir wasn't utf8 (reported bug)
- PyC_DefaultNameSpace() - would raise an error when running when __file__ was non utf8.
- preset filepath property was not set to accept non utf8.
- bpy.paths.display_name would raise an error on non utf8 paths, (used for preset draw)
2012-03-21 22:29:49 +00:00
Campbell Barton
c6c0601d8e py api:
modify bpy.path.display_name_from_filepath() to accept bytes
2012-03-16 04:14:57 +00:00
Campbell Barton
72889d8935 Code Cleanup: remove unused preset variable. 2012-02-07 06:53:19 +00:00
Campbell Barton
7f08c71f43 cleanup for redefined vars 2012-01-18 06:55:51 +00:00
Campbell Barton
032a6f63a7 enable xml preset save/load, replace install/export themes with these. 2012-01-10 16:20:01 +00:00
Campbell Barton
a8b19260cf check for presets in addons dirs. this way addons can install their own presets too. 2011-12-30 08:39:40 +00:00
Campbell Barton
b22405fa6f fix for bpy.path.abspath() on windows when the library argument was set and its self a relative path too. 2011-12-11 19:48:56 +00:00
Campbell Barton
6e28ac2d7b pep8 edits and avoid naming conflicts with python builtins 2011-11-24 19:36:12 +00:00
Campbell Barton
4d9766aacf minor cleanup
- remove / comment unused python vars
- replace mul_v3_fl(somevec, -1.0f); with negate_v3(somevec);
2011-11-16 16:38:37 +00:00
Campbell Barton
f086201518 cmake & pep8 tidy up, also some style edits.
remove unneeded collection length function.
2011-11-08 01:32:34 +00:00
Campbell Barton
5eef937436 modify previous api feature to tag functions as permanent, use nicer decorator style, eg:
# --------

import bpy
from bpy.app.handlers import persistent

@persistent
def my_func(scene):
    pass

bpy.app.handlers.frame_change_pre.append(my_func)
2011-11-03 09:13:47 +00:00
Campbell Barton
fda2045150 correct spelling errors in comments 2011-10-17 06:58:07 +00:00
Campbell Barton
751aa8c7f4 py api: bpy_extras.io_utils.path_reference() - added library argument so exporters get the paths of linked images right. 2011-10-11 04:36:27 +00:00
Campbell Barton
fa5275cdfa - bpy.path.abspath(), added optional library argument since any paths from linked datablocks are relative to this, not the blend files path, this saves kludgy path code wherever libraries may be used.
- Image "Edit Externally" operator can now edit relative library images.

also minor edits to navmesh.
2011-10-11 04:09:11 +00:00
Campbell Barton
f7737153e6 filter RNA classes for translation (removes over 1300 lines from messages.txt)
- omit operators tagged as INTERNAL
- omit classes  for internal use: Event, Context, Property, Function, Window.
2011-10-05 03:39:22 +00:00
Bastien Montagne
712e434a5f /release/scripts: Removed final points in UI strings and messages. 2011-09-19 14:00:42 +00:00
Campbell Barton
8fd246cb70 add bpy.types as a module for convenient imports, eg:
from bpy.types import Menu
2011-08-12 06:31:39 +00:00
Kent Mein
9026dc6ee4 Fixed a few small typos.
Kent
2011-08-02 17:00:44 +00:00
Campbell Barton
f4293067c1 py api: sphinx doc corrections, pep8 cleanup and style edits, also added __all__ to some modules which were missing it. 2011-07-31 03:15:37 +00:00
Campbell Barton
2658949752 pep8 cleanup, also print message when attempting to run in animation player mode. 2011-07-29 01:24:03 +00:00
Campbell Barton
5132be21d1 fix [#28075] After the correction of No.38528 is applied, the following phenomenon has been generated.
own fault in recent addition of bpy.path.basename() not supporting byte paths.
2011-07-25 04:00:11 +00:00
Campbell Barton
76e91d7a5f fix [#27922] using preset_paths() with an absolute path returns twice the same thing
raise an error when an invalid subdir is passed to preset_paths()
2011-07-20 15:33:27 +00:00
Campbell Barton
4ad43aaf16 added bpy.path.basename because "//" prefix breaks os.path.basename. 2011-07-20 08:10:01 +00:00
Campbell Barton
f4b6d00926 fix for bpy.path.abspath(), if a path was passed it would get the last directory cut off, broke copying images on export. 2011-07-19 05:05:54 +00:00
Campbell Barton
dbc9e36f72 make python3.3 compatible, __class__ is no longer in the class methods namespace. 2011-07-11 05:50:49 +00:00
Campbell Barton
2c66ab12e9 minor pep8 edits 2011-07-01 12:33:34 +00:00
Campbell Barton
d86d68d4e6 console autocomp import now excludes '_' prefixed variables and the results are sorted. 2011-06-29 10:47:43 +00:00
Campbell Barton
c672b3fb67 [#27439] Console window doesn't hide on startup when presets are used (Windows)
only print preset load messages in when debug is enabled.
2011-05-20 00:21:38 +00:00
Campbell Barton
863b60e1b8 fix [#27432] [2.57/scripts/modules/bpy/path.py:169] can't concat bytes to str 2011-05-19 06:27:39 +00:00
Campbell Barton
b432520799 fix [#27324] WindowManager.invoke_search_popup() crashes blender and does not work
also minor formatting fixes.
2011-05-08 12:51:05 +00:00
Campbell Barton
e26b0c68a4 patch [#27205] Infinite recursion inside resolve_ncase() when passed a driver letter on Windows that does not exist
by Brandon Ehle (azverkan)
2011-05-06 11:27:04 +00:00
Campbell Barton
5a0dca41e5 fix 2 bugs with addon installation
- installing an addon which creates a new script directory didn't add this to the sys.path.
- installing the addon was meant to set the search string to the addon name but was broken.
2011-05-04 08:44:08 +00:00
Campbell Barton
d8eafe14c6 fix [#27148] *Invalid Path* in all "operator presets" dropdowns 2011-05-02 17:29:30 +00:00
Campbell Barton
f8c09b37d4 api changes needed for for copying old settings to new.
- py: bpy.utils.resource_path('USER', 2, 56)
- C: BLI_get_folder_version(id, major, minor, check);
2011-04-11 13:56:58 +00:00
Campbell Barton
65b13c8089 fix [#26757] Python console: help() doesn't work anymore
also quiet some warnings & add docstrings to bpy module which was shaowing the GPL header in its help() message.
2011-04-03 23:11:00 +00:00
Campbell Barton
c8652b301f pep8 checker, mostly pedantic style changes but also found an error in mesh_utils.mesh_linked_faces() 2011-04-01 02:41:15 +00:00
Campbell Barton
6e5ce953da use 'is None' rather then '== None' as suggested by python docs & mis-spelling. 2011-03-29 04:16:55 +00:00
Campbell Barton
b510019602 fix for incorrect prints with RNA errors (own fault, CONTAINER_RNA_ID was incorrect) & close keymap file after running. 2011-03-25 01:55:00 +00:00
Campbell Barton
2c4999eccb missed committing this before 2011-03-23 15:14:21 +00:00
Campbell Barton
f3686b5885 py/api registration:
move calls to the classes register/unregister function into register_class() / unregister_class() and add docs.

also other minor changes:
- remove face sorting keybinding, was Ctrl+Alt+F, this is quite and obscure feature and face order normally doesn't matter, so access from Face menu is enough.
- add commented out call to mesh.validate() in addon template since its useful to correct incomplete meshes during development.
2011-03-22 01:38:26 +00:00
Campbell Barton
379f55f54c fix for error printing class register error, remove an unneeded check. 2011-03-21 22:17:01 +00:00
Campbell Barton
2e6a02438e move script directories for internal blender scripts.
ui/ --> startup/bl_ui
op/ --> startup/bl_operators

scripts/startup/ is now the only auto-loading script dir which gives some speedup for blender loading too.

~/.blender/2.56/scripts/startup works for auto-loading scripts too.
2011-03-21 12:35:49 +00:00
Campbell Barton
599bd1cbda patch from Martin, call classes register/unregister functions.
Modified to only do one lookup.

from Martin: 
 "Basically, what it does is allow you to add register and unregister class methods to rna types, this way you don't have to rely on module register/unregister methods to setup your types properly (and it makes them easier to move around when reorganizing code and easier to understand what a type does when reading code). This is especially nice for PropertyGroup classes that are added as properties to existing types, you can easily see in their register methods where they are added and removed in their unregister method. Obviously, those two methods are optional, so current code still works fine."
2011-03-21 06:22:09 +00:00
Campbell Barton
e44da6b695 hide addon_utils in bpy.utils & tag/remove unused vars in recent commits. 2011-03-18 20:57:32 +00:00
Campbell Barton
5ef65a0a3b build system now exclude config-*, turtledemo when copying system python.
also remove __pycache__ dirs when cleaning (new in python 3.2)
2011-02-28 05:59:44 +00:00
Campbell Barton
e09189cf50 complete lazy loading of py modules to use to a reduced set of pythons modules, gives ~40% speedup on cold & warm start (without netrender).
- use own OrderedDictMini class, pythons collections.OrderedDict is overkill, 179 sloc. replaced with own, 11 lines.
- remove code which stored the class file & line per RNA subclass, this was useful but would raise its own exception every time to generate a stack trace to get the class info so we could use of the class failed to register. the class stores its module & name which can be enough to find where it was defined.
2011-02-28 04:37:24 +00:00
Campbell Barton
52f92b4cb1 lazy load modules for more scripts. 2011-02-27 14:16:32 +00:00
Campbell Barton
87acf919a5 lazy load pydoc module. move help() replacement into console code rather then on startup since importing pydoc pulls in lots of other modules too. 2011-02-27 14:08:33 +00:00
Campbell Barton
b25db7c8cb pep8 cleanup 2011-02-25 16:06:14 +00:00
Campbell Barton
eee4a62e87 move addon utilities into their own module, these were getting mixed between bpy.utils and space_userpref. 2011-02-21 07:07:44 +00:00