Commit Graph

188 Commits

Author SHA1 Message Date
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
0c6a01ca00 Use includes for blenderplayer stubs
exposes many incorrect and redundant stubs
2014-01-28 01:55:10 +11:00
348cf17448 Code Cleanup: no need to pass empty strings as default values 2014-01-16 22:00:29 +11:00
1f2136b329 Python/Depsgraph: bpy.data.*.is_updated now detects add/remove of any datablock.
Previously this only worked for some datablocks relevant to rendering, now it
can be used to detect if any type of datablock was added or removed (but not
yet to detect if it was modified, we need many more depsgraph tags for that).

Most of the changes are some function parameter changes, the important parts
are the DAG_id_type_tag calls.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D195
2014-01-15 16:47:53 +01:00
2dba2e72b7 Code Cleanup: de-duplicate text pasting which only used the first line 2014-01-08 17:39:12 +11:00
a53e864cf4 Fix T37572: text editor scrolling not working well with Mac trackpad panning.
The trackpad would give isolated mouse pan events with a distance smaller than
one line or character. For other 2D views this is all accumulated in floats,
but in the text editor it only keeps track of integers, and the small mouse pan
events got lost due to rounding.

Now it keeps track of sub-line or sub-character scroll offsets to avoid this.
2013-12-13 00:04:05 +01:00
7267221715 remove return argument from wmOperatorType->cancel, was only ever returning OPERATOR_CANCELLED. 2013-10-30 23:08:53 +00:00
31b38a6736 Fix #37122: Text Editor: New Open-Shortcut different from Text > Open Text Block
Seems no user counter tricks are needed from r23598.

Also, r33453 is obviously wrong, because new ID's user counter is 1,
and could not exceed this value.
2013-10-17 12:53:37 +00:00
b21b24573d lots of operator descriptions were incorrectly copy/pasted.
update some descriptions, others were removed and operators tagged as internal.

