Commit Graph

4109 Commits

Author SHA1 Message Date
Alfredo de Greef
cf8d9fbb10 Added some backward compatibility with old yafray blendershader. Because of missing
parameters the material preset menu won't be as useful. Both glass presets will look the same
because there is no 'filter' parameter in the old yafray for instance.
So using the new Blender version with an old yafray version should work a bit better,
though the other way around, using the new yafray with an old blender version, will generally
not work as well.

I added a few extra things. In 'yafray' panel re-arranged some buttons, and added a new
button 'Clamp RGB'. This button will be enabled by default and helps to improve AA on
high contrast edges in the image. When using bokeh however, it is best to switch this off,
otherwise lens shaped highlights will be quite a bit less visible.

Changed the 'extinction' parameter name to the probably more correct term 'absorption',
though mathematically it works out the same. Also changed the behaviour of this color,
it no longer specifies a color that will be removed as I wrote in the previous commit,
but instead the actual color at one (blender) unit of distance. The 'Ds' (distance scale)
button below the color sliders controls the scaling of this unit distance.
What this means is that if you take the standard blender cube, which covers two units of
distance by default, setting the distance scale button to 2.0 will make sure that the color
you specified is exactly that color at that distance (provided the base color itself is white
of course, or 'filter' is 0, otherwise it will be filtered by the base color too).
Beyond this distance the color will get darker.

The glow option for point/soft/sphere lights has a new parameter 'GloOfs', or glow offset.
Setting this to a higher value then 0 will soften the central peak of the glow.

Another unreported bug fix: For xml export, when yafray failed to render the xml file
for some unknown reason, or because of other problems, the export code would still load
the previously rendered image, this causes problems however if the image resolution is
not the same as the current Blender buffer, and so could cause memory corruption or crashes.
This is now taken into account.

World image backgrounds now use the blender mapping settings as well, but only the
'AngMap', 'Sphere' and 'Tube' settings. But in yafray those last two, unlike Blender, cover
the whole view, not just the upper half, so is not really fully compatible with yafray.
So now you have to set one of these buttons too when loading a hdr lightprobe image.
btw, something I forgot to mention in previous commits is that the exposure control using
the texture brightness slider is no longer restricted to integer values. It is now a
floating point value, so you're not restricted to the 0 1 and 2 slider positions anymore,
anything in between will work too.

And finally, display updating is now more like Blender, using the mouse cursor as frame
counter for animation, etc.
2005-05-27 17:52:53 +00:00
Ton Roosendaal
f5435d924b When backbuf doesn't exist, it crashed during render... Fixed! 2005-05-27 13:28:26 +00:00
Ton Roosendaal
44a2c2267b On Render or Anim, no redraws should happin in the UI for sequence window.
This was enforced in a commit 5 months ago, for proper redraws while
working in sequencer itself (with scene strips)

Found by Ztonzy, explained by Jesterking. Thanks! :)
2005-05-27 12:53:28 +00:00
Ton Roosendaal
12671f30bd Bug fix #2629
Aye... OpenGL cannot draw concave (C shaped) polygons... that screws up the
Lasso tool, when it uses backbuffer selection.
Examined for little while the GLU Tesselation library, but apart from its
nightmarish structure, it's even stupid (no builtin clock/counterclock).

So, instead coded a DispList based function using Blender's edgefill.
Works like a charm! :)
2005-05-27 09:51:07 +00:00
Willian Padovani Germano
7625378e6d BPython:
- Fix for bug #2621 reported by Yann Cointepas (material.setMode didn't accept integer param, only strings, making it inconsistent with material.getMode):
http://projects.blender.org/tracker/index.php?func=detail&aid=2621&group_id=9&atid=125
    Applied patch #2626 by Ken Hughes to both Material.c and doc (Material.py):
http://projects.blender.org/tracker/index.php?func=detail&aid=2626&group_id=9&atid=127

- Small C doc strings update I forgot to add before, for Render slinks (reminder about Render slinks docs also by Ken).

