Ian Thompson
6872ff71d5
Oops, forgot to reset counters for each line when calculating wrap.
2008-07-26 22:25:26 +00:00
Ian Thompson
6531d859ba
TextPlugin update: Converted try-except blocks to use try-catch-else to allow better error tracking. Commented the descriptor classes and improved variable support for basic types (string, list, etc.)
2008-07-26 20:02:10 +00:00
Ian Thompson
9f19d88a5d
Word-wrap initial commit. Added button to header and updated draw code for text and cursor. Simple typing/deleting works fine. Other events (selections, clicking) behave as if text has not been wrapped and need work.
2008-07-26 18:38:59 +00:00
Ian Thompson
4a8aa06a14
Merge from trunk
...
revs. 15635:15771
2008-07-26 10:45:11 +00:00
Ian Thompson
4c6e0d49c8
Text plug-ins should only be invoked when syntax highlight is enabled (since they only update when it is set). We don't want things popping up when we're just writing text.
2008-07-26 00:25:03 +00:00
Ian Thompson
1634b7c460
Documentation panel improved to scroll and have better word-wrapping.
2008-07-25 08:06:30 +00:00
Ian Thompson
d2013570a0
Refactor: Renamed text tool methods (suggestions and docs) for clarity and consistency.
2008-07-23 21:28:48 +00:00
Ian Thompson
3b70337f7f
Improvements to text find (and replace):
...
- Added GUI panel
- Selected text is copied to "find" field
- Option to search "all texts"
- Option to replace text
- Alt+F finds, Ctrl+Alt+F finds again (without UI)
- Alt+H replaces (UI), Ctrl+Alt+H replaces again (and undo works)
- Fixed: Find didn't push undos so cursor position was wrong
2008-07-23 19:35:13 +00:00
Ian Thompson
16ebff308e
time_t isn't supported in SDNA so we'll use double instead. 56bit precision is plenty for storing seconds (for a billion years at least)
2008-07-23 18:19:56 +00:00
Ian Thompson
6b4b03317d
Bugfix: Deleting backward selected text was getting stuck on redo.
...
Selections were not correctly preserved through undo/redo operations causing unexpected behaviour.
2008-07-23 12:59:05 +00:00
Ian Thompson
6d0e840648
Bug fix for the bug fix. Wasn't closing the clipboard before returning. Thanks b333rt for catching this.
2008-07-22 15:31:22 +00:00
Ian Thompson
20af6c61e8
Bugfix: Pasting non-text data (or trying to retrieve non-text data from the clipboard) crashed blender on Windows.
2008-07-22 14:56:02 +00:00
Ian Thompson
07b8c7e887
Updated the textplugin_outliner.py plug-in to use the new Draw.PupTreeMenu and updated this menu to support titles.
2008-07-21 19:11:38 +00:00
Ian Thompson
434f2172f6
Removed requirement for suggestions to be pre-sorted. Allowed lists of strings to be suggested without having to specify their type. Specifying a prefix when suggesting is now also optional.
2008-07-21 16:40:32 +00:00
Ian Thompson
5435d7c3ea
Oops, typo in rev. 15664 caused error
2008-07-21 11:21:49 +00:00
Ian Thompson
fab7270e40
Script template added for text plug-ins
2008-07-21 10:07:03 +00:00
Ian Thompson
6352cd509e
BPyTextPlugin now has descriptors for variables, functions and classes (and their variables/functions). Each descriptor also holds the line number of the definition allowing a simple outliner to be written.
...
Text.setCursorPos(row, col) now pops the text into view if it is in the active window space. The outliner uses this to jump to any definition in a script; it is invoked with Ctrl+T.
2008-07-21 00:38:42 +00:00
Ian Thompson
f042a468fd
Merged 15170:15635 from trunk (no conflicts or even merges)
2008-07-18 23:35:34 +00:00
Ian Thompson
123407e0b4
Added a documentation panel with primitive word-wrap functionality. It can be displayed by Text.showDoc(string) in python and has a text-plugin script for function docs which may be invoked with Ctrl+I inside its params list. Eg. type "dir(" <Ctrl+I>
2008-07-18 23:12:19 +00:00
Ian Thompson
b205cf34b4
All parsing is now done in one sweep and cached to allow details to be obtained without re-parsing. A text can be manually parsed with parse_text(text) which also updates the cache.
2008-07-18 11:00:34 +00:00
Ian Thompson
062643eefd
Fixed error when scripts were run without a visible Text to work on.
2008-07-16 12:56:23 +00:00
Ian Thompson
cc89221a24
Previously relying on import to run scripts didn't work every time and was not the right way to do it. Also fixed a problem with 'import *' not working and added the sys.modules list to the import suggestion list with a timed update.
2008-07-16 10:33:48 +00:00
Ian Thompson
512eec04aa
Made suggestions case-insensitive which also puts _ prefixed items at the bottom. Improvements have also been made to the way the list works, when it should disappear/update/confirm, etc.
2008-07-15 17:03:59 +00:00
Ian Thompson
9037159d7a
Text plugin script updates: Better error handling, variable parsing, token caching for repeat parsing of the same document. Fixed joining of multiline statements and context detection.
2008-07-15 12:55:20 +00:00
Ian Thompson
aeb4d0c631
Created a BPy module BPyTextPlugin to centralize functions used across the text plugin scripts. Also created two more scripts to handle imports and member suggestions.
2008-07-15 07:34:46 +00:00
Ian Thompson
dbb61988fd
Any script can now register a unique key combination as part of its bpy header. For a supported space type, the user may press this shortcut to invoke the script.
...
Space types that are to support shortcuts like this should call BPY_menu_do_shortcut(...) from the event queue read method (See winqreadtextspace in drawtext.c for example)
2008-07-15 07:04:31 +00:00
Ian Thompson
14c1ed0810
Fixed own platform bug with stat/fstat.
2008-06-28 00:07:22 +00:00
Ian Thompson
ab6e6b4c41
Mouse selection (LMB) and confirmation (MMB) added to suggestions UI. Also fixed the problem of offset text (horizontally scrolled).
2008-06-27 19:55:08 +00:00
Ian Thompson
aee5e95610
Modifying a file externally or deleting a file linked with a Blender Text object presents options for reloading, saving or separating the Text object from the external file (like the make local idea).
2008-06-26 18:28:33 +00:00
Ian Thompson
fc392040dd
Added readline() and reset() for reading lines from a Blender Text Object and resetting the pointer to the beginning of the buffer. readline() will return the '\n' character and return '' when the end of the buffer is reached in accordance with other readline methods.
2008-06-25 21:00:39 +00:00
Ian Thompson
e68834c75b
Added UI for suggestions list. Works with arrow-keys and mouse wheel, accept with Enter, reject with Esc or click elsewhere. Mouse selection not yet supported. The script is called from the File->Text Plugins menu.
...
Tidied python script, the C suggestions functions and fixed some bugs including suggestions not being freed properly.
2008-06-25 13:51:54 +00:00
Ian Thompson
bdc030c664
Text plugin basis with plugin for suggestions/completions. The suggest plugin works for imported global variables, methods, modules and module members. For example typing:
...
import Blender
from Blender import *
| <- cursor here suggests globals
Blender.Draw.gl| <- cursor here suggests all Draw members starting gl
Currently suggestions are listed in the console when the space is redrawn but will be presented as a menu-style list soon. Also to add are shortcut/activation keys to allow plugins to respond to certain key strokes.
2008-06-24 15:25:25 +00:00
Ian Thompson
05ce388f35
Added functions to the BPy Text object for positioning the cursor and inserting text. It seems Text.write() actually inserts *then* moves to the end of the buffer, so it doesn't really append as it says in the docs. However, with these new functions both appending and inserting can be achieved.
2008-06-17 19:26:26 +00:00
Ian Thompson
48bf0ef2ed
Improvements to whole-word ops (thanks mindrones for suggestions).
2008-06-10 15:25:05 +00:00
Ian Thompson
10d59e7208
Merged from trunk
...
svn merge -r14988:15170 https://svn.blender.org/svnroot/bf-blender/trunk/blender
2008-06-09 14:04:19 +00:00
Ian Thompson
7fd8c2424f
Fix: Convert to spaces/tabs corrupted syntax
2008-06-09 12:45:49 +00:00
Ian Thompson
39a6807348
Prevent editing of linked library Texts
2008-06-08 19:29:19 +00:00
Ian Thompson
12f5a0a228
Added file info to header. Also reopen was marking text dirty (different from disk) which it isn't.
2008-06-06 11:32:45 +00:00
Ian Thompson
a68975f4e1
Whole word operations added:
...
* Alt-Left/Right: moves cursor/selection a word to the left/right
* Alt-/Ctrl-Delete/Backspace deletes whole words at a time
2008-06-04 23:20:54 +00:00
Ian Thompson
ec4b6ba3f3
Fixed unreported bug: Backspace at top of text pushed newline onto undo stack
2008-06-04 16:03:19 +00:00
Ian Thompson
2dcab87383
Overwrite mode added, toggled with INSERTKEY
2008-06-04 12:32:06 +00:00
Ian Thompson
04fb0c6f79
First commit and merge from trunk for testing.
...
Merge: 14970-14988
2008-05-26 23:04:37 +00:00
Andre Susano Pinto
4383743ace
Fixed some compile erros under msvc (thanks lguillaume)
...
Fixed object dependency (thanks ZanQdo for pointing it out)
Make some code cleaner
(preparing for adding bvh trees on nearest surface)
2008-05-26 21:57:53 +00:00
Martin Poirier
ea760cade7
creating gsoc branch for Ian Thompson
2008-05-25 19:24:46 +00:00
Campbell Barton
b306aaccb9
patch [ #11491 ] Fix for bug 11362: Blender.Draw.Image() method does not clip properly
...
fixing [#11362 ] Blender.Draw.Image() method does not clip properly
also return silently on zero zoomlevel rather then raising an error, only raise an error on negative values.
2008-05-25 16:39:57 +00:00
Peter Schlaile
20b4bf4aba
== Sequencer ==
...
Fixes
[#12106 ] Memory leak in sequencer (>10MB/frame)
in parts: inner contents of meta strips are freed up after calculation
making more room for the cache.
Actually have to think of a mechanism, that remembers, which output
frames are asked for and caches only those.
2008-05-25 16:07:32 +00:00
Andre Susano Pinto
ad3f4c89aa
Merge BVH tree fixes from cloth branch
...
svn merge -r 14954:14963 https://svn.blender.org/svnroot/bf-blender/branches/cloth/blender/source/blender/blenlib/BLI_kdopbvh.h
svn merge -r 14954:14963 https://svn.blender.org/svnroot/bf-blender/branches/cloth/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
2008-05-25 15:47:54 +00:00
Andre Susano Pinto
ad2fecf266
Added BVH nearest neighbour code, for now only works in 6-dop and finds the node with the nearest bounding volume.
...
I'll work on making it more generic.
So far it querys faster than kdtree, but building the tree is slower.
And bvhtree NN uses an heuristic based on the last match.
Shrinkwrap (OBCube)24578 over (OBSuzanne)31658
kdtree
build: 30.000000ms
query: 1360.000000ms
bvhtree
build: 140.000000ms
query: 490.000000ms
Shrinkwrap now uses bvhtree (binary tree, 6dop) for nearest vertex.
2008-05-25 15:43:18 +00:00
Martin Poirier
03ccc38ddf
[ #11124 ] Hide Threshold button when Constant QMC sampling enabled
...
Patch by Olivier Saraja
2008-05-25 14:39:55 +00:00
Benoit Bolsee
da1f38f99d
Apply BGE patch 11137: Render objects with negative scaling correctly (as in Blender)
2008-05-25 14:37:39 +00:00