Commit Graph

214 Commits

Author SHA1 Message Date
f7cb86df3a 2.5
Think global, act local!

The old favorite G.scene gone! Man... that took almost 2 days.
Also removed G.curscreen and G.edbo.

Not everything could get solved; here's some notes.
- modifiers now store current scene in ModifierData. This is not
  meant for permanent, but it can probably stick there until we
  cleaned the anim system and depsgraph to cope better with
  timing issues.
- Game engine G.scene should become an argument for staring it.
  Didn't solve this yet.
- Texture nodes should get scene cfra, but the current implementation
  is too tightly wrapped to do it easily.
2009-01-04 14:14:06 +00:00
bdfe7d89e2 Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416

Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
  later added in trunk also, but reverted partially, specifically revision
  16683. I have left out this reversion in the 2.5 branch since I think it is
  needed there.
  http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
  for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
  -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
  differently. Since this is changed so much, and I don't think those fixes
  would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
  initialized when running with -P. The code that initializes the screen there
  I had to disable, that can't work in 2.5 anymore but left it commented as a
  reminder.

Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.

Still to be done:
* Go over files and functions that were moved to a different location but could
  still use changes that were done in trunk.
2008-11-12 21:16:53 +00:00
22bcbc5742 fix for more disable python defines,
FTOCHAR didnt have brackets around the value. FTOCHAR(a+b) didnt work, FTOCHAR((a+b)) did.
2008-10-29 16:49:51 +00:00
ac4ff83ca6 added scons option BF_WITH_PYTHON (defined as DISABLE_PYTHON) 2008-10-28 18:47:13 +00:00
5f7359a4ad Cleaned up unused variables and functions. 2008-09-27 19:57:32 +00:00
ff6d4e84cb text editor changes
* out of sync text dosnt automatically popup a menu anymore since it was too easy to click on it without intending to, moved this to an alert button on the header.
* "_" character was acting as a delimiter, but in python its not.
* renamed "File" to "Text" (so as not to confuse with blenders file menu)
* added redraw_alltext function to remove many duplicate loops where every text display is redrawn.
2008-09-27 15:32:28 +00:00
18fe6c27ff Compiling/Warning Fixes (for scons/mingw + "split sources hack") Part 1:
* Removed compiler warnings from texteditor work
* Added round brackets around the new defines for IPO channels for extra texture layers
* Tweaked priorities so that BLI_heap_* functions in blenlib can be found by linker (split-sources specific)

