Commit Graph

21787 Commits

Author SHA1 Message Date
00b8c9e7ea rename BKE_assert() --> BLI_assert(). 2011-01-09 15:12:08 +00:00
c9f353956c use PySequence_Size() rather then PySequence_Length(), this is only kept in python for backwards compatibility. 2011-01-09 14:53:18 +00:00
0660078b8b mathutils matrix initialization now matches other mathutils types.
(should have made this change along with the others).
Matrix([1, 2],  [3, 4]) --> Matrix(([1, 2], [3, 4]))
This is so adding initialization args works right.

Also simplify initialization code (re-use slice assignment).
2011-01-09 14:30:16 +00:00
99e203dbd4 Bugfix #25547
Improved report print for 'remove doubles' to make it correct english.
Unsure if this kind of code can survive though, static strings do much
better for future translation efforts.

Instead of providing nice grammar sentences, we could make it more
declarative, like:

"Removed vertex amount: %d".
2011-01-09 12:38:54 +00:00
a825df946a use PySequence_Fast for matrix slice assignment to speed up assignment. 2011-01-09 12:38:22 +00:00
2f24124e97 py matrix api
- bugfix for printing matrices (row/col mixup)
- replace cumbersome loop sequence parsing with calls to mathutils_array_parse
2011-01-09 12:09:54 +00:00
abcdd0377c Bugfix #25551
Transform crash on autokey during animplay.
Transform event handling requires Context, for inserting keys. 

Marked it with XXX warning; we have to be more careful with which
API calls require context; like inserting keys shouldn't need it?

Originally Context was meant for operators; to define user level
or scripted context, not for underlying APIs to work.
2011-01-09 12:08:29 +00:00
02aab4977f quiet zombie python class warning. bug remains but its not useful to print out so many errors when this wont be fixed for a while. 2011-01-09 11:54:12 +00:00
d31ebbe666 cleanup for mathutils multiplication functions, a little faster in some cases, raise more informative exceptions. 2011-01-09 09:16:04 +00:00
ca89269c22 Remove py mathutils Euler.unique() method
- this just toggled between different rotations, I can't find any references to this as a common operation to have with eulers.
- wasn't working at all nobody noticed, not used by any blender scripts/addons either.
2011-01-09 07:46:26 +00:00
e32bbef017 Fix for [#25544] Blender crashes when changing the particles emission amount
* I've getting bad feelings about the point cache index_array for a while (cause for this bug too), so from now on memory cache uses a simple binary search directly on the index data to handle queries to specific data points.
* This is a bit slower than just checking from a dedicated array, but it's much less error prone, uses less memory and makes the code more readable too, so it's not a tough choice.
2011-01-09 07:41:51 +00:00
76a762aa51 Fix typo in particle rna 2011-01-09 07:07:15 +00:00
70a828d5a5 remove unused vars, comment some which look like they could be useful still. have makesrna.c omit unused _data definitions for rna funcs with no args. 2011-01-09 01:17:56 +00:00
17e733a4fc Bugfix #25525
Duplicating viewer node crashed in cases; bad ID was given to a function.
Fix provided by Alexander Kuznetsov. Thanks!
2011-01-08 19:12:42 +00:00
16e7a26185 Bugfix, IRC report
Texture space transform, SHIFT+R crashed
2011-01-08 18:46:21 +00:00
ac56fef228 Todo items:
- Outliner: new scroll operator, PageUp PageDown scroll entire page now.
- 2D views (like buttons) PageUp PageDown now also scroll entire page.
  (they used same step as scrollwheel before)
2011-01-08 18:37:11 +00:00
5e8b877268 Crash fix, IRC report.
Python console crashed on opening.

Too quick code cleaning for "unused variables" caused a complete line
of code to disappear that was needed anyway :)
2011-01-08 17:47:34 +00:00
6594b591de Proportional editing:
- Proportional circle size is printed in header
  Allows you to find out if you make it smaller when it's large
- Proportional size is clipped with view3d clip-end now
- Added the size to rna, so you can inspect values via UI and py.
2011-01-08 16:54:38 +00:00
17dd29cb85 Bugfix, own collection
New displist code for curves/text copied display lists without 
checking for freeing existing ones. Caused some memleaking.
2011-01-08 15:35:15 +00:00
3b74074aec remove unused code & variables. 2011-01-08 12:43:44 +00:00
988e5371fa fix for crash when converting sequencer profiles with non-float buffers. 2011-01-08 12:22:16 +00:00
39e7848ca1 fix for using freed memory with animation/group/ungroup code. 2011-01-08 11:08:51 +00:00
d3d5fe42bf fixed a case with occlusion where uninitialized variable could be used.
also removed unused vars.

