Commit Graph

1129 Commits

Author SHA1 Message Date
Janne Karhu 912c2f440b Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
	- exact (not marked)
	- outdated (simulation is not done completely with current settings)
	- non-exact (frames were skipped during simulation)

* The parameter "cache step" effects the number of frames between saved cache frames.
	- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
	- Speeds up the "quick caching" very much.
	- Frames between cached frames are interpolated from the cached frames.
	- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.

* The caching can work in normal or "quick" mode:
	[Normal cache]
	- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
	- Becomes non-exact: After larger than 1 frame steps.
	- Becomes outdated: After any change effecting the simulation other than frame steps.
	- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.

	[Quick cache]
	- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
	- Becomes non-exact: Always from frame 1 (unless cache step = 1).
	- Becomes outdated: Never.
	- Pros/cons: Not very accurate, but super fast!
	- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.

* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
	- step forwards (to unknown) -> simulate from last exact frame, store result
	- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame

* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
	- Baking does the same, but runs the simulation all the way to the end of simulation.
	- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
	
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".

* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
Campbell Barton 8ead648fd1 Spring Cleaning
* removed radiosity render code, DNA and RNA (left in radio render pass options), we'll get GI to replace this probably, better allow baking to vertex colors for people who used this.
* removed deprecated solid physics library, sumo integrations and qhull, a dependency
* removed ODE, was no longer being build or supported
* remove BEOS and AMIGA defines and references in Makefiles.
2009-06-21 16:18:38 +00:00
Janne Karhu 1f9368b37e Particle system parenting
* Allows moving, rotating & scaling of particle simulations.
* Setting in particle render options.
* Changes viewed & rendered particles from global space to parent space.
* Doesn't effect simulations at all.
2009-06-21 11:09:16 +00:00
Janne Karhu 6b15024f4a Pointcache refresh part 1:
* Particles support larger than 1 frame changes, bigger frame changes can result in inaccurate results, but it's super fast and you get a nice feeling of how the particles behave!
* "Cache to current frame" button calculates the exact result of particles at current frame.
* Current state of cache can be protected by making it a bake.
* Cache is now in memory by default, disk cache is an option.
* Only "viewport %" number of particles are calculated and cached in viewport, baking and rendering calculate all particles.
* Info on cached frames and memory usage given in ui.
* Support for exact "autocaching" of changes and large frame changes(disabled for now until exact place in event system is decided)
* "Continue physics" is probably deprecated after this and should be removed once sb & cloth use the new cache code.

Todo:
* Make softbody & cloth use the new cache things.

Other changes:
* Some cleanup of particle buttons.
2009-06-21 10:16:52 +00:00
Campbell Barton a1cf7988c1 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20855:20928
Sequencer changes from source/blender/src coming next
2009-06-16 14:21:58 +00:00
Kent Mein 76cd7046bb coverity issue CID: 44
Checker: FORWARD_NULL (help)
File: base/src/source/blender/render/intern/source/texture.c
Function: do_lamp_tex
Description: Variable "co" tracked as NULL was dereferenced.

co was set to NULL at the beginning of the function and it could
possibly slip through all the logic above so lets test it before
we use it blindly.

Kent
2009-06-13 15:54:39 +00:00
Campbell Barton eed13b43b1 merged from trunk 20741:20848
* Missing changes to release/windows/installer
* Sequencer fixes in source/blender/src/seqaudio.c dont apply to 2.5
* brechts fix for #18855 r20763 wasnt merged, does this apply to 2.5?
2009-06-13 11:09:13 +00:00
Brecht Van Lommel e917b1043e Fix for bug #18860: particle hair strands missed first segment
when rendering as regular geometry (not strand render).
2009-06-09 18:25:57 +00:00
Brecht Van Lommel 20eaa1466d Fix for bug #18881 and #18866: Surface option for Fields crashed
on non-mesh objects, so hide it if not applicable. Also made it
support surf, curve, font objects.
2009-06-09 13:03:00 +00:00
Brecht Van Lommel c8b4cf9206 2.50:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD

Notes:
* Game and sequencer RNA, and sequencer header are now out of date
  a bit after changes in trunk.
* I didn't know how to port these bugfixes, most likely they are
  not needed anymore.
  * Fix "duplicate strip" always increase the user count for ipo.
  * IPO pinning on sequencer strips was lost during Undo.
2009-06-08 20:08:19 +00:00
Ton Roosendaal ca6a8a233b 2.5
Preview renders:

