Commit Graph

36 Commits

Author SHA1 Message Date
Alexander Ewering
ca85fc5c8a Found a potential crash where NULL could be passed to vfont_get_data(),
here's the fix. Maybe it fixes Andy's file :)
2005-10-31 16:46:22 +00:00
Alexander Ewering
4bf37a3ba5 Comment out debug printf 2005-10-31 16:27:47 +00:00
Mika Saari
7ddf38a8b9 Fixing Bug: 3273, Removing my goto calls from font.c. 2005-10-28 15:36:09 +00:00
4069604736 Fixed gcc warnings for unused var and unitialiazed vars.
NOTE: I had to fix NMesh.c, Mesh_fromNMesh(), that is a real bad
function... it was returning a Py object as a Mesh (on error).
This is still not really solved (NULL return is not handled).
2005-10-28 10:09:46 +00:00
Chris Want
3aa95760bc A tweak for text follow curve -- the old comment in the code says
"why not 0.5?", so I am setting it to 0.5 since it looks way
better that way (I think somebody should really revisit this code
at some point).
2005-10-21 20:30:09 +00:00
63e02e0436 Found a crasher in editing text; load file with text, enter editmode for
it and reload. I could fix the crash quickly, but it still gives not freed
memory errors.

More important; this code is VERY BAD! Not sure who added all this *goto*
stuff, but it's not acceptable code that way... (kernel, font.c)

The hacks in editfont.c are very bad too. I really hope Alexander and/or
Mika will clean up before we officially release!
2005-10-11 19:09:27 +00:00
Alexander Ewering
76a57eb82f Fix Python API to correctly create Text3D objects. This is just a
temporary fix (duplicating code again), the *real* fix would be to once
make one central function to create and init a text object for all
places...

I also tried to introduce compatibility code to be able to load old files
with broken text objects (cu->tb == NULL due to missing init code).

Hope it works :)
2005-09-29 15:46:06 +00:00
Mika Saari
f210e88263 Coding style from spaces to tabs in files related to Unicode Font Object.
Function strlen changed to wcslen in editfont.c in ALT-U (undo) functionality.
2005-09-19 17:58:51 +00:00
Alexander Ewering
743bf0c7bb Looking at it, I could improve drawing of selection at least
*slightly* for TextOnCurve. It draws with errors, but it's at least
possible to remotely guess the selection :-)
2005-09-18 23:50:23 +00:00
Alexander Ewering
9db14ce9b3 Disabling underlining for text objects with "TextOnCurve", because it can
never work correctly with it, the way it is currently implemented.

The selection won't draw correctly either with TextOnCurve, and this is
really asking a bit much..

What to do...
2005-09-18 23:44:30 +00:00
Alexander Ewering
825d0d5d58 Fix the "Text to 3D Font" options in the text editor.
Note: The "Insert Text" button pretty much replaces this, together with
      the fact that editing 3d text is now much more powerful than the
      usual text editor ;-)
2005-09-15 22:03:41 +00:00
Alexander Ewering
1c337c49f1 Commented out the memset(...) in chtoutf8(), as it just assumed the buffer
was at least 16 bytes long, but wasn't always, and it gets cleared manually
by all calling places anyway.

Should fix crashes.
2005-09-14 17:01:03 +00:00
Alexander Ewering
98bd4615b5 On behalf of Mika Saari, the famous Unicode Font support!
Further information is available here:

http://wiki.blender.org/bin/view.pl/Blenderdev/UnicodeFont3D

Shortlist of features:

- Unicode character support for Font3D
- UI to select characters from Unicode character list
- UI to select Unicode table areas
- Optimized character loading (Load only those characters which are used
  in font object)

Please test extensively if it breaks anything, try also loading/saving
files, packing fonts, etc.

The official text regression file in the regression suite should be a
good start.

Thanks to mikasaari for this very useful addition!
2005-09-14 14:02:21 +00:00
Alexander Ewering
167d2ebc12 Fix truetype (freetype2) font loading 2005-09-04 09:30:57 +00:00
Alexander Ewering
c005095ea8 Re-enabled freetype font rendering :-) 2005-08-31 19:07:06 +00:00
Alexander Ewering
a07394ef2c More text object fancyness, and fixes:
- "Flush" is now split into two seperate Alignment modes "Flush" and
   "Justify":

   - Justify does exactly the same as a normal word processor's justify
     function does, and in addition, it uses *whitespace* instead of
     *character spacing* (kerning) to fill lines. Much more readable.

   - Flush is pretty much the old Blender "Flush" mode - and as such it
     uses character spacing to fill lines. Just as Justify, this only
     works with at least one textframe.

 - Underlining for text objects. Not a lot to explain. New button "U" in
   the editbuttons, and CTRL-U as hotkey toggle underlining for newly
   entered characters or for the selection, just like CTRL-B/CTRL-I do for
   bold/italic.

   Underline height (thickness) and Underline position (vertical) can be
   set in the editbuttons.

   Implemented as CU_POLY polygon curves.

 - The B, U and i buttons (and the corresponding CTRL-B/U/I keystrokes)
   have been fixed to only affect *one* attribute at a time. Formerly,
   hitting CTRL-B when no other style was active, on a text portion with
   italics text, for example, would kill the italics and just apply bold.

   Now, these attributes always add or substract only, but do not
   replace the style.

 - In the past, there were bugs with material indices uninitialized, and
   thus crashes in the renderer with illegal material indices.

   Even though I assume they have been fixed, I've put in a check that
   checks (hah) if the material index of a character is illegal (bigger
   than ob->totcol), and then sets it to zero, and spits out a warning
   on stderr.

   If you see such warnings, please report and link to the .blend.

 - Bugfix: All alignment modes only worked if there were at least *two*
   lines of text in the text object. Fixed


