Commit Graph

227 Commits

Author SHA1 Message Date
Campbell Barton
c84e4da7dd code cleanup: move 2d bevel list into its own function. (as with 3d bevel) 2013-02-21 17:16:51 +00:00
Campbell Barton
441c7fb79a fix for crashes running some operators in background mode and some divide by zero errors. 2013-02-06 02:48:03 +00:00
Sergey Sharybin
fdfa5910b5 Fix #34040: Moving Normal Node with enabled Cycles Material Preview crashes
Issue was caused by couple of circumstances:

- Normal Map node requires tesselated faces to compute tangent space
- All temporary meshes needed for Cycles export were adding to G.main
- Undo pushes would temporary set meshes tessfaces to NULL
- Moving node will cause undo push and tree re-evaluate fr preview

All this leads to threading conflict between preview render and undo
system.

Solved it in  way that all temporary meshes are adding to that exact
Main which was passed to Cycles via BlendData. This required couple
of mechanic changes like adding extra parameter to *_add() functions
and adding some *_ex() functions to make it possible RNA adds objects
to Main passed to new() RNA function.

This was tricky to pass Main to RNA function and IMO that's not so
nice to pass main to function, so ended up with such decision:

- Object.to_mesh() will add temp mesh to G.main
- Added Main.meshes.new_from_object() which does the same as to_mesh,
  but adds temporary mesh to specified Main.

So now all temporary meshes needed for preview render would be added
to preview_main which does not conflict with undo pushes.

Viewport render shall not be an issue because object sync happens from
main thread in this case.

It could be some issues with final render, but that's not so much
likely to happen, so shall be fine.

Thanks to Brecht for review!
2013-02-05 12:46:15 +00:00
Ton Roosendaal
73c7c10c6e Bug fix #33748
Old fixes, since 2009 and before! Related to Curve object editmode:

- normals are not being drawn for hidden curves anymore
- even worse: Blender also didn't hide the extrusions or bevels for hidden curves
- outside edit mode, it shows all (as for all other modes)
- (de)select-all now works when 1st (or any) handle was hidden.
2013-01-15 15:42:12 +00:00
Campbell Barton
c93e127e7a code cleanup: style and replace (float)sin, (float)cos with sinf, cosf 2013-01-12 14:28:23 +00:00
Campbell Barton
682df047a0 style cleanup 2013-01-08 02:06:16 +00:00
Campbell Barton
a6bee579e9 move pbvh into BKE, it used many BKE bad level includes.
now blenlib/BLI doesn't depend on any blenkern/BKE functions,
there are still some bad level includes but these are only to access G.background and the blender version define.
2012-12-15 15:59:25 +00:00
Campbell Barton
21a9fa9089 move bpath module from BLI to BKE, it was making many bad level calls into BKE. 2012-12-15 15:31:50 +00:00
Campbell Barton
634b22fc46 code cleanup: spelling labda -> lambda 2012-12-11 14:18:37 +00:00
Campbell Barton
973cb29d84 style cleanup: if's on the same line. 2012-11-18 02:41:55 +00:00
Campbell Barton
2bb174cfa4 style cleanup: indentation 2012-11-09 09:33:28 +00:00
Ton Roosendaal
09cf0fa6f3 Bugreport - Christian Krupa in irc:
Curves behaved totally bad suddenly. Caused by Campbell code cleanup, replacing
this:

	/* this is for float inaccuracy */
	if (t < knots[0])
		t = knots[0];
	else if (t > knots[opp2]) 
		t = knots[opp2];


with:

	t = (t < knots[0]) ? knots[0] : knots[opp2];

Tss!
2012-11-01 13:00:24 +00:00
Campbell Barton
00b8c2afa1 style cleanup 2012-10-31 10:09:06 +00:00
Campbell Barton
aeba4950c3 style cleanup 2012-10-27 10:42:28 +00:00
Campbell Barton
0e494b74c4 style cleanup 2012-10-26 04:14:10 +00:00
Campbell Barton
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
Campbell Barton
67e2768570 quiet some -Wshadow warnings 2012-10-12 14:35:10 +00:00
Campbell Barton
589ada7f0c code cleanup: correct spelling 2012-09-28 06:45:20 +00:00
Campbell Barton
b3d2ea28ce speedup for vertex parent lookups, were looping over array elements when it wasn't needed for lattice and curves, and in some cases meshes.
do dirrect array lookups instead where possible.
2012-09-16 08:25:31 +00:00
Campbell Barton
a3c4b0f47d make SWAP macros typesafe using CHECK_TYPE macro.
Its unlikely you want to do short -> int, int -> float etc, conversion during swapping (if its needed we could have a non type checking macro).