- Added proper button type (BUT_EXTRA) for preview buttons, to
  handle drawing better. It now first draws an alpha mask, to 
  ensure the preview is correctly fitting inside the widget style.
  It then draws the outline.
- Added protection for executing preview renders while regular
  rendering, that's not going to work...
2009-06-08 10:00:14 +00:00
Ton Roosendaal c1135d489b 2.5
Preview renders now re-use a rendered buffer when size is same.
Looks nicer while sliding, and no memory free/allocating.
2009-06-07 13:16:31 +00:00
Ton Roosendaal a2f9ca3b3f 2.5
Nice goodie: Preview renders!

- Added new preview.blend, allowing super wide cinemascope previews
- Draws nicely blended inside widget type, rounded corners
- Preview now renders using all available cpus/cores.
- Uses - hopefully rock stable - method, which doesn't copy or 
  allocate anything for previews, but just uses render API calls.
- Multiple previews are possible! But, added provision in Jobs
  manager to only render one preview job at a time. If you start
  more preview jobs, they're suspended until it's their turn.

Bugfix: new buttons context code crashed when going full-window.

Tweaks are still needed for notifiers. I have to figure out still
how to retrieve SpaceButs button view types...
2009-06-07 11:12:35 +00:00
Janne Karhu 880c43ad5a First new particle code:
-Many things not yet working properly :)
-Experimental new (hopefully more logical) categorization of buttons, feedback on this is very welcome.
-Separate render & draw types, for example now there is actually a render option "halo" instead of all the different point draw types.
-Particles get recalculated only from buttons that actually change something that has to be recalculated, for example changing visualization doesn't reset particles any more.
-Boid physics buttons are still missing as I'm currently redoing the whole boids code.
-Point caching is still very wip, so baking is not possible for example, but I added a few cache baking flags for rna that were/will be needed for particle buttons logic.
2009-06-05 23:59:33 +00:00
Ton Roosendaal 7c4fccd684 2.5
Cleanup commit:

- Yafray removed. Also did cmake/scons files, but didn't compile with it,
  so test would be appreciated :)
- Removed old crap from Windows release dir, should be checked on
  further by windows release builder later.