There's now a regression test file for text objects, please add to the
corresponding repository:

http://blender.instinctive.de/downloads/release/demo/text-regression.blend.gz
2005-08-29 12:46:07 +00:00
93aeb6b318 - added make_orco_curf, even does keys!
- removed {lattice,curve}_modifier functions
 - changed render code to use displist for curve rendering
   instead of making its own. required adding a bevelSplitFlag
   field to DispList. I also fixed the bevel face splitting
   which did not work correctly in many situations.
 - changed so all curve data creation happens in makeDispListCurveTypes,
   includes making bevel list and filling polys
 - changed render code to use displist for surface rendering
 - removed Curve.orco variable, built as needed now
 - removed stupid BLI_setScanFill* functions... why use a function
   argument when you can use a global and two functions! Why indeed.
   (this fixed crash when reloading a file with filled curves and
   toggling editmode)
 - bug fix, setting curve width!=1 disabled simple bevel for no
   apparent reason
 - cleaned up lots and lots of curve/displist code (fun example:
   "if(dl->type==DL_INDEX3 || dl->type==DL_INDEX3)"). Hmmm!
 - switched almost all lattice calls to go through lattice_deform_verts,
   only exception left is particles
 - added DBG_show_shared_render_faces function in render, just
   helps to visualize which verts are shared while testing (no
   user interface).
 - renamed some curve bevel buttons and rewrote tooltips to be
   more obvious
 - made CU_FAST work without dupfontbase hack

Also by the way I wrote down some notes on how curve code
works, nothing spiffy but it is at:

http://wiki.blender.org/bin/view.pl/Blenderdev/CurveNotes
2005-08-14 06:08:41 +00:00
8d2176bfeb - removed makeDispList, set_displist_onlyzero
- appropriate callers of makeDispList replaced with depgraph calls
 - unappropriate places just killed... small chance this gives some
   errors in corner cases if dep graph isn't notified (example, font
   family displists) but these can be tracked down as they show up.
 - still a large number of callers of makeDispListCurveTypes, but
   makeDispListMesh has just a few.
2005-07-15 20:56:55 +00:00
befc2bbc41 - split makeDispList into makeDispList{Mesh,MBall,CurveTypes}, there is
still a makeDispList that dispatches to the appropriate one.
   makeDispList is on the way out and this makes it easier to track down
   exactly which places use makedispList and for what types of objects.
 - switch calls to makeDispList to appropriate more specific function (if
   the object type is known by caller).
 - added mesh_changed function that invalidates cached mesh data (but does
   not rebuild, mesh data gets rebuilt on access). Most old calls to
   makeDispListMesh use this instead now.
2005-07-14 15:48:01 +00:00
28a1e8277b Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs

A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;

- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes

Armatures;

Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!

Important to note is;

1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.

- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.

TODO NOW;

- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.

TODO LATER;

We now can do loadsa new nifty features as well; like:

- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...


Bugfixes;

- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change

-Ton-
2005-07-03 17:35:38 +00:00
Alexander Ewering
08169d7fba The overlapping curves/material indices problem got a bit out of control.
- For avoiding the 'overlapping character problem' in Text objects, I had
   changed the sorting code for filling nurbs to use nu->charidx (a new
   variable incremented with each new character) instead of nu->mat_nr
   (which used to work for material indices inside a 2D Curve).

 - This broke material indices in normal 2D Curves completely, thus:

 - nu->charidx is now not only used for seperating
   characters in text objects for filling, but also for normal 2D curves
   when they contain material indices. In fact, charidx is just set to
   the material index.

 - There's compatibility code in readfile.c that sets nu->charidx to nu->mat_nr
   when reading curves from files that are not text objects

 - So, the big conclusion: Instead of using material indices for creating
   'filling groups', filldisplist() now uses nu->charidx, which is set
   appropriately when reading old files and assigning/deleting material
   indices in curves.

 - This is all pretty obscure and hard to explain. If I haven't been clear,
   ask.

 - If it breaks anything, complain!
