Commit Graph

314 Commits

Author SHA1 Message Date
0cc76d831c Large change to the way sculptmode drawing works. The default is now to draw
using the standard drawing functions. Enabling the "Partial Redraw" item in the
sculpt menu will turn on the optimizations which stores unmodified parts of the
color buffer and only redraws the polygons that are within the modified area(s).

The Partial Redraw option uses the accumulation buffer to store the copy, and
unfortunately this is not accelerated on older cards. There are alternatives,
e.g. drawing to an auxiliary buffer or downloading the data from the graphics
card with glReadPixels, but there's no guarantee that these will run at an
acceptable speed on older graphics cards either. For the cards that do
accelerate the accumulation buffer (for nvidia cards, I would assume that is at
least FX5200 and up, and maybe earlier) it provides a very significant speedup.
2006-12-04 05:36:50 +00:00
b36b940807 Changed sculptmode drawing to pay better attention to materials.
This fixes bug #5274, changing from uvmode to sculpt changes lighting model
2006-12-01 01:40:53 +00:00
d2c2df2728 Small fixes for outliner stuff
* Fixed #5294 unselectable objects catching repeated selection clicks in front
of other objects
* Invisible objects stay invisible when other objects are edited
2006-11-27 21:52:34 +00:00
476af8c06a * Dupli objects (dupliverts, dupligroup, etc) now get invisibility based on their
parent object, not the original instantiated objects. i.e, if an object is invisible,
its child dupli objects will be too.
2006-11-21 03:22:34 +00:00
3d29a7c7ef * Tweak to show invisible objects if they are being edited in edit mode 2006-11-21 01:11:59 +00:00
c57d5bca73 Step one in migrating to use glArray calls in Blender
- Curve/Nurbs/Font/MBall now all draw arrays.
- had to flip abgr to rgba in shaded drawing
- Mesh drawing can't be easily done; the indices for faces are not in
  in one chunk. Also need a way to gether trias/quads, per material.

Speedup results are mixed. Something between 2-4 times. Especially for
text it seems to help.
2006-11-20 21:25:02 +00:00
5428f2eb6c * Object level restrictions in outliner
This adds the ability to restrict an individual object from:
- being visible in the 3D View
- being selectable in the 3D View
- being renderable
with 3 columns of buttons in the outliner.

These restrictions are further down the hierarchy than layers, so for example if an object is in an invisible layer, it will be invisible regardless of whether the object's own visibility setting is on or off. This works on a different conceptual level than layers, being better for more quick interaction (like temporarily making a mesh unselectable while you're posing its armature), rather than so much for scene organisation.

The 3 columns of icons can be turned off in the Outliner View menu.

Along with this is some small cleaning up in interface_icons.c and outliner.c.
2006-11-20 05:12:58 +00:00
e435fbc3c5 Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.

Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData


Replaced TFace by MTFace:

This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.


Removed DispListMesh:

This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.


Removed ssDM and meshDM DerivedMesh backends:

The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.


This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00
a54bd4993f Fixed display of modifiers in sculpt mode. 2006-11-10 08:18:16 +00:00
376851268a - Action Modifier; paths now support Speed curve.
http://download.blender.org/demo/test/2.43/0001_0150_speed.avi
  By default the Speed maps in the range 0-100 frames, since there's
  not an actual time relationship here.

  IMPORTANT: this didn't work before, and default Curve Paths have a
  speed Ipo, so past saved scenes will work different now!

- Speed curve points are now drawn on the 3D path as well. With select
  info for selected points, if Curve Object is active.

- Duplicating Objects with NLA ActionModifiers now also correctly copies
  object pointers, so a duplicate works as expected.
2006-11-08 10:51:27 +00:00
8e97a2955b Merged Google Summer of Code sculptmode/multires/retopo tools.
From the tracker:
https://projects.blender.org/tracker/index.php?func=detail&aid=5018&group_id=9&atid=127
2006-11-06 01:08:26 +00:00
916ea9b6d3 Bugfix #5153
VertexPaint mode didn't show interpolated (smooth) colors in faces.
Error caused by Modifier & DerivedMesh commit of august 22. Rules for
drawing smooth changed a bit...
2006-11-04 11:59:37 +00:00
7b53199ef4 Bugfix #5083
Deleting all points in a Curve object created empty DispList blocks. The
drawing code didn't like that.
Secured it by both fixing drawing as skipping adding empty DispLists.