2009-06-01 12:10:30 +00:00
Ton Roosendaal 011d91624e AO render error, caused by bugfix after RC3 :(
My bug fix to support AO with "Amb" texture channel changed code too that calls
AO as a pre-shade process, when texture isn't calculated yet. This caused very
first pixel in a tile to show wrong AO.

Especially myself deserves a kick in butt for not testing the regression files 
for release binaries again! Error shows clearly... in the cornelius_passes 
.blend file.
2009-05-31 11:22:11 +00:00
Ton Roosendaal 33304d022d Bugfix #18801
Third transparent shadow bug... this time it's a Material Node, which
has mirror + transp-shadow on, and when it traces its own material it 
enters an eternal loop...

Raytracing + shading + materialnode combo really needs work!
2009-05-26 13:46:08 +00:00
Brecht Van Lommel a47c673b55 2.5 Material:
* Added material "type" property, with Surface/Volume/Halo
  options, compatible with sim_physics, as requested for
  material buttons layout. Obviously the Volume setting
  does nothing currently.
* Deprecated MA_HALO flag in favor of this.
2009-05-20 13:34:04 +00:00
Janne Karhu ac0766c64b Fix for [#18785] Crash rendering hair particle system 2009-05-20 12:13:37 +00:00
Ton Roosendaal d4116adf11 Bugfix #18676
Texture "map to" Ambient did work now (previous fix) but not for
ambient occlusion yet.
2009-05-17 10:30:13 +00:00
Ton Roosendaal 34f99fa4b9 Bugfix #18743
Render: raytracing materials with transp-shadow + SSS crashed
2009-05-14 11:36:52 +00:00
Campbell Barton d2cff7307d [#18685] dark pixels created when during texture "full baking"
fix/workaround - offset by a 500th of a pixel to avoid baking missing pixels that are between 2 faces, its still possible pixels could be between faces but much less likely then it is currently with pixel aligned UVs.
2009-05-14 02:21:50 +00:00
Ton Roosendaal 03a0770df5 Bugfix #17929
Old bug (2.42): when using node material, transparent shadow did not work.
It was missing to set the proper 'pass flag'.

Do note an important difference with non-node materials for 'transparent shadow'. 
If there are no nodes, it uses the color from the unshaded material. When it has 
nodes, it uses the color output from the entire node tree, which is typically 
from shaded materials. The latter is because node shaders have no support for 
shade passes yet (it only outputs rgb + a).
2009-05-03 17:48:32 +00:00
Ton Roosendaal b89126dbe8 Bugfix #18676
Map a texture to Material Ambient factor didn't work. 
Probably not since 2.42 or so... :)
2009-05-03 12:06:43 +00:00
Brecht Van Lommel 22df42cdec Fix for bug #18032: AAO pixel cache + refraction artifacts, the pixel
cache can only be used for the first hit.
2009-04-27 11:49:40 +00:00
Ton Roosendaal 971cabc2d6 Bugfix #18058
Ray-transparent didn't pass on thread number to shading code, giving
"blothes" in render, when using node materials.

This also rewinds Campbells commit of feb 21, which tackled the error,
but not the cause.
2009-04-22 17:06:47 +00:00
Ton Roosendaal c09b1a985c bugfix #18187
Using "Key Alpha" didn't work when using MBlur render. The accumulation
code was assuming regular alpha then. Now it corrects for it.

Still it's a bit of a weak spot in Blender's render system. I will look 
in the future to make this a real post process; converting all RGBA 
buffers in the system, including for all passes, to "key alpha". 
Combined with that our compositor should become alpha type aware too. 
Everything in Blender assumes premul alpha, which still just will work 
best in general...
2009-04-22 11:54:43 +00:00
Campbell Barton 3e7cbd5388 Blender Python API
- Removed the gen_utils.c dependency from Mathutils (since gen_utils wont go into 2.5 but mathutils will), repalced with python functions.
- removed Blender.Mathutils.Point, since it was not documented, the C api never used it, none of our scripts used it (and I never saw a script that used it).
2009-04-21 09:44:29 +00:00
Brecht Van Lommel 874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
Ton Roosendaal 6b1ccddc0d bugfix #18196
Halos for objects (not particles) can get texture color, but they skipped
the alpha mapt-to channel when that was set. Actually bug from ehh 1995!
2009-04-07 07:46:58 +00:00
Janne Karhu fe562f0dd4 Fix for: [#18482] Mixed object and halo visualization for particles needs "Emitter" to be activated. 2009-04-06 00:43:59 +00:00
Janne Karhu e30cb79aaa Major cleanup of particle render & drawing code. No new features and hopefully no new bugs. 2009-04-03 14:50:54 +00:00
Guillermo S. Romero 441f26a170 Clean up for the imminent migration from SVN to GIT. 2009-03-31 22:34:34 +00:00
Campbell Barton bba2bdf41e Added attributes for Ipo Actuator settings (replacing all methods) 2009-03-26 01:42:01 +00:00
Ton Roosendaal f377be3783 2.5
Assorted smaller fixes:

- Fix: modal keymaps for editmode in view3d were not set again
  when you copy areas or go fullscreen.

- Improved "redo last op" (F6) to search back in history for
  a redoable operator. Operator also used wrong pupmenu type.

- On creating new FCurve editor, the channel rainbow colors are
  set correct.

- EditMesh: fixed code for Spin/Screw, correct props, init and
  error reporting. (Spin hotkey ALT+R temporary)

- recompiled all to check for uninitialized variable warnings.
  (compile flag should be -O for this). Fixed some proto's.
2009-02-19 16:22:07 +00:00
Ton Roosendaal e1b92bc166 2.5
Safe method to move render results to the displayed image.

It now allocates a single image for display, and on each
refresh callback from render, it copies the refreshed 
section over to this image, in 32 bits. While rendering
that image then only shows progress updates, as usual.
This also now works for scenes in composte and results
for composite.

This should solve reported crashes for MBlur or SSS.
2009-02-05 19:28:28 +00:00
Ton Roosendaal 1b27cd70e5 2.5
Render back! And not only back, even full threaded now. :)
Current state is unfinished, but too much fun to not to
commit for review and test!

WARNING: because render is in a threaded job, it will
use data as can be edited in the UI. That'll crash in many
cases of course... the idea is to limit UI usage to viewing
stuff, especially for the Image Window to inspect layers
or zoom in/out.

What works now;
- F12 render (no anim)
- ESC from render
- ESC pushes back temporary Image Window
- Render to ImageWindow or full-screen.
- Executing composites, and edit composites after render.

Note that the UI is 100% responsive in a render, you can 
switch screens, slide area dividers around, or even load
a new file during render. :) It's quite stable even.

I'll collect all crash reports especially to get a good 
picture of where the protection is required at least.

Also added: XKey "Delete Objects", to get things crash...
unfortunately it didn't for me.
2009-02-04 17:40:50 +00:00
Brecht Van Lommel 8036342ea8 2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
  organize things a bit and indicate what should be used when.

* uiMenu* functions can now be used to create menus for headers
  too, this is done with a uiDefMenuBut, which takes a pointer
  to a uiMenuCreateFunc, that will then call uiMenu* functions.

* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
  specific to making popup menus. Will convert the other
  conformation popup menu functions to use this too so we can
  remove some code.

* Extended uiMenu functions, now there is is also:
  BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.

* Converted image window headers to use uiMenu functions, simplifies
  menu code further here. Did not remove the uiDefMenu functions as
  they are used in sequencer/view3d in some places now (will fix).

* Also tried to simplify and fix bounds computation a bit better
  for popup menus. It tried to find out in advance what the size
  of the menu was but this is difficult with keymap strings in
  there, now uiPopupBoundsBlock can figure this out afterwards and
  ensure the popup is within the window bounds. Will convert some
  other functions to use this too.
2009-01-30 12:18:08 +00:00
Brecht Van Lommel 8762737400 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17853:HEAD 2009-01-26 08:34:40 +00:00
Ton Roosendaal 9cc59fb0c3 2.5
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
  of components to get it work:
  - customdata, free callback for it
  - timer step, notifier code
  - start callback, update callback
- Once started, each job runs an own timer, and will for
  every time step check necessary updates, or close the
  job when ready. 
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
  it will prevent multiple jobs to enter the stack. 
  Instead it will re-use a running job, signal it to stop
  and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
  under construction. 
  Fun: BLI_addtail(&wm->jobs, steve); :)

Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see 
  previews update even while dragging sliders!
