Commit Graph

8 Commits

Author SHA1 Message Date
Sergey Sharybin 35b61a7512 Move GCC attributes into a centraized defines
Instead of having ifdef __GNUC__ all over the headers
to use special compiler's hints use a special file where
all things like this are concentrated.

Makes code easier to follow and allows to manage special
attributes in more efficient way.

Thanks Campbell for review!
2013-09-01 15:01:15 +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
Brecht Van Lommel dc5ba03945 Fix #33123: lamp nodes drivers not working, now uses same hacks as material
to work around dependency graph limitations.
2012-11-09 13:57:09 +00:00
Campbell Barton b91bc4f037 use gcc attrubutes to warn on unused return values and arguments which shouldnt be NULL.
also remove IDP_AppendArray's return value which wasnt the new item in the array (which is odd/misleading), but wasnt used anywhere either.
2012-07-08 06:00:27 +00:00
Campbell Barton 1dccd4c98a code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
2012-05-05 16:03:57 +00:00
Campbell Barton a731e13043 code cleanup: function naming, use BKE_*type* prefix. 2012-05-05 14:03:12 +00:00
Campbell Barton 2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Brecht Van Lommel 647447db58 Code refactoring: split lamp functions from object.c into new lamp.c. 2011-11-05 13:11:49 +00:00