Special thanks to Fernando Bastos for the extensive stack tracing.
2006-11-03 15:55:43 +00:00
Nathan Letwory
10fbfdad10 whitespace commit 2006-11-03 06:42:08 +00:00
Nathan Letwory
c33550bd55 fix bug #5133
* when an object had wire draw in Draw Extra enabled and
  it was selected and set as a scene, it would draw
  as selected. Changed so it draws the wires in a grey
  shade, to communicate it is not in the active scene
2006-11-03 06:39:58 +00:00
05ee7d9053 =translate hoek to angle=
renamed the dutch variable hoek to angle globally arithb.c changes done by Matt Plough
2006-10-14 23:27:18 +00:00
e868f223dc New shadow feature: Irregular Shadow Buffers
Full log:
http://www.blender3d.org/cms/Irregular_Shadow_Buffe.785.0.html

In short: this is a shadow buffer approach that always results in crispy
shadows, independent of lamp buffer size or zoom level. This shadow buffer
system also supports transparent shadow.

This is part of work on refreshing Shadow Buffers in Blender. You now can
choose of two types (Classical, Irregular). More types will follow. Also
quality issues for Classical shadow buffers are going to be reviewed,
especially to solve the lousy Biasing.

For the CVS log record; it is based on articles:
Gregory Johnson et al, University of Texas, Austin. (Regular grid method).
Timo Aila and Samuli Laine, Helsinki University of Technology. (BSP method).
2006-10-14 10:21:19 +00:00
1be92c8b19 * Added a new empty draw type - single arrow. This can be useful in situations
where you just need a direction, like a wind or vortex force field for example.
2006-10-12 07:54:32 +00:00
ed2560488b As discussed during meeting, Changed curve length/tilt markers to indicate direction.
That is, a 3D curve now displays as ->->->-> instead of -|-|-|-|.

Comparing the two, I didn't find the arrow display any more confusing then the straight lines when dealing with loops and tilt variations. Sharp turns are more likely to display crossed lines though.

Others should feel free to disagree and make it better.
2006-10-01 18:28:46 +00:00
0cd7ee76a4 made fgon edges not draw lengths with length draw option 2006-09-27 18:08:54 +00:00
26520225ee Special request: Drawmode "bounding box" now supports drawing 'extra' too,
like axis or object name.
2006-09-14 12:40:53 +00:00
4603f452c2 Animation department feature request: support for vertex groups in Lattices
In a quick glance: (temp image)
http://www.blender.org/bf/rt.png

Main reason is that Lattices are useful a lot for Armature deformation.
Lattices just provide much more precise and interesting control. However,
with only bone envelopes it's very hard to use.

Working with Lattice vertex groups is nearly identical to Mesh:
- on CTRL+P 'make parent' you can choose the deform option now
- In editmode, the buttons to control vertex groups are available
- In outliner you can select vertexgroups too
- Deforming Lattices with Armatures has all options as for Mesh now.

Note:
- No WeightPaint has been added yet. To compensate, the editmode
  drawing for a Lattice with vertex group shows weight values for the active
  vertex group.
- Lattice editmode doesn't undo/redo weight editing yet.
- Softbody for Lattice still uses own vertex weights

Implementation notes:
- derivedmesh weight_to_rgb() is now exported to drawobject.c
- been doing cleanups in code (order of includes, var declarations, etc)
- weightpaint button handling now is generic

I've checked on Brecht's proposal for Custom Element data;
http://mediawiki.blender.org/index.php/BlenderDev/CustomElementData
It could have been used, but that would mean the existing code for
vertexgroup handling and armature deform couldn't be re-used. I guess this
is really a later todo.
2006-09-03 12:16:14 +00:00
ab5cc740d6 added the option to draw sharp edges.
had to make some room in the "Mesh Tools 1" panel,
removed "Center" - its alredy in the "Mesh Tools" panel, and grouped the "Normal" draw buttons.
At the moment mixing modes dosnt work, we will need to review this to see if its worth attempting.
2006-08-31 06:03:24 +00:00
433f6c7043 Integration of the Google Summer of Code Modifier Stack Upgrade project. The
main features are:
* Modifiers can now be in any order in the modifier stack
* DerivedMesh now has a standard framework for custom element data to be passed
  through the stack with mesh data (being copied and interpolated as
  appropriate), so modifiers can access whatever data they need