- Currently it only starts when you change a node setting.

Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.

Also:
- bug in region initialize (do_versions) showed channel list in
  node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
  way! This is for later to work on anyway. 
- recoded Render API callbacks so it gets handlers passed on, 
  no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
  of stuff from code soon.
2009-01-22 14:59:49 +00:00
Nicholas Bishop b4bef32bd9 * Fixed a minor CMake error for WITH_YAFRAY option
* Removed two unused sculpt DNA fields
* Restored brush spacing option to sculpt
2009-01-21 18:44:36 +00:00
Nicholas Bishop ee180ff5ac Added new CMake build option, WITH_YAFRAY. Set to disabled by default. 2009-01-17 03:51:13 +00:00
Joshua Leung 44e5b7788b 2.5: Blender "Animato" - New Animation System
Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future.

Highlights of the new system:
* Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action. 
- F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves. 
- The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc.
* F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated.
* Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place)
* F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place)
* NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still) 

There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details:
http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html

So, what currently works:
* I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code.
* Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock.
* Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc.

Notes:
* Drivers haven't been hooked up yet
* Only objects and data directly linked to objects can be animated.
* Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change).
* Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor)
* I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review.
In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 03:12:50 +00:00
Campbell Barton c0ecbfce0e blender was crashing if no argument was given after '-t'
mesh.faces.deltete(...) with an empty list no longer returns an error.
2009-01-15 18:06:06 +00:00
Ton Roosendaal 637ffd1dfb 2.5
More globals discovered; lattice deform stored static
deform array and a matrix. Tsk!
2009-01-07 16:05:55 +00:00
Nicholas Bishop 25e5765f47 Got rid of old multires code, brought in multires modifier from
soc-2008-nicholasbishop branch.

Note: any old code with multires_test() or multires_level1_test() can 
just be deleted, not needed by the multires modifier.
2009-01-06 18:59:03 +00:00
Martin Poirier d19e758964 2.5
Fix compile error with AVI support
2009-01-04 19:10:57 +00:00
Ton Roosendaal 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
Ton Roosendaal a6721c60d9 2.5
From the anti-globalization department: 
G.obedit terminated!

Wherever possible, use CTX_data_edit_object(C) to get this
now. It's stored in scene now, and the screen context has
it defined.
2009-01-02 19:10:35 +00:00
Brecht Van Lommel e4b20f0180 2.5: various warning fixes. There was one actual bug in a few different
places, using sprintf with strings like ID names as the format string
(note that this name can contain a % character).
2008-12-26 14:19:25 +00:00