Double that the optimized assembler outbut using SWAP() remains unchanged from before.

This exposed quite a few places where redundant type conversion was going on.

Also remove curve.c's swapdata() and replace its use with swap_v3_v3()
2012-08-25 20:16:08 +00:00
Campbell Barton
699b23ecdb fix for type mismatch with SWAP() macro. 2012-08-25 19:43:15 +00:00
Campbell Barton
ed0489bb6e style cleanup: also spelling 2012-08-24 23:22:34 +00:00
Campbell Barton
f0951f58ca code cleanup: rename G.afbreek --> is_break, G.rendering --> is_rendering 2012-08-08 18:37:06 +00:00
Campbell Barton
62a73381a7 use fabsf when using floats. 2012-07-21 15:27:40 +00:00
Campbell Barton
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
Campbell Barton
f5f25b81e8 style cleanup:
also fix for building ghost test and fix double free in one of the tests
2012-06-17 09:58:26 +00:00
Campbell Barton
e1241030db yse BLI_math for the compositor in more places. 2012-06-12 20:04:55 +00:00
Campbell Barton
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
Campbell Barton
9dd981a440 style cleanup: block comments 2012-05-16 23:37:23 +00:00
Campbell Barton
305d341ec2 code cleanup: use vector math function minmax_v3v3_v3() and other minor vector function edits. 2012-05-13 11:05:52 +00:00
Campbell Barton
145289ad95 code cleanup: minor improvements to float/vector usage. 2012-05-12 22:13:38 +00:00
Sergey Sharybin
c79892c5cd Style cleanup of own modules using style checker from Campbell. 2012-05-07 08:53:59 +00:00
Sergey Sharybin
3ef11693f5 Style cleanup: displist module 2012-05-07 06:58:03 +00:00
Campbell Barton
c93d7a193a style cleanup: BKE_*.c files which deal with library functions 2012-05-06 15:15:33 +00:00
Campbell Barton
c91cee2bb9 code cleanup: naming - BKE_mesh_* 2012-05-05 21:28:12 +00:00
Campbell Barton
34b18fcbc1 code cleanup: BKE_ naming, also make bpy.data.images.load() always load a new image. (not use existing one) 2012-05-05 14:52:04 +00:00
Campbell Barton
a731e13043 code cleanup: function naming, use BKE_*type* prefix. 2012-05-05 14:03:12 +00:00
Sergey Sharybin
72fa158724 Added start and end bevel factor for curves, so now it's possible to make
a bevelled curve which isn't fully covered with a bevel.
2012-05-04 17:04:20 +00:00
Campbell Barton
343edf2722 style cleanup: function calls & whitespace. 2012-04-29 17:11:40 +00:00
Campbell Barton
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
Sergey Sharybin
f88cfd9168 Code and style cleanup in own modules in BKE and also mball module
- Make sure functions are named in way BKE_<object>_<action> (same way as RNA callbacks)
- Make functions which are used by mball.c only static and remove their prototypes
  from public header file.

Further cleanup is coming.
2012-04-28 16:49:00 +00:00
Campbell Barton
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
Campbell Barton
6faeac9fe2 style cleanup: add braces around checks - 'if ELEM() {...}', confuses some parsers that done expand macros. 2012-03-25 22:35:18 +00:00
Campbell Barton
b8a71efeba style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00
Campbell Barton
69e6894b15 style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:18:31 +00:00
Campbell Barton
7ff77ed4ea code cleanup: use zero_v3 2012-03-23 20:18:09 +00:00
Sergey Sharybin
e0a2e79f4d Fix #30406: Hooks ignore Automatic handles setting in curves
Update handles positions after applying modifiers which seems to be expected behavior.
The only currently unsolved issue is about updating aligned handles because this needs
to determine in which order handles need to be recalculated which currently depends on
selection flags and which is quite tricky to do when running modifiers and animation data,
so currently just not update their positions for now.
2012-03-12 14:55:56 +00:00
Campbell Barton
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
Campbell Barton
ed04c21374 code cleanup: use float vector size in function definitions, and const's where the values are unchanged. 2012-02-28 14:05:00 +00:00
Campbell Barton
3f1584c758 fix 2 bugs
- box packing wasn't flagging out the right free corner of a vertex in some cases.
- tex_space_curve wasn't counting quad displists properly.
2012-01-20 22:09:30 +00:00