Thanks both -- btw, Ken Hughes has contributed considerably improving bpy documentation and fixing bugs for this release.
2005-05-27 05:39:41 +00:00
Ton Roosendaal
53082cf0f1 Bug fix #2575
VertexPaint, FaceSelect draws with 'culled faces' but should therefor
check for negative scaling as well, set the glFrontFace() OK.
2005-05-26 21:00:50 +00:00
Ton Roosendaal
8f5baf019b Bug fix #2627
For rendering wire a wrong offset was used to find vertices... was caused
by commit Apr 13, part of reconstructing Mesh and subsurf.
2005-05-26 20:11:41 +00:00
Ton Roosendaal
07d048cae6 Disabled zblur render option when it was saved in testing builds. :) 2005-05-26 19:49:05 +00:00
Ton Roosendaal
1536167d13 Bug fix #2625
Darn #$%#$# code cleanup in NaN days screwed up recursive feature of
linking dynamically data among Blender files. It now only supported 1
'deep'.

Now you can link data from file1 via file2 into a file3, etc. Nasty code,
but supposed to work :)
2005-05-26 13:17:12 +00:00
Ton Roosendaal
b30b8bdd08 Bug #2624
Typo in bspline interpolation code... a '1' should be '2', causing the
fourth key of interpolation always be equal to third.
Only shows error with larger key steps, like 5 frames or more. Nice it
was found before release!
2005-05-25 21:54:13 +00:00
Stephen Swaney
3eb2be3831 updates and corrections for BPy Text3d module from Ken Hughes.
Thanks, Ken!
2005-05-25 16:38:51 +00:00
Ton Roosendaal
f9f3e82f93 Tinsy little but relevant bug; colors in Action channels used signed
bytes, glColor4b() instead of unsigned glColor4ub(). Gave ugly cycling
of colors in wrong ways.... reported by Ztonzy on irc. Thanks!
2005-05-25 16:37:24 +00:00
Ton Roosendaal
6969c118de Removed unused rect_float variable from imbuf structure. Was added for the
openEXR testing only. It broke sequence plugins...

Note: adding variables in end of Imbuf struct at least doesn't crash old
sequence plugins immediately. :)
2005-05-25 16:19:00 +00:00
Willian Padovani Germano
2a1fe1b0cb BPython bug fixes:
- Patch #2491: Mathutils.AngleBetweenVecs BUGFIX
http://projects.blender.org/tracker/?func=detail&aid=2491&group_id=9&atid=127

- #2607: Python String button can segfault if the allowable length is greater than 400
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2607&group_id=9

- #2490: Vector == None gives warning
http://projects.blender.org/tracker/?func=detail&aid=2490&group_id=9&atid=125

- #2476: Image.Draw()
http://projects.blender.org/tracker/?func=detail&aid=2476&group_id=9&atid=125

All reported by Campbell, who also wrote the #2491 patch.  Ken Hughes provided patches for #2490 and #2476.  Thanks guys.
2005-05-25 04:52:52 +00:00
Jens Ole Wund
524e411dbf rule OB_SB_GOAL flag over SOFTGOALSNAP optimization in all cases 2005-05-24 22:17:23 +00:00
Ton Roosendaal
9e0e4adb68 Audio playback in TimeLine should not use 'scrubbing' option in the
update_for_newframe() call.
2005-05-24 19:33:04 +00:00
Ton Roosendaal
e975b78a4f Found float-related numerical instability with vertices lying EXACT on
the edge of an image. It should not be clipped, but comparisions with
floats then can go wrong... here the FLT_EPSILON is to the rescue.

/* smallest such that 1.0+FLT_EPSILON != 1.0 */
#define FLT_EPSILON 1.19209290e-07F

