Commit Graph

86 Commits

Author SHA1 Message Date
Campbell Barton
9c032756e9 when checking for windows check sys.platform starts with "win" rather then '== "win32"' & avoid importing platform.
also add some notes to CMake options.
2011-03-11 01:24:16 +00:00
Campbell Barton
efb5f6008f temp workaround [#26397] Console error when selecting certain entries in the Help Menu (Report a Bug)
bug in python 3.2, reported upstream: http://bugs.python.org/issue11432
2011-03-08 01:03:27 +00:00
Campbell Barton
fc0c016940 replace import *'s with named imports (using * is convenient for some scripts but considered bad practice by python devs) 2011-02-27 15:25:24 +00:00
Campbell Barton
e4a69ffb60 fix [#26104] Context Set Boolean op fails [34892i]
could give better feedback but these operators are mainly for internal use.
2011-02-19 04:28:07 +00:00
Campbell Barton
fee5363912 bugfix [#26094] Going to Bone Roll menu brings up python error
also correct for pep8 warnings.
2011-02-16 02:25:03 +00:00
Campbell Barton
8845163574 menu to select an enum from an RNA path:
eg,
   bpy.ops.wm.context_menu_enum(data_path="scene.tool_settings.vertex_paint.brush.stroke_method")

This saves us defining operators only for menus.
2011-02-15 18:12:41 +00:00
Campbell Barton
4612034cf4 patch [#25809] Auto-Registration as utility function.
This removes auto-registration, committed by Martin r30961.
Realize this is a contentious topic but Brecht and myself both would rather opt-in registration.

TODO:
- addons need updating.
- class list will be modified to use weakrefs (should have been done for existing system too).
- will move bpy.types.(un)register functions into bpy.utils.(un)register_class, currently including these functions in a type list is internally ugly, scripts which loop over types also need to check for these.
2011-02-10 23:48:22 +00:00
Campbell Barton
cae4e92ce8 bugfix [#25640] Cannot edit custom property values in it's popup window 2011-01-15 19:15:35 +00:00
Campbell Barton
7f3fe8a2df pep8 cleanup 2011-01-01 07:20:34 +00:00
Campbell Barton
4558d45d46 WM_OT_path_open was failing with non utf8 paths. 2010-12-17 05:12:36 +00:00
Campbell Barton
1622385445 pedantic word ordering change.
- wm.add_modal_handler -> modal_handler_add
- wm.add_fileselect -> fileselect_add
- ob.add_shape_key -> shape_key_add
- VIEW3D_OT_add_background_image -> VIEW3D_OT_background_image_add (same for remove)

Also made 2 internal cmake vars hidden.
2010-12-08 11:42:11 +00:00
Campbell Barton
55e3d499ae correction to r33469, operators return sets so string comparison isn't valid. 2010-12-05 00:08:25 +00:00
Ton Roosendaal
282910fdae Bugfix #21893
Python Operator "Delete Edge Loop" (which keeps mesh connected)
changed selection if sliding operator failed. Simply added a
check for return value. Gosh, that Python code is not bad ;)
2010-12-04 13:46:25 +00:00
Campbell Barton
acc883da83 - move cmake file for python.
- move bpy_array.c to bpy_rna_array.c
- minor syntax changes
2010-11-17 07:22:20 +00:00
Sergey Sharybin
f529e10951 Fix #24632: Sculpt Mode Context Set hotkeys (1..0, Shift+1..0) don't work
- Totally get rid of old active_brush_index stuff
- Use operator to set n-th brush as active in specified paint mode
  thans to Cambo for it's optimization :)
2010-11-10 08:11:58 +00:00
Campbell Barton
010106a1f6 [#24491] not possible to create a new Rendering preset than "add render preset.py"
- Setting operator properties was broken because of bpy_types.py meta-classing (surprising this wasn't noticed before!)
- Presets now use a dialog with an OK button.
- Presets use a check function on the filename so invalid chars are replaced editing.
- Submit docs operator was broken.
2010-11-01 21:07:25 +00:00
Campbell Barton
184b5fd6db bugfix [#24466] Selecting of object with pattern leads to strange behavior
The undo problem was caused by python operators returning 'RUNNING_MODAL' rather then the return value from wm.invoke_props_popup(self, event) - 'FINISHED'.

This was done because returning FINISHED would free the operator causing the buttons redo handler to try and run a freed operator and crash.

So the real fix is to disallow any operators to use wm.invoke_props_popup(self, event) if they dont have the REGISTER option enabled, fixing the crash and redo problem.
2010-10-31 14:43:30 +00:00
Campbell Barton
ab404a0f66 patch [#24424] Python scripts update for API changes
from Filiciss Muhgue (filiciss)
2010-10-27 22:15:55 +00:00
Nathan Letwory
d170a959d2 Add System Info function to the Help menu.
Users can use this to quickly get info about their system for bug reports.
2010-10-16 17:26:40 +00:00
Campbell Barton
05884e09be - rna bugfix where ints were not clamped and would overflow, now raise an error and print valid range.
- fixed WM_OT_context_cycle_int was causing problems with int overflow, now it cycles properly.
- rename QUOTE macro to STRINGIFY_ARG, and added STRINGIFY, which is used more often since it gives the value as a string.
2010-10-03 01:44:00 +00:00
Campbell Barton
aaf328dc78 remove redundant []'s for list comprehension's, py2.4+ supports this. 2010-09-19 07:07:14 +00:00
Campbell Barton
5452f335d7 New optional operator function, check(), it takes the same arguments as execute().
This runs after changing a property and allows correcting incompatible options.
 Returning True will redraw the UI.

Currently this is used for setting the write extension when saving files, so changing the image format also corrects the extension.
The same is accessible from python where its used when saving SVG/EPS/PNG files.

This fixes: [#23828] obj export problems, [#23760] Exporting OBJ and filetype ending
also fixed document submission operator.


Now the filename in the file selector is the one used for writing this means we remove the "Save Over" popup which could be overlooked too easily.
Instead display the filename field with red tint, and a note in the tooltip.
2010-09-17 09:27:31 +00:00
Campbell Barton
8d0c01e6e2 keyconfig updates/changes
- use preset subclass with funcs for updating the keyconfig
- keyconfig filenames are used for the UI names as with presets (so separation anymore)
- keyconfig's are stored in the preset dir (scripts/cfg dir removed)
- only the active keyconfig script is loaded
- some bugfixes for saving keymaps
- user interactions no longer saves keyconfigs too, I think this needs to be re-worked.

developer note...
multiple keyconfigs at once are not really needed now that they are stored & accessed directly in python.
for now I left it alone but we could consider to remove this capability in the future.
2010-09-14 16:45:24 +00:00
Campbell Barton
111965478a replace self.properties.foo --> self.foo 2010-09-09 18:03:57 +00:00
Campbell Barton
115b256738 ran through pep8 checker 2010-09-07 15:17:42 +00:00
Campbell Barton
59ac5b0930 in response to bug [#23701] Edit Mode: unable to bind vertex/edge/face select modes to keys
while not a bug, being able to cycle over vertex/edge/face modes is useful. added an operator to cycle an array, could be used for cycling the active layer or mesh edit mode.
2010-09-06 22:43:09 +00:00
Campbell Barton
52cefa4bc1 sphinx doc gen
- use 3 column lists for inherited props, funcs and for references to save on vertical space.
- use the blender version string for the upload path and PDF name.
2010-09-03 09:21:40 +00:00
Campbell Barton
ddbfb05c84 rna context rename
* context.main & bpy.types.Main --> context.blend_data & bpy.types.BlendData
* context.manager --> context.window_manager
2010-09-02 04:53:05 +00:00
Campbell Barton
30d180ff0d bugfix [#23194] export UVs miss the extension file
also made all other exporters do this.

Made some internal changes.
- moved path functions from bpy.utils to bpy.path (similar to os.path)
- added functions...
  bpy.path.ensure_ext(path, ".ext", case_sensitive=False) # simple function to ensure the extension is set.
  bpy.path.resolve_ncase(path) # useful for importing scenes made on windows where the path case doesnt match the files.
2010-08-06 01:40:54 +00:00
Campbell Barton
4906290f0d rewrote wm.context_set_id() to automatuically match the pointer type with the bpy.data.* iterator by inspecting rna. 2010-08-04 13:59:25 +00:00
Campbell Barton
1f77f7b05a Brush/Paint internal changes
- remove brush array for each Paint struct, just use a single brush pointer.
- removed rna function based template filtering.
- filter brushes using a flag on the brush and the pointer poll function.
- set the brushes using a new operator WM_OT_context_set_id().

TODO
- remake startup.blend, currently brush groupings are lost.
- rewrite WM_OT_context_set_id() to use rna introspection.
2010-08-04 12:18:07 +00:00
Martin Poirier
15e4753396 [#23156] Cannot Edit Custom Properties
Missing import after moving operators around.
2010-08-02 22:52:55 +00:00
Martin Poirier
5b345524ea RNA Types metaclass registration
See mailing list posts for details [1][2][3]

Addons still need to be fixed; Campbell said he'd do it today.

See any of the py files (outside netrender) in this commit for how to do it (it's rather simple).

[1] http://lists.blender.org/pipermail/bf-committers/2010-February/026328.html
[2] http://lists.blender.org/pipermail/bf-committers/2010-August/028311.html
[3] http://lists.blender.org/pipermail/bf-committers/2010-August/028321.html
2010-08-02 02:55:12 +00:00
Campbell Barton
d9f86e3c73 pedantic pep8 warnings, mostly white space. 2010-07-05 22:22:22 +00:00
Campbell Barton
8e97e561a9 convenience functionality for browse button (requested by Colin for the sequence editor, useful for managing files for the final edit)
- Holding Alt while clocking on the browse button opens a file browser with the containing dir.
- Holding Shift opens the file its self in the default application.

obscure but at least theres a tooltip so its not totally hidden.
2010-07-04 10:02:30 +00:00
Campbell Barton
c2f36a4d6a naming changes
path -> filepath (for rna and operators, as agreed on with elubie)
 path -> data_path (for windowmanager context functions, this was alredy used in many places)
2010-06-14 03:52:10 +00:00
Campbell Barton
1028284301 pep8, whitespace edits 2010-06-09 19:12:03 +00:00
Campbell Barton
ed3a7bd299 script reload (f8), is closer to working.
there are internal memory problems which can make it crash still.
If you remove all directories in the scripts folder except for 'modules' and 'ui', it runs without crashes.
2010-06-01 08:15:43 +00:00
Thomas Dinges
ccda04131a Python Open Link operator.
* Unified some code for Opening an URL to use only one operator: WM_OT_url_open
* Removed the HELP_OT_url operators.
2010-05-31 11:38:13 +00:00
Matt Ebb
0524fc1df6 Fix [#22337] Wrong operator descriptions 2010-05-14 07:20:16 +00:00
Thomas Dinges
95d1d82313 Bugfix for [#21798] Submit description doesn't work. 2010-03-28 10:52:24 +00:00
Campbell Barton
be8c398191 - submit docs now uses the new dialog with an OK button
- submitting operator docs sent them twice.
2010-03-20 19:22:34 +00:00
Campbell Barton
f8a4683b72 pep8 warnings 2010-03-14 23:26:17 +00:00
Campbell Barton
149fe90a08 cleanup for addon python internals, fix filtering bug. 2010-03-14 20:07:15 +00:00
Campbell Barton
d1bf196de1 improve brush size keys so they dont change by 20 each time (bad for small brushes), added wm.context_scale_int() operator. 2010-03-08 23:34:38 +00:00
Campbell Barton
7c0d2ffb64 pep8 cleanup 2010-03-06 01:40:29 +00:00
Campbell Barton
fbb8672da4 replace operator options bl_undo and bl_register with bl_options
eg.
 bl_options = {'REGISTER', 'UNDO', 'BLOCKING', 'GRAB_POINTER'}

This didnt exist when operators were originally wrapped.
2010-03-01 00:03:51 +00:00
Campbell Barton
3dd3e7321e store vars in py operators in the instance rather then the operator classes. 2010-02-27 14:54:45 +00:00
Campbell Barton
a9307a4dd3 [#21295] Escape key doesn't cancel python modal operators
also fix distance with lamps being negative for typed in values.
2010-02-24 15:56:27 +00:00
Campbell Barton
9e2e528c36 - finally a way to force removal of images (Shift+Click on the X)
- generic modal operator now works with int's
2010-02-23 15:34:02 +00:00