2005-06-25 22:51:51 +00:00
Alexander Ewering
9020455429 Removed a debug print 2005-06-21 15:10:49 +00:00
Alexander Ewering
e7e61ba489 Attempt at providing the best possible flexibility and usefulness with
"Flush":

- There are now two modes, "Flush" and "Justify". Justify only flushes
  a line when it is *terminated* either by wordwrap or by Enter.

- "Flush" *always* flushes the line, also when it's still being entered.

  This mode can be used for things like this:

  http://pub.intrr.org/flush.png

  ..while "Justify" would not flush the second line.

- Fixed "Flush" squeezing all characters on the same spot if the textframe
  was set to 0 width
2005-06-18 00:52:25 +00:00
Alexander Ewering
ad8ff9762b - Fix a few warnings
- Improved text editing for justified ('Flush') text: Line will not
  be filled up until it is completed (wordwrap or Enter)

- Fixed waitcursor flickering in displist.c
2005-06-17 22:52:11 +00:00
Alexander Ewering
97df61a7e5 Initial commit for new text object.
Important notes:

 - Full compatibility with old text objects not fully restored
   (word spacing will be 0.0, need to set it manually to 1.0), will
   either need version upgrade to 238 or a hack. Will check.

 - lorem.c (about to be committed) contains BF copyright notice, but as
   BF did not exist a few hundred years ago, probably best to remove it :)

 - If you notice any cross-platform issues (especially beloved windows),
   please report

 - A few tiny warnings left, I will fix those issues still.

The rest has been said already - so have fun testing. And please do!

=== Reminder:
=== Documentation at http://blender.instinctive.de/docs/textobject.txt ===
2005-06-17 21:04:27 +00:00
8e92ee8684 - remove all obsolete inclusions of BLI_winstuff.h (due to recent changes)
NOTE: BLI_winstuff.h was meant to be a wrapper around windows.h to handle
undefining various crap that windows.h defines. Platform specific headers
should only have to be included in a few places. This reduces the number
of inclusions of BLI_winstuff.h to 16 which is a much more reasonable
number (than the 144 or whatever it used to be)
2005-03-19 21:08:13 +00:00
1411f7ed59 Fix for #1700 and #1941
When a font for 3d Text Object doesnt exist anymore, Blender could crash.
Thanks Rob Haarsma for fixing it.
2004-12-03 14:30:32 +00:00
0069a48897 Fix for strange (showed in windows only) error that delivered flat curve
deforms by default. Proved to be a [3] array passed on to function needing
[4] array. Bad bad...
Thanks Ole for finding it! :)
2004-11-21 10:42:42 +00:00
f77bc7eb7d Quite a large one this time... but now we have:
Edges in Mesh
- adds automatic when you use creases. For other situations; call the
  void make_edges(Mesh *me) in mesh.c. Of course, once in editmode the
  edges are automatically recreated.
- in F9 buttons you can add/remove edges too
- both for Mesh and DisplistMesh, so it speeds up drawing quite some in
  wireframe
- render for edges can't work... edges have no material nor tface nor col..
  so here still the faces are rendered in wire

Creases in Subsurf
- based on the code by Chris McFarlen
- main changes is that now edges are used, saving quite some data in file
- use SHIFT+E in editmode to set edges-sharpness. values go from 0-1
- in F9 buttons you can set draw-crease mode. It draws now blended from
  wire color to edge-select color (as provided in Theme)

Known issue: setting sharpness on 1 cube (subdiv 2) gives weird results
with some values... Chris, can you check?

Further; code cleanups, changing 0 in NULL when needed, no warnings, etc etc
2004-07-08 20:38:27 +00:00
dcc8af9374 Comes with previous commit. Allow linedist setting smaller than 1.0. 2004-01-16 14:50:22 +00:00
8307f2f5fe - bug fix: in background render, the default builtin font was not
activated for rendering when other fonts were packed too.
2003-11-23 23:51:18 +00:00
9aef0bab5c Modified Text alignment, it now aligns from the origin (centre) of the Text object. 2003-07-29 13:36:18 +00:00
d4f9678b39 Added a 3D font loader that uses the Freetype2 library to
parse the vector data. Freetype2 supports many font formats
including Type1, TrueType and OpenType fonts.

Enable with the WITH_FREETYPE2 compile flag, in the
source/blender/blenkernel and source/blender/blenlib dirs.
2003-04-28 21:16:27 +00:00
76fe6daa15 - another series of translated c files.
-Ton-
2003-04-26 11:56:44 +00:00
d0e346d544 updated .c files to include:
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

Just need to finish cpp files now :)

Kent
--
mein@cs.umn.edu
2002-11-25 12:02:15 +00:00
Hans Lambermont
12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00