(Bug fix #2610)
2005-05-24 17:36:20 +00:00
Stephen Swaney
bb84abaaa8 updates to doc strings in code and doc from Ken Hughes.
add alias .recalc() for IpoCurve.Recalc() to match api standard.
2005-05-24 15:14:32 +00:00
Ton Roosendaal
8242c5db2b Bugfix #2602
Tooltips of buttons with menus (like for set constraint type) could popup
still... and in wrong location even!
Now it's a little bit tighter coded.
2005-05-24 13:02:22 +00:00
Ton Roosendaal
1dad1677d3 Bug fix #2606
While in Shaded draw mode, and edting a Font Object, the linked duplicates
of this object didn't get reshaded correctly.
2005-05-24 12:33:35 +00:00
Ton Roosendaal
b4dc14e088 Added init of 'postsat' to 1.0 in Scene, for the postprocess menu.
This only gave error in python. Added new scene in Blender itself copies
settings over of current scene. :)
2005-05-24 11:50:12 +00:00
Ton Roosendaal
e5304a967c Disabled assert foolery in Decimator. :)
Code provided by Matthew Plough. Verified to run OK in OSX, Windows.

Solves bug #2598, which crashed blender on using non-manifold meshes with
decimator.
2005-05-24 10:44:14 +00:00
Ton Roosendaal
505ab0bf78 Bug fix #2617
Using ipokeys with rotate crashed... caused by bugfix in ESC on ipokeys I
did before. Got confused by non-initialized (malloc) transdata...
2005-05-24 10:03:53 +00:00
Jens Ole Wund
abae9376c8 added font.c and font.h to MSCV6 project 2005-05-23 21:40:19 +00:00
Jean-Luc Peurière
94ba432f59 fix for #2592
Ken Hughes found the solution.
2005-05-23 18:20:20 +00:00
Johnny Matthews
6c6e280fef Moved a line containing a declaration and initialization to the top of the block, so that blender would compile. Sorry if this steps on any toes.
Johnny
2005-05-23 15:43:16 +00:00
Alexander Ewering
9be39be56b Just putting a reminder into IMB_imbuf_types.h in case my mails to the list
got ignored, and for future reference ;)

If you change struct ImBuf, copy it over to the plugin API!
2005-05-23 00:14:23 +00:00
Alfredo de Greef
ec45bfc5b1 Second and final commit for this version of the yafray export code (probably, you never know
of course...)

Not quite complete, but due to lack of time as good as it will get for now.

From the previous commit, forgot to report that basic fog is supported as well. Though because I had not much time to complete the code, it is sort of unfinished, and you will have
to tweak parameters specifically for yafray again. It uses only the world horizon color, and
only uses the Blender mist distance setting.

Textures now support checker clip mode.

Fixed possibly all 'duplilist non-empty' errors, though it could hide the real cause of the
error.

AA is no longer enabled automatically for certain GI quality settings, I thought it best to
leave it to the user to decide.

SkyDome GI mode now supports cache as well. There is a new option in the GI quality menu 'Use
Blender AO settings', which will as it says use the most important AO settings for the
skydome parameters. The only AO parameters used are 'Samples', 'Dist' and the random sampling
switch, which unlike in Blender you might want to use more often, since the QMC sampling used
in yafray can result in visible patterns or a dithering type look. 'Random' is not completely
random in yafray however, it is actually jittered (stratified) sampling.
Using an occlusion cache, doesn't necessarily mean that you will always get much shorter
render times. As with 'full' GI and cache, one problem is bumpmaps, when using bump (or
normal) maps, the sampling will be much more dense, using lots more rendertime.
As a temporary fix there is a button 'NoBump', but this also has the side effect that in
areas of total indirect light (or when used with SkyDome cache) no bumpmapping will be
visible. It is therefor best used with some direct light as well.
For SkyDome with cache, and strong bumpmapping it might actually not make much difference,
since for low distance values you can usually get away with low sample values as well.

The entire material panel is now replaced by another panel to show only the parameters
important to yafray and add some new ones as well.