* The modifier stack code has been refactored and a number of bugs have been
  removed
* The EdgeSplit modifier has been added:
  http://mediawiki.blender.org/index.php/BlenderDev/EdgeSplitModifier
* The DerivedMesh modifier has been added:
  http://mediawiki.blender.org/index.php/BlenderDev/DisplaceModifier
* The UVProject modifier has been added:
  http://mediawiki.blender.org/index.php/BlenderDev/UVProjectModifier

For more info, see:
http://mediawiki.blender.org/index.php/User:Artificer/ModifierStackUpgrade
(currently undergoing reorganisation)
2006-08-28 01:12:36 +00:00
0dcfab3e32 - bug fix, bug reported by Campbel, thanks! Keep in mind, that integration
of verse supports only sharing of mesh geometry now, you can't share
   vertex color, vertex weight, etc.
2006-08-21 13:19:18 +00:00
2ee42ac01e Huge commit: VERSE
- All code is in #ifdef ... #endif
 - Only make build system is supported and you have to add:
    export WITH_VERSE=true
   to user-def.mk file
 - Blender can share only mesh objects and bitmaps now
 - More informations can be found at wiki:
    http://mediawiki.blender.org/index.php/BlenderDev/VerseIntegrationToBlender
    http://mediawiki.blender.org/index.php/BlenderDev/VerseIntegrationToBlenderUserDoc

  I hope, that I didn't forget at anything
2006-08-20 15:22:56 +00:00
cf1964cf9c unmixing code and var declarations. 2006-08-13 12:49:31 +00:00
e3d78dd4e1 * Fix: Disabled radius tapering on 2d curves with filled front or back. It would be
really cool to get this working solidly, but there are many potential problems with the
triangle face creation across the flat surfaces, especially when there are holes inside
the curves. Maybe this could be a fun project for someone better at this than I? :)
Taper object curves still cause similar problems...

* Made the curve radius affect the 'Nsize' curve normal drawing too, so you don't need a
bevel to see the value.
2006-08-13 08:31:59 +00:00
342671308c Bugfix 4783
- draw-extra for Lamps did not follow selection color
- Surface objects were drawing curves always in unselected color, also its
  draw-extra options didn't follow selection color then
2006-08-11 09:09:50 +00:00
c2edcd4879 Siggraph show commit!
- pending commit for OSX intel systems, with intel graphics. These now call
  an extra swapbuffers after glFlush(). Code is ifdeffed, and doesnt affect
  other systems.

- show-off commit: option to have transparent nodes over the composite
  result. Only draws Image for active Viewer Node now, and image doesnt
  translate nor zoom (which isnt bad though).
  Set in themes the alpha color of "node backdrop" to make nodes
  transparent.
2006-07-31 19:23:42 +00:00
1673b56dd3 Bugfix #4565
Curves without bevel/extrude don't react to buttons to fill front/back.
That is coded that way, so added this info to the tooltip

Bug report #4566

Creases drawing became very awkward in commit in august last year. Flipped
the drawing order so the fat lines - denoting creases - are drawn first.
That way the value of crease is visible, as well as edge selection state.
2006-07-02 11:21:06 +00:00
4d45723dd1 Bugfix #4497
When using Node Shaders, the OpenGL color (solid drawmode) in 3d window
was still using the base Material only. That's a bit counter-intuitive
yes... i've replaced this with a function that checks for the active
material node color. Not perfect, but at least interactive.
2006-06-27 12:19:32 +00:00
098c73f441 Bugfix #4471
Using Weight/Vertex Paint, the current color was not reset, causing Object
name or axes to draw in random colors.
2006-06-26 08:16:16 +00:00
8988a0de38 Bugfix #4329
New "Dimension" button: when using TAB to cycle over buttons, the dimension
event was sent multiple times, accumulating scaling. The code was also not
prepared to handle multiple changes at one event.