add a script to detect duplicate operator descriptions.
2013-09-30 05:50:41 +00:00
89a02fc4ef fix [#36656] text editor undo error when undoing paste command
When tabs to spaces is enabled and a paste command is undone, the improper number of characters could get removed. Also fixed issue with shift + left/right only selecting a max of 1 character.
2013-09-05 21:36:19 +00:00
26cbf331a8 text editor cursor motion (left/right arrows) with selected text typically jumps to either side of the selection previously the cursor would move and loose the selection too.
text button fields already did this.
2013-09-02 00:47:27 +00:00
973e317461 correct own error r59619 (changes made to patch, adding handle recalculation which is needed after splitting). 2013-08-29 14:52:36 +00:00
f6527043d9 fix for glitch where the text editor could be clamped to scroll above line 1 (would flicker on scroll). 2013-08-29 08:13:32 +00:00
40d4dfaba8 Fix #35824: finding missing files not working correct for filepaths with special
characters on Windows.

Replaced some uses of stat() by BLI_stat() to properly handle such filepaths.
2013-06-25 14:48:30 +00:00
d8c2709414 Better API design for making text datablocks after loading.
An optional 'internal' argument was added to the bpy.data.texts.load() operator.  
The changes in revision 57153 were reverted, so that the is_in_memory and is_dirty
properties of text datablocks are not editable again.

In the C API layer, BKE_text_load_ex() was introduced to allow for optionally
making text datablocks internal after loading.
2013-06-02 17:52:06 +00:00
3e97e2c8e8 style cleanup 2013-05-31 22:35:25 +00:00
c31ec62d2f fix for glitch in text editor using ctrl+(backspace / delete),
for now just don't jump words when theres a selection.
2013-05-07 01:00:19 +00:00
9e75d276e3 holding ctrl when using arrow keys in the text editor didn't navigate newlines. 2013-05-01 00:15:22 +00:00
8ee1de2de3 text editor reload no-longer resets scroll & cursor - annoying when making tweaks to UI scripts.
also restrict freestyle hack to WITH_FREESTYLE define.
2013-04-17 04:53:23 +00:00
594eb6218c fix [#34905] Text editor: replacing matches by empty string not allowed 2013-04-08 01:31:41 +00:00
1165236f69 Usablity:
In text editor, the CTRL+F find now opens property region (or keeps it) and
activates the search button for input.

That's already nice! But next step should be to do a search on exit of 
the button (or while typing). That's stuff I need Campbell to help with though.

Notes:
- Probably Py api for property buttons could get an "operator=" arg?
- The warning menu "not found" should go away
- I also suggest to make "wrap" search default for new editors
2013-03-24 13:43:40 +00:00
aff410b558 style cleanup: odd indentation 2013-03-14 05:52:30 +00:00
aaa8a13c49 code cleanup: use const events for modal and invoke operators. 2013-03-13 09:03:46 +00:00
5792e77239 Patch [#34373] Use i18n monospace font in Text editor and Python console
This patch allows Blender to display i18n monospace font in the text
editor and the Python interactive console. Wide characters that occupy
multiple columns such as CJK characters can be displayed correctly.
Furthermore, wrapping, selection, suggestion, cursor drawing, and
syntax highlighting should work.

Also fixes a bug [#34543]: In Text Editor false color in comment on cyrillic

To estimate how many columns each character occupies, this patch uses
wcwidth.c written by Markus Kuhn and distributed under MIT-style license:

  http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c

wcwidth.c is stored in extern/wcwidth and used as a static library.

This patch adds new API to blenfont, blenlib and blenkernel:

BLF_get_unifont_mono()
BLF_free_unifont_mono()
BLF_draw_mono()
BLI_wcwidth()
BLI_wcswidth()
BLI_str_utf8_char_width()
BLI_str_utf8_char_width_safe()
txt_utf8_offset_to_column()
txt_utf8_column_to_offset()
2013-03-12 07:25:53 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
b1543f07bf Another bunch of UI translation fixes, thanks to Leon Cheung, Gabriel Gazzán and S. Lockal for spotting them! 2013-02-24 15:40:28 +00:00
098e4234b1 minor change to own recent commit with transform fcurve centers and some style edits and typo corrections. 2013-02-19 02:30:02 +00:00
5ba0eb0ae5 Fix some popups being too small on retina display, among them the new image dialog. 2013-02-18 15:08:27 +00:00
ab7ca2dc44 fix for double clicking in the text editor not working usefully (double clicking a pair chars would select 3 - one to the left). 2013-02-14 03:03:12 +00:00
fdfa5910b5 Fix #34040: Moving Normal Node with enabled Cycles Material Preview crashes
Issue was caused by couple of circumstances:

- Normal Map node requires tesselated faces to compute tangent space
- All temporary meshes needed for Cycles export were adding to G.main
- Undo pushes would temporary set meshes tessfaces to NULL
- Moving node will cause undo push and tree re-evaluate fr preview

All this leads to threading conflict between preview render and undo
system.

Solved it in  way that all temporary meshes are adding to that exact
Main which was passed to Cycles via BlendData. This required couple
of mechanic changes like adding extra parameter to *_add() functions
and adding some *_ex() functions to make it possible RNA adds objects
to Main passed to new() RNA function.

This was tricky to pass Main to RNA function and IMO that's not so
nice to pass main to function, so ended up with such decision:

- Object.to_mesh() will add temp mesh to G.main
- Added Main.meshes.new_from_object() which does the same as to_mesh,
  but adds temporary mesh to specified Main.

So now all temporary meshes needed for preview render would be added
to preview_main which does not conflict with undo pushes.

Viewport render shall not be an issue because object sync happens from
main thread in this case.

It could be some issues with final render, but that's not so much
likely to happen, so shall be fine.

Thanks to Brecht for review!
2013-02-05 12:46:15 +00:00
5ffcde851b Add translation contexts for line, mute and clip 2013-01-05 12:06:50 +00:00
dd62a2c375 text autocomplete
- make the popup box line up the X axis with the current word.
- add poll function for the operator
2012-12-31 16:24:49 +00:00
3134407c48 code cleanup: remove unneeded include's and rename some static functions in text_format_py.c 2012-12-19 04:23:02 +00:00
f43923d86d generalize formatting code so different formatters can be registered and each has their own source file,
Since we will likely have OSL formatting added soon.
2012-12-19 04:02:19 +00:00
81d240c8c8 avoid using strlen() for comparisons in for loops. for expanding whitespace in the text editor and ui paste. 2012-12-15 07:57:16 +00:00
12b642062c Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability

Short list of main changes:

- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
  Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
  This allows keeping UI and data without actual saves, until you actually save.
  When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v). 
  Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards. 
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
  Old option is called "Save Startup File" the new one "Save User Settings".
  To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
  This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
a4e6da3580 Fix #33398: Missed undo push when script execution failed
Undo push was missed in cases when script failed to run with some error
when using Run Script in text editor. As far as i can see it makes sense
to skip undo push here only in cases live editing is enabled.

Otherwise it's indeed annoying to return to previous scene state when
debugging the script.
2012-12-03 16:47:38 +00:00
c407c951a0 Text Editor: remove text marker functionality. Patch [#33251] 2012-11-23 14:33:14 +00:00
be6ea8ff2c fix [#33180] text editor line height issue
Added small space between lines in the text editor.
2012-11-16 01:12:01 +00:00
283ee53085 fix for deleting lines hanging the text editor when no markers are used, presence of markers still hangs.
also compiler warnings and some style edits.
2012-11-15 02:11:40 +00:00
4a5e8bf24c Patch [#31006] Text editor undo buffer rework. 2012-11-14 23:10:19 +00:00
cf08068e10 fix [#33121] crashing when srolling down in text editor ! 2012-11-09 03:36:38 +00:00
c9dade4fe0 Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()... 2012-10-26 17:32:50 +00:00
68249f4ed6 Patch #31641: Text editor: unindent even if no selection
Patch by Sebastian Nell, thanks!

Still not ideal (it could some smarter selection policy in such case perhaps),
but it's less annoying than it was before.
2012-10-24 15:43:42 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
6536e2d01a And more UI messages fixes... 2012-10-08 21:03:35 +00:00
552cd4b7e7 fix for crash executing a python script.
nice obscure case, when a script executes, frees its self (by loading a file for eg), then has a python error.

... in this case blender would fetch the python exception and attempt to move the cursor in the freed textblock to the error line, crashing blender.
2012-09-23 06:25:39 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
26f073b327 macros for rectangle center and size 2012-08-20 15:29:02 +00:00