can_pbvh_draw() had a NULL check which is never needed (callers check for this), a NULL ob would have crashed the function anyway.
2011-01-08 10:23:36 +00:00
c35db522da variable 'pool' could be accessed as NULL, globalPool was allocated but not assigned before use.
also remove unused vars.
2011-01-08 10:13:59 +00:00
053776bf57 Sculpt/Paint:
More cleanups: moved a function declaration to the correct module,
removed old/incorrect comments, marked more things with TODO where
appropriate, refactored copy-pasted function, de-duplicated code.
2011-01-08 01:45:02 +00:00
2579347a9a Paint:
More cleanups to the cursor drawing code; factored out another
sculpt-related function, replaced float calculations with bitwise
flags, removed unnecessary GL changes, de-duplicated some lines,
removed unused parameters, and added more comments.
2011-01-08 01:16:35 +00:00
14d6d1cdf6 More Windows+mingw compiling fixes:
FILE_FILE_MAXDIR/FILE were undefined. Restoring BKE_utildefines.h
include to make this work again in the meantime.
2011-01-07 23:54:58 +00:00
e415798e13 Removed some overly agressive (and IMO pointless) "UNUSED(arg)"
wrappers which was breaking compiling on Windows (mingw)
2011-01-07 23:47:12 +00:00
46bf79fd02 Paint cleanup:
Pulled out the paint brush overlay drawing code into its own
function, brush drawing function was before ~250 lines.
2011-01-07 23:36:48 +00:00
2d9c11f3a3 Paint/Sculpt:
More minor cleanups: fixed names and factored out a function that was
copy-pasted into paint stroke.
2011-01-07 22:46:52 +00:00
ab41b9bbaf Paint/Sculpt:
Some minor cleanups: removed `#if 0' code and moved a function into paint_util to avoid `extern' declaration.
2011-01-07 22:03:16 +00:00
473838aec9 Fix for bug [#21534] Multires modifier strange deformations
This adds the "Apply Base" feature from my gsoc2010 branch.

Apply Base partially applies the modifier, in that the mesh is
reshaped to more closely match the deformed mesh. The upper-level
displacements are recalculated so that the highest multires level
appears unchanged.

Multires does not currently deal well with too large displacements.
An easy-to-reproduce example: create any mesh type, add multires,
subdivide a few times, then use the sculpt grab brush to drag the
entire mesh over a few units. At the highest level, and at level 0,
the mesh looks fine, but all of the intervening levels will have ugly
spikes on them.

This patch doesn't help with situations where you can't modify the
base mesh, but otherwise works around the problem fairly well (albeit
with a heuristic, not an exact solution.)
2011-01-07 21:12:47 +00:00
ab11863b2f SVN maintenance. 2011-01-07 20:02:56 +00:00
89c9aaaa25 remove references to BKE_utildefines where its not needed.
- move GS() define into DNA_ID.h
- add BLI_utildefines as an automatic include with makesrna generated files.
2011-01-07 19:18:31 +00:00
8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
a601fd8893 Bug fix: unbaked particle cache was cleared from current frame onwards on file load. 2011-01-07 17:27:27 +00:00
b9fe5399e8 Revert bump mapping patch for now, backwards compatibility is not good enough,
we may need to preserve the previous method.
2011-01-07 16:55:56 +00:00
f01cac08e7 Fix #25078: texture mapping options (e.g. size) not working correctly with bump.
This problem was in both new bump and new new bump. The derivatives used for
bump mapping did not include the mapping, which gave mismatched offset for the
taps, now just do the mapping beforehand.
2011-01-07 15:41:24 +00:00
c8e0ca44a3 Improved bump mapping patch by M.G. Kishalmi (lmg) and M.S. Mikkelsen (sparky).
Many thanks to them!

For comparison, see here:
http://kishalmi.servus.at/3D/bumpcode/

Based on algorithm in: Mikkelsen M. S.: Simulation of Wrinkled Surfaces Revisited.
http://jbit.net/~sparky/sfgrad_bump/mm_sfgrad_bump.pdf

This fixes bugs:
#24591: Artefacts/strange normal mapping when anti-aliasing is on
#24735: Error at the Normal function.
#24962: Normals are not calculated correctly if anti-aliasing is off
#25103: Weird artefacts in Normal

This will break render compatibility a bit, but fixing this bugs would have also
done that, so in this case it should be acceptable.

Patch committed with these modifications:
* Bump method Old/3-Tap/5-Tap option in UI, 3-Tap is default
* Only compute normal perturbation vectors when needed
* Fix some middle of block variable definitions for MSVC
2011-01-07 14:42:01 +00:00
03e0f28ea0 bugfix [#25528] lack of update and crash using hook modifier. 2011-01-07 11:48:35 +00:00
3c6077e8ec Bug fix: particle point cache was reset on start frame if particles had grid distribution even if there were no changes. 2011-01-07 11:38:28 +00:00
29efbf8a04 New hair child options:
* Renamed children to "simple" and "interpolated" as this is
  easier to explain and more descriptive than "from particles"
  and "from faces".
* Also shuffled the child ui around a bit to make it clearer.
* Child seed parameter allows to change the seed for children
  independent of the main seed value.
* Long hair mode for interpolated children:
  - Making even haircuts was impossible before as the child
    strand lengths were even, but their root coordinates were
    not similar in relation to the parent strands.
  - The "long hair" option uses the tips of the parent strands
    to calculate the child strand tips.
* Hair parting options:
  - Hair parting can now be calculated dynamically on the fly
    when in 2.49 there was a cumbersome way of using emitter mesh
    seams to define parting lines.
  - For long hair parting can be created by a tip distance/root
    distance threshold. For example setting the minimum threshold
    to 2.0 creates partings between children belonging to parents
    with tip distance of three times the root distance
    ((1+2)*root distance).
  - For short hair the parting thresholds are used as angles
    between the root directions.
* New kink parameters:
  - Kink flatness calculates kink into a shape that would have
    been achieved with an actual curling iron.
  - Kink amplitude clump determines how much the main clump value
    effects the kink amplitude.
  - The beginning of kink is now smoothed to make the hair look
    more natural close to the roots.
* Some bugs fixed along the way too:
  - Child parent's were not determined correctly in some cases.
  - Children didn't always look correct in particle mode.
  - Changing child parameters caused actual particles to be
    recalculated.
* Also cleaned up some deprecated code.

All in all there should be no real changes to how old files look
(except perhaps a bit better!), but the new options should make
hair/fur creation a bit more enjoyable. I'll try to make a video
demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
7ad97b04b7 cmake: share the DNA_*.h list definition between makesrna and makesdna 2011-01-07 11:08:47 +00:00
841c50b5e2 Fix for [#25526] Inmediate crash when changing amount of particles in a particle system
* Point cache index array doesn't necessarily have all particles if the particles were re-allocated recently.
2011-01-07 10:38:17 +00:00
96128ee69f Fix for [#25506] Hair showing up in places not assigned by a weightmap
* Two separate bugs, with very similar symptoms.
* The distribution binary search didn't work correctly in cases where there were a lot of faces with 0 weights.
* Maximum distribution sum should have been exactly 1, but due to the wonderful nature of floats this wasn't the case at all.
2011-01-07 10:13:30 +00:00
57a3cff3b8 patch [#25440] Object.vertex_group fixin'
from Dan Eicher (dna) 

 From the tracker (with minor edits)
========================

cube = bpy.data.objects['Cube']
foo = cube.vertex_groups.new('foo')
foo.add([1,3,5,7], 1.0, 'ADD')

for i in range(len(cube.data.vertices)):
    try:
        weight = foo.weight(i)
        print('vert: %i weight: %f' % (i, weight))
    except:
        pass

foo.remove([1,3])

cube.vertex_groups.remove(foo)
2011-01-07 09:50:23 +00:00
41c00063dd another error in commit r34143, was using the define's 'BLEN' & 'DER_' however the latter is incorrect since DER- is used for 64bit blend files.
removed the define.
2011-01-07 09:47:05 +00:00
7fe16a24a4 fix for error in own commit r34143 2011-01-07 08:59:00 +00:00
f3a00259e2 bugfix [#25457] Lack of update on undoing a lattice rig 2011-01-07 07:36:51 +00:00
a132674634 patch [#25490] Fix for [#22096] Blender tries to open non-blend file
from Alexander Kuznetsov (alexk) with edits.

From the report:
Blender assumed that all files are .blend as retval = 0;

Now retval is initialized as file cannot be open (-1) for gzopen fail and directory case
retval = -2; is defined for not supported formats
This must be assigned before #ifdef WITH_PYTHON because this part can be missing
Finally retval = 0; if it is a .blend file

---
also made other edits.

- exotic.c's blend header checking was sloppy, didn't check data was actually read, only checked first 4 bytes and had a check for "blend.gz" extension which is unnecessary.
- use defines to help readability for BKE_read_exotic & BKE_read_file return values.
- no need to check for a NULL pointer before calling BKE_reportf(). (will just print to the console)
- print better reports when the file fails to load.
2011-01-07 06:50:29 +00:00