TODO:
* "monkey*" vars cannot be found still
2008-09-05 06:05:25 +00:00
062bf735e7 Minor tidying and commenting 2008-08-31 16:23:31 +00:00
bf0803c0c2 Added better grouping for text markers with a separate group field (instead of using flags). The lower two bytes of the group are used for python scripts while the upper two (or more) are reserved for internal grouping. Plenty either way. 2008-08-24 13:30:35 +00:00
5c2015fa89 Fix for fix. Forgot to check if markers exist before trying to clear. Oops 2008-08-17 09:46:47 +00:00
9b6dffad2d Fixed problems with markers where Edit All did not behave the same for every marker and deleting selections that intersect markers did not remove the marker in all cases. 2008-08-16 20:31:38 +00:00
310a6e2179 Esc removes markers in stages. Temporary markers are removed first (if any) then other markers follow. 2008-08-16 14:38:08 +00:00
55438d9fe0 Small bug fix: Scripts were not being recompiled after an error, if the (auto-selected) erroneous text was simply deleted and the script re-run. 2008-08-13 17:29:51 +00:00
d7f64d43dd Whole word ops. now treat symbols differently to whitespace allowing better control over cursor movements (solves mindrones' request). 2008-08-08 23:14:32 +00:00
6c0f4660ed Various UI drawing and event tweaks to make markers feel more natural and avoid getting in the way. If there is a marker under the cursor, ESC will remove it and others in its group. Otherwise all temporary markers are removed. Tab finds/cycles/removes temp. markers, cycles non-temp. markers (under cursor) and behaves normally in all other cases. 2008-08-06 13:46:44 +00:00
799ba2c351 Added a Python interface to the marker system with a few additional functions for modifying text selections in general. Tweaked some of the events and drawing code and added a template completion script along the lines of gedit's snippets. 2008-08-05 23:23:31 +00:00
53e535dfcf Text Markers: multiple, coloured selections within a Text object with group relationships. They allow portions of text to be edited as one and enable quick jumping between and editing of different areas.
Flags control the behaviour and grouping of markers. At present, Ctrl+M places a marker with TMARK_EDITALL set for testing purposes.

I have also split the text area event handler into separate methods for marker handling and the existing text tools. This makes the events system much easier to follow as it was getting a little hairy.
2008-08-04 23:01:47 +00:00
12f0fb1a42 Draw cursor at the leading edge of selection (as in other apps.) and hide cursor swapping from the user. 2008-07-28 11:54:13 +00:00
f45aca0447 Complete rewrite of syntax highlighting and formatting. Some improvements:
- Takes less than half the time to format a full document
 - Where possible only the required lines are re-parsed when text is changed (was the whole file, for every key press!)
 - Memory is allocated in one place only (there were all sorts of problems here)
 - Should be easily extensible for other scripting languages
 - Lots of comments to make it very easy to follow / change
 - def and class are now properly coloured. They had a theme colour but the checks didn't work.
2008-07-28 11:05:35 +00:00
01a6d44b07 Undo Fix: Down arrow on last line sent cursor to end (right) but undo sent it up. Similar for up arrow on first line. Undo was then off by a line. 2008-07-26 22:37:05 +00:00
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
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
f042a468fd Merged 15170:15635 from trunk (no conflicts or even merges) 2008-07-18 23:35:34 +00:00
14c1ed0810 Fixed own platform bug with stat/fstat. 2008-06-28 00:07:22 +00:00
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
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
48bf0ef2ed Improvements to whole-word ops (thanks mindrones for suggestions). 2008-06-10 15:25:05 +00:00
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
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
ec4b6ba3f3 Fixed unreported bug: Backspace at top of text pushed newline onto undo stack 2008-06-04 16:03:19 +00:00
2dcab87383 Overwrite mode added, toggled with INSERTKEY 2008-06-04 12:32:06 +00:00
110f927c63 Changed frame numbering to only alter hashes if they are in the filename (not the directory name) to fix bug [#10566] File Open Dialog replaces '#' with '0' in directory names.
removed frame numbering from BLI_convertstringcode into its own function (BLI_convertstringframe), many uses of BLI_convertstringcode were passing dummy frames values anyway.
in cases where adding the current frame number to a filename is needed run BLI_convertstringframe(...) after BLI_convertstringcode(...)

There are some cases Im not sure BLI_convertstringframe is needed, these have been commented as todo, but at least have the same functionality they used to.
2008-05-04 09:41:15 +00:00
b846e7a3bf fix for #7314
solution provided by Leandro Inocencio
2008-05-02 15:45:15 +00:00
c8376869b1 BLI_split_dirfile was being used in cases it should not have been,
Added BLI_split_dirfile_basic, that only splits the path into directory and file. without checking the dir exists or creating it, without changing the original string that is passed to it.
2008-04-26 13:08:57 +00:00
b94f3d0fcb fix/workaround for blender crashing when running python runs text.clear() in background mode. ideally python api would not use this function. 2008-04-25 10:12:32 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
ecc4ccf68f Fix compiling error.
Typo in text.c
2008-03-13 18:47:55 +00:00
217db14ae7 Fix for bug #8548: txt_copy_sel in txt_cut_sel only copied string in a local buffer.
Changed txt_cut_sel to use the clipboard.
2008-03-13 17:30:29 +00:00
d560b17088 fix for [#8408] Indentation error in text editor when typing a colon anywhere 2008-03-01 12:31:00 +00:00
Chris Want
5e3cffc64a Patch to change license to GPL only, from GSR. 2008-01-07 19:13:47 +00:00
58bf29e389 removed blenderdef.h, BIF_*, BDR_* and BSE_* header files (except for BIF_gl.h and BIF_glutil.h) 2008-01-01 18:16:10 +00:00
021cd4aac3 python api
removed most custom add_*data* wrappers from Main.c
removed makeCurrent() from Text.c (was never in a release), use "bpy.texts.active = text" now
clamp new image sizes
made add_empty_action accept a string rather then a blocktype since the blocktype was only being used to choose one of 3 strings anyway.
2007-03-12 06:21:58 +00:00
e0c77c0f14 made all data adding functions accept a name such as add_mesh or add_curve, previously only some datatypes adding functions accepted a name.
also updated the Bpy.py epydocs
2007-03-11 16:25:17 +00:00
bb802607eb Bugfix #1676
Ancient bug: texteditor input was limited to "isprint()" characters, the
default non-accented simple ascii set. I've removed that.

Now we still have a conflict with hotkey handling, so ALT+character input
won't work. But, for keyboards that have special character keys from itself,
this patch will allow typing them in Text now.
2006-11-26 16:03:36 +00:00
Ken Hughes
dfb545a77c Fix some warning for unsigned vs signed comparisons. 2006-04-03 20:31:10 +00:00
042d612df2 Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:

Render:
- Full cleanup of render code, removing *all* globals and bad level calls
  all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
  default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
  tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.

Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
  easier use of movies in Blender

PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
  code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)

3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
  (pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
  rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!

Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
  with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
  done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
  window. (yes, output nodes to render-result, and to files, is on the list!)

The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
  system should be built from scratch. I can't really understand this code...
  I expect it is not much needed, especially with advanced layer/passes
  control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
  recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
  effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
  to check first the option to render to a Image window, so Blender can become
  a true single-window application. :)
  For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again

OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
b1c6fe7337 Bug #3658 reported by Daniel Holtz (thanks):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=3658&group_id=9

Running scripts from command line in bg mode:
blender -b -P myscript.py
crashes Blender 2.40.

The problem is in add_text() in text.c: G.scene can be NULL at this
point (in bg mode). Added a check:

line 323:
	if (G.scene) /* can be NULL (bg mode) */
		BLI_convertstringcode(str, G.sce, G.scene->r.cfra);

The text being added with add_text() in this particular case is the
script filename specified at the command prompt, so it should be ok to skip
BLI_convertstringcode. Feel free to disagree, though.
2006-01-06 20:15:18 +00:00
Stephen Swaney
d32b100464 bugfix: #3420 Indent/Unindent in text editor not undoable
contributed by Mr. TextEditor - themyers.  Thanks!
2005-12-12 18:35:15 +00:00
d1be55f41c Small fix to allow relative filenames for textfiles. 2005-11-06 16:32:54 +00:00
Stephen Swaney
615c2f40a1 text editor patch by antihc3.
fixes 'Memoryblock free: attempt to free NULL pointer' errors.
2005-05-19 03:15:49 +00:00