Also: added object_get_boundbox(Object *ob) in BKE_object.h, so the code
now really supports most primitives in Blender.
2006-06-14 08:50:41 +00:00
29bcb903e9 Bug fixes of own collection:
- Selection wasn't possible on center dots in Object mode. I keep adding
it and it keeps disappearing again. Added clear comments in code too.

- Particles: (debug still) print "build particles" happened on each redraw
  when "Display percentage" for particles was set to zero.
2006-06-11 09:43:05 +00:00
908389b787 Bugfix #4293
And more particle issues... the attempts to allow particle systems to be
part of duplicators (groups especially) isn't easy to get working!
This commit solves regular animated particle systems... they rendered on
the wrong location, using wrong object transform.
2006-06-09 11:15:52 +00:00
69546bcf08 Bugfix #4259
Static particles, drawmode Shaded or Texture, colors for strands were wrong
2006-06-02 12:34:09 +00:00
7706d2e40f * Made the editmode text cursor draw inverted, so you can actually see where it is on a black background 2006-05-22 05:52:48 +00:00
1e0037045d Bugfix #3961
When using CTRL+L for materials, you can end up with non-existing material
indices in faces. The drawing code then was still happily drawing the old
situation (or something random, its a static array).

This commit checks the maximum amount of materials on an object, and draws
the last available material for a non-existing index. It uses an ugly
global yes, but this code is bad anyway. :)
2006-04-08 15:58:49 +00:00
16082eb732 Bugfix #4010
Dynamic particles sometimes didn't properly use global coordinates.
Meaning they were transformed by an Object, for example when it has
animation constraints.

Error caused by attempt to get duplicators to work for particles. Will
need re-evaluation this.. for now restored old functionality, with
exception of dupli-groups.
2006-04-08 14:50:04 +00:00
04fc04bcdd Make editmesh edge length and face area drawing's precission proportonate to the gridsize.
Needed when working with small models.
2006-03-27 14:57:53 +00:00
6b6511b54c Fix for messy commits in attempt to fix groups wire colors...
- if you add new theme colors, you need to initialize them correctly and
  add that in the usiblender.c version patching for saved themes
- the code for detecting group membership was highly confusing
- group colors were even used for non-groups

Further; I didnt add group theme colors yet, that's not a bug. It's a todo
item I preferred to tackle with having a decent wirecolor system once.
2006-03-11 18:51:41 +00:00
1c5aa14c5d fix for bug 3970
.
2006-03-10 19:49:25 +00:00
e932576bb7 fix bug 3970
.
2006-03-10 19:47:36 +00:00
0a6c3993bf fix for bug 3970
.
2006-03-10 18:52:49 +00:00
9a36e9b651 Sorry for the big commit, but I've been fixing many of these
issues in parallel... So this commit contains: an update of
the solver (e.g. moving objects), integration of blender IPOs,
improved rendering (motion blur, smoothed normals) and a first particle
test. In more detail:

Solver update:
- Moving objects using a relatively simple model, and not yet fully optimized - ok
  for box falling into water, water in a moving glass might cause trouble. Simulation
  times are influenced by overall no. of triangles of the mesh, scaling meshes up a lot
  might also cause slowdowns.
- Additional obstacle settings: noslip (as before), free slip (move along wall freely)
  and part slip (mix of both).
- Obstacle settings also added for domain boundaries now, the six walls of the domain are
  obstacles after all as well
- Got rid of templates, should make compiling for e.g. macs more convenient,
  for linux there's not much difference. Finally got rid of parser (and some other code
  parts), the simulation now uses the internal API to transfer data.
- Some unnecessary file were removed, the GUI now needs 3 settings buttons...
  This should still be changed (maybe by adding a new panel for domain objects).

IPOs:
- Animated params: viscosity, time and gravity for domains. In contrast
  to normal time IPO for Blender objects, the fluidsim one scales the time
  step size - so a constant 1 has no effect, values towards 0 slow it down,
  larger ones speed the simulation up (-> longer time steps, more compuations).
  The viscosity IPO is also only a factor for the selected viscosity (again, 1=no effect).
- For objects that are enabled for fluidsim, a new IPO type shows up. Inflow
  objects can use the velocity channels to animate the inflow. Obstacles, in/outflow
  objects can be switched on (Active IPO>0) and off (<0) during the simulation.
- Movement, rotation and scaling of those 3 types is exported from the normal
  Blender channels (Loc,dLoc,etc.).