Since lots of users (especially yafray beginners) have had problems getting certain material
aspects right, there is now a material preset menu available to hopefully solve some of the
most common "How do I do this? It doesn't work!" questions seen in various forums.
Choosing an option from this menu will set the required parameters to default
values for yafray, and you can work your way from there to tweak it something you want.

Most buttons are copies of the same Blender parameters, with some variations. Just like
Blender 'Ray Mirror' enables reflection, 'Ray Transp' enables refraction. You can use
'ZTransp' for materials that have texture maps with alpha channels.
Again, same as Blender 'rayMir' sets the amount of reflection. Next button 'frsOfs' however
controls fresnel offset, meaning that when this is set to 1, you will get no fresnel effect
and when set to 5, reflection is totally determined by fresnel, which is important for
realistic glass/metals/etc.
IOR is self-explanatory (...), same as Blender.
When you have 'Ray Transp' enabled, the blender 'filter' button will appear next to the IOR
button. This has the same effect as in Blender.

Below that there are some new parameters, 'Ext.Color' sets the extinction color for
transparent materials. Usually, in real transparent materials, light loses some of it's
energy the further it has to travel through the object. This effect can be simulated with
this parameter. Thing to look out for is that it specifies the color which will be
REMOVED after traveling through the object. What this means is that say you have a clear
white glass sphere, and set the extinction color to a strong blue, the result will be a
very yellow object when rendered.

Next to the color sliders, there is another set of three parameters, with which you can
enable color dispersion for transparent objects. 'Pwr' sets the amount of dispersion,
the higher, the more dispersion (the more colorful the result).
(For real world materials, this number can be found or derived from data in various glass catalogues)
The 'Samples' button below that sets the number of samples used, minimum values are around
7-10, and for very strong dispersion you might need a lot more.
As usual, this also means an increase in render time of course, but to simulate
realistic materials, you shouldn't really need more than 25 samples.
In addition to that, when using low sample numbers, but to still get a good spread of colors,
you can enable the jitter button, but this will also add noise.

Point/soft(point with shadowbuffer) or sphere lights (light with radius), have a new option
to add a simple glow effect, so that lights can be made visible.
NOTE: just like spotlight halo's, glow is not visible against the background, there must be
another object behind it. Simplest solution is to use a large black shadeless plane behind
your scene.
The glow intensity can be set with the 'GlowInt' parameter (use very low values around 0.01
even lower), and you can choose from two different types with the 'GlowType' button (which
don't look much different, but type 1 is probably better, type 0 faster).

And that's it, with apologies for the still missing features and
full support in general, but this will have to do for now.
2005-05-22 22:46:17 +00:00
Jiri Hnidek
563af2aac1 - stiffness circle of MetaElem isn't paint in Object mode now 2005-05-22 19:16:04 +00:00
Willian Padovani Germano
b7be4525bd Scripts: updated Bart's (thanks) vrml97 and x3d exporters, adding also doc link to the script's web page and commenting out two uneeded prints in each script. 2005-05-22 18:50:46 +00:00
Stephen Swaney
8510196eca Rename Image.getPixel() to .getPixelF() as per discussion
to match OpenGl conventions and prepare for integer versions.
2005-05-22 18:43:29 +00:00
Stephen Swaney
ece00ff04a Roll back changes from Big Mathutils Commit on 2005/05/20. 2005-05-22 17:40:00 +00:00
Martin Poirier
910b0f2cda Local constraint uses center mode again. This fixes a bug in the tracker, wasn't really a "bug", but anyway... 2005-05-22 12:01:12 +00:00
Willian Padovani Germano
2f3dbcc5b7 BPython bug fixes:
- bug #2033 reported by Ken Hughes: Vertices of mesh parented to lattice is scaled incorrectly:
https://projects.blender.org/tracker/?func=detail&aid=2033&group_id=9&atid=125

- bug #2211 reported by German Alonso Tamayo (servivo): Add a vertex to a mesh with groups using a script and then edit that mesh hangs blender:
https://projects.blender.org/tracker/index.php?func=detail&aid=2211&group_id=9&atid=125

(#2211's hang was already fixed with previous commit, but this way should work better)

- doc updates (Ken reported missing info about Render slinks, thanks).
2005-05-22 07:22:34 +00:00
Stefan Gartner
ae2acbf49b late night commit:
* build blenderplayer on linux/ppc
* fix 'make clean' for darwin
2005-05-22 01:21:01 +00:00
Jean-Luc Peurière
e441c57d22 fix for bug #2588
objects with circular dependancies where not handled correctly
when sorting bases.

the fix is actually a workaround only and may evolve later

also add changes to xcode project for recent commits
2005-05-21 21:52:58 +00:00
Alfredo de Greef
33832f52ea Part one of the final yafray commit.
Totally updated blender shader in yafray, hopefully better matches blender
results. Though ramps are now partially supported, they cannot work in all
cases properly in yafray, and in fact are a bit useless probably as far as
yafray is concerned. In fact the 'Result' ramp input mode is not supported
at all, because it works on the total lighting result, and in a yafray
shader this is not possible since it works per light.
Also, since Blender and Yafray have totally different lighting models,
the 'Energy' ramp input mode also won't generally give the same results
as in Blender, since it works with light energy and in yafray this is
different from Blender. Even worse, the only ramp shader that will work
properly when used with GI is the 'Normal' ramp input mode.
As contradictory as this might seem, at various stages of the GI process,
lighting is not known, so properly getting light (ramp 'energy' mode)
or shader information (ramp 'shader' mode, which depends on lighting)
is not possible. Which all means that when the ramp is in 'energy' or
'shader' mode and using it with GI enabled, yafray can only 'see' the
underlying material color, not the ramps, which results in a mix of the
ramp colors (from direct light) with the material color (from indirect light).
There is currently nothing that can be done about that.

The supported texture mapping modes now includes raymir as well, transparency
as far as texturing is concerned now works similar to Blender, with the
exception that you still have to set alpha to a low value to get any
transparency effect at all in yafray. So the Blender 'filter' parameter
now also will affect yafray.
All texture blending modes are now supported (same for ramps).
'Translu' and 'Amb' texture modulation are not supported.
Texture interpolation can be switched off ('InterPol' switch in blender
image texture button section).

All Blender brdf models (aka 'shaders' for the Blender users) are now supported,
and again, you won't necessarily get the same results as in Blender.
The reason for that is partially of course the lighting differences, but also,
not all Blender 'shader' implementations are  actually correct, and copying
those errors just for the sake of matching Blender results doesn't really
seem like a good idea...
Though this really is only the case for WardIso, less so for Minnaert and
Blinn, which in yafray are more or less (but not totally) a copy of
the Blender code.
In any case, in practice those differences might not be
too noticable at all (I hope).

Continue to the next part...
2005-05-21 20:49:24 +00:00
Stephen Swaney
21d07f7ea3 Matrix_Determinant() was returning its input arg rather than
the determinant.  bugfix via LetterRip.
2005-05-21 20:05:28 +00:00
Stephen Swaney
73c162dfef Ipo doc update. Contributed by Ken Hughes. 2005-05-21 04:20:57 +00:00
Joseph Gilbert
0945b86a63 O_BINARY define for unix compilers 2005-05-20 20:52:47 +00:00
Ton Roosendaal
244a1a71b3 Bug fix #2591
Dependency issue... could solve it by calling an extra where_is_object
when a displaylist is made for vertex-parenting on deformed objects.
2005-05-20 20:44:33 +00:00
Joseph Gilbert
7586eb28a1 -rewrite and bugfixes
----------------------------------
Here's my changelog:
-fixed Rand() so that it doesn't seed everytime and should generate better random numbers
- changed a few error return types to something more appropriate
- clean up of uninitialized variables & removal of unneccessary objects
- NMesh returns wrapped vectors now
- World returns wrapped matrices now
- Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
- Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
- Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
- Removed memory allocation (unneeded) from all methods
- Vector's resize methods are only applicable to new vectors not wrapped data.
- Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
- Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
- Euler.rotate does internal rotation now
- Slice assignment now works better for all types
- Vector * Vector and Quat * Quat are defined and return the DOT product
- Mat * Vec and Vec * Mat are defined now
- Moved #includes to .c file from headers. Also fixed prototypes in mathutils
- Added new helper functions for incref'ing to genutils
- Major cleanup of header files includes - include Mathutils.h for access to math types
- matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
- Matrix() with no parameters now returns an identity matrix by default not a zero matrix
- printf() now prints with 6 digits instead of 4
- printf() now prints output with object descriptor
- Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
- Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
- slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
- slice assignment will no longer modify the data if the assignment operation fails
- fixed error in matrix * scalar multiplication
- euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
- Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
- Quats can be created with angle/axis, axis/angle
- 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
- vec *quat / quat * vec is now defined
- vec.magnitude alias for vec.length
- all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
- these methods have been deprecated (still functioning but suggested to use the corrected functionality):
  * CopyVec() - replaced by Vector() functionality
  * CopyMat() - replaced by Matrix() functionality
  * CopyQuat() - replace by Quaternion() functionality
  * CopyEuler() - replaced by Euler() functionality
  * RotateEuler() - replaced by Euler.rotate() funtionality
  * MatMultVec() - replaced by matrix * vector
  * VecMultMat() - replaced by vector * matrix
-  New struct containers references to python object data or internally allocated blender data for wrapping
* Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
*    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
2005-05-20 19:28:04 +00:00
Ton Roosendaal
d99f64b823 Manipulators now draw on location of optimal subsurf vertices. Looks
nicer, but be aware that these locations are 'virtual', derived from
the actual Mesh Cage vertices you don't see.

Normal transform (and actual transform with Manipulators) remains on
the original vertices, which also shows with dashed line towards pivot
on scale/rotate.
2005-05-20 18:16:18 +00:00
Ton Roosendaal
bc62536fac Different drawing code for darkened part in TimeLine window, to indicate
the start/end frame. It uses a GL_BLEND which doesnt work nice for darker
backdrops. Now it uses ThemeColorShade() which does it OK.
2005-05-20 16:01:36 +00:00
Nathan Letwory
b7cc5b790a * Check path for NULL. Fixes potential crash on non-win32 systems at startup, but also future passes of null. 2005-05-20 12:37:48 +00:00
Nathan Letwory
1071d4a16e This commit fixes two related issues:
1:
* when a blendfile gets loaded, paths are corrected with OS specific slashes (see blender.c)
* made available BLI_char_switch(char *string, char from, char to)
* made available BLI_clean(char *string);. This function should be called whenever you're doing path stuff, so paths are correctly saved, and thus avoiding other path functions stopping to work

2:
* relative paths work now in sequencer too (due to slash mess that didn't work all too well).
2005-05-20 12:18:11 +00:00
Stephen Swaney
f8ae055f4b corrections and missing ipo channels for Camera, World, Material
and Lamp.  Contributions from Ken Hughes.
2005-05-20 12:16:54 +00:00
Ton Roosendaal
83792faa3f Two softbody thingies;
- fixed error in option "Enable Goal" which didn't work with Vertex groups
  assigned

- renamed some buttons & fixed tooltips. A doc online will be there soon
2005-05-20 12:15:50 +00:00
Ton Roosendaal
32fd7ad4c9 Fix for TimeLine "Play" with sound-sync set.
Added check for audiostream_pos() - which should return current frame
corrected for audio playback - to be at least 1 frame larger than current
frame. It caused in some situations even a backwards playback!
2005-05-20 10:27:11 +00:00
Ton Roosendaal
5862e1a883 Bugfix reported by Basse; adding a new strip in Sequencer didn't initialize
the sequence "Mult" value properly when the "Properties" Panel was open.
That resulted in images displaying black...
2005-05-20 09:35:33 +00:00