Particles:
- This is still experimental, so it might be deactivated for a
  release... It should at some point be used to model smaller splashes,
  depending on the the realworld size and the particle generation
  settings particles are generated during simulation (stored in _particles_X.gz
  files).
- These are loaded by enabling the particle field for an arbitrary object,
  which should be given a halo material. For each frame, similar to the mesh
  loading, the particle system them loads the simulated particle positions.
- For rendering, I "abused" the part->rt field - I couldnt find any use
  for it in the code and it seems to work fine. The fluidsim particles
  store their size there.

Rendering:
- The fluidims particles use scaled sizes and alpha values to give a more varied
  appearance. In convertblender.c fluidsim particle systems use the p->rt field
  to scale up the size and down the alpha of "smaller particles". Setting the
  influence fields in the fluidims settings to 0 gives equally sized particles
  with same alpha everywhere. Higher values cause larger differences.
- Smoothed normals: for unmodified fluid meshes (e.g. no subdivision) the normals
  computed by the solver are used. This is basically done by switching off the
  normal recalculation in convertblender.c (the function calc_fluidsimnormals
  handles other mesh inits instead of calc_vertexnormals).
  This could also be used to e.g. modify mesh normals in a modifier...
- Another change is that fluidsim meshes load the velocities computed
  during the simulation for image based motion blur. This is inited in
  load_fluidsimspeedvectors for the vector pass (they're loaded during the
  normal load in DerivedMesh readBobjgz). Generation and loading can be switched
  off in the settings. Vector pass currently loads the fluidism meshes 3 times,
  so this should still be optimized.

Examples:
- smoothed normals versus normals from subdividing once:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_1smoothnorms.png
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_2subdivnorms.png
- fluidsim particles, size/alpha influence 0:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_3particlesnorm.png
  size influence 1:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_4particlessize.png
  size & alpha influence 1:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_5particlesalpha.png
- the standard drop with motion blur and particles:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t2new.mpg
  (here's how it looks without
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t1old.mpg)
- another inflow animation (moving, switched on/off) with a moving obstacle
  (and strong mblur :)
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t3ipos.mpg

Things still to fix:
- rotating & scaling domains causes wrong speed vectors
- get rid of SDL code for threading, use pthreads as well?
- update wiki documentation
- cool effects for rendering would be photon maps for caustics,
  and motion blur for particles :)
2006-02-27 11:45:42 +00:00
ecaee2e3c8 Fix for very old annoyance; when an object is deformed far away from its
object center, it doesn't generate displaylist (or derivedmesh). This
error showed especially on loading files, and you had to advance frame,
zoom out or press Numpad-9 to see stuff.
2006-02-21 22:42:33 +00:00
3753d817ab Seam Cutting in Faceselect Mode:
- Mark Border Seam: mark edges on the border of face selection as seam.
- Clear Seam: clears seams in selected faces.
Hotkey: Ctrl+E

- Alt+RMB Click: mark/clear edge as seam
- Alt+Shift+RMB Click: mark/clear seams along the shortest/straightest path
  from last marked seam. The cost of the path also includes some measure of
  'straightness' next to the typical distance to make things work more
  predicatble and edgeloop friendly. Note that this cuts a path from edge to
  edge, not vertex to vertex. That gives some nice control over the direction
  of the seam.

Also includes:

- Removed old LSCM code.
- Fix updates glitches with DerivedMesh/Subsurf drawing in FaceSelect mode.
  Now there's a drawMappedFacesTex instead of drawFacesTex.
- Minimize Stretch menu entry called Limit Stitch.
- Removed the lasttface global, was being set before it was used anyway, so
  might as wel return from a function.
- Moved some backbuf sampling code to drawview.c from editmesh, so it can be
  used by Faceselect and VPaint.
- Use BLI_heap in parametrizer.c.
2006-02-08 21:01:00 +00:00
03ae9e70b8 * If an empty is a forcefield, scale the 3D forcefield shape with the empty drawsize 2006-02-07 13:05:17 +00:00
240e25ab65 Cleanup of blender/ module; Makefiles now compile this warning free.
Mostly was unused variables, unused functions, missing prototypes and
missing include files.
2006-01-28 20:17:48 +00:00