Compare commits

..

150 Commits

Author SHA1 Message Date
9282d305bd Merge branch 'master' into texture_nodes_refactor
Conflicts:
	source/blender/nodes/texture/nodes/node_texture_math.c
2014-12-23 10:04:03 +05:00
646a96bf8e Fix T42952: Curve modifier not taken into account when curve is created from mesh
Curve and array modifiers requires curve path to be evaluated, dependency graph
will make sure that curve eval would create such a path, but if curve was already
evaluated we might miss path.

So what we do now is: if path was not calculated for target curve we tag it for
update.
2014-12-22 19:05:56 +05:00
f78490182e partial revert ab6417aa9f was too strict 2014-12-22 13:26:35 +01:00
abf39fa31f Quick fix for UI themes, by meta-androcto (Brendon Murphy), thanks. 2014-12-22 09:57:56 +01:00
cd4fedb285 Fix T42966: Py_Initialize: Unable to get the locale encoding
This only happened for SCons builds and caused by pure human stupidnes.
2014-12-22 13:43:23 +05:00
julianeisel
59a0c11ecc GPencil: Correction to rB071ec918f4cd
* correct API convention: in rB071ec918f4cd gp_draw_data drew mulitple data blocks, I added gp_draw_data_all which now calles gp_draw_data multiple times (if needed). This follows our normal convention, e.g. see UI_panel_category_draw_all
* Draw scene data first, users may expect it like this

Points raised by @aligorith, thanks for this!
2014-12-21 15:48:30 +01:00
1fe7b84c73 Fix T42973: Render viewport not updating when switching materials in Outliner
For now, do as RNA material update functions - tag object for update too.
2014-12-21 12:40:02 +01:00
julianeisel
071ec918f4 Fix T42961: GPencil - Refactor object/scene data behaviour
D937 with minor edits (whitespace only)

@aligorith, I double checked everything runs smoothly, blame me if I missed something ;). Sorry for just taking the initiative and committing without talking to you, but I wasn't able to catch you the last days. This should be fixed before the release IMHO, but I don't think it's important enough to be committed during BCon5, so sorry again, but hopefully everything is okay :)
2014-12-20 16:18:18 +01:00
c2e56a5267 RNA Object.matrix_local: Add a big warning this matrix is only relative to parent object.
So 'advanced' parenting like e.g. bones or vertices need further processing
to get a real parent-relative matrix...
2014-12-20 14:16:06 +01:00
296a92f5f3 Fix T42972: fcurve lasso select crash 2014-12-20 13:48:36 +01:00
93c4ba7b70 Force phony targets to build (even if file exists)
This is a convenience makefile only,
files if they exist by accident shouldn't ever be used.
2014-12-20 02:15:14 +01:00
7a04c7f6d0 Ensure no integer overflow happens in SuperLU solver on memory allocation
x
2014-12-20 00:23:42 +05:00
3b639b8b3d Minor cleanup to previous commit 2014-12-19 14:43:29 +01:00
3e0ff35b4b Fix for bad file name string matching in point caches, leading to
deletion of baked caches.

This happens when objects use file names with matching prefixes:

"CubeX"   -> not baked
"CubeXYZ" -> baked

The first objects cache should be discarded up to the current frame on
file load, but the second should be left intact. But because the cache
file names for both use the same prefix as well (based on hex name
representation) they both match the "CubeX" name and get discarded.
Adding the underscore terminator solves this issue, because it is never
part of the hex file name string.

WARNING: this solution does not work with custom names for point caches.
This feature is pretty much broken, users have to ensure their names
are unique themselves. Due to the possibility of underscores in names
and the ambiguity of point cache suffixes there is no reliable way to
encode filenames in that case.
2014-12-19 13:34:50 +01:00
ef5c036d1c Fix T42543 projection painting fails when faces are perpendicular to screen.
This is UV barycentric interpolation failing for triangles where vertices are
colinear in screen space. To fix this, we detect this early on so we do the
interpolation on edges instead of triangles.

Such triangles will never be painted on unless we have occlusion and culling
off (since, arguably they are self occluded and almost back-facing).

The code still does not fill the whole area but this can be checked separately.
2014-12-19 12:27:29 +01:00
76ccc1d26b Fix reversed args in function call (float, bool vs. bool, float).
Note 'same' values are kept for now, even though it was probably meant the
other way around, it's safer to keep current behavior for now.
2014-12-19 10:15:10 +01:00
5cc199e495 Fix T42945: rv3d->gridview was not set correctly in view3d_draw_objects.
This fixes both transform snapping in persp views, and 'snap cursor to grid' feature.

Was only really visible with Imperial units.
2014-12-19 10:09:17 +01:00
5e67779d80 Code cleanup: include directory for scons
This directory does not exist even.
2014-12-19 13:43:52 +05:00
27b58f0eb2 Fix mathutils docstring typos. 2014-12-19 00:43:41 +09:00
de0b9f34d7 Flood fill in projection painting does not do bounds checking anymore.
It should now fill the whole mesh with color even if parts of it are
outside the screen - still need to be in fron of the camera though.

Thanks @Campbell for the trick :)
2014-12-18 16:28:43 +01:00
85f6fc501c Fix T42943: Crash with multiple calls to rna_info.BuildRNAInfo()
Thanks to @nesse for the fix
2014-12-18 14:31:33 +01:00
f0f1c7995b PyAPI: disallow assigning members to 'bpy.ops' 2014-12-18 13:52:31 +01:00
9f61350a05 Sequener: Move waveform-draw option into view menu
also simplify preview/sequencer checks
2014-12-18 13:47:40 +01:00
d4aaa4f9b6 cleanup: use const for smallhash & minor edits 2014-12-18 13:12:25 +01:00
c1eec5582a Fix/workaround T42944: Crash adding a shortcut in properties space 2014-12-18 12:49:48 +01:00
8627d65951 Correction to previous render border commit
Was using wrong bitfield check.
2014-12-18 14:43:08 +05:00
20006e4a67 Cycles: Do some logging when motion is detected in the scene 2014-12-18 14:40:14 +05:00
2bdd44c87a Correction to set border from render image view
It did not fully support cases when setting border from a cropped render result
and it's not totally clear how it should behave. So for now just do nothing and
inform users about this.
2014-12-18 13:24:21 +05:00
0c5eb88451 Quiet warning (harmless) 2014-12-18 02:15:42 +01:00
0ae4d7d405 Fix for GPU_materials_free accessing NULL pointer 2014-12-18 02:14:51 +01:00
3da1a75b74 correct recent cleanup for id-property types 2014-12-18 02:06:57 +01:00
b3b9e08423 Sequencer: Select sideof failed for strips touching the playhead 2014-12-17 23:11:41 +01:00
3820d44979 Cycles: Add missing entries in the Integrator constructor and some updates
to the XML API.

(Changes from the standalone repo)
2014-12-17 22:28:33 +01:00
cd4d5dcb46 Fix T42932: Drag&Drop of groups from the outliner was using undefined
event->mval.

Calculating from event->x/y like object drag/drop does works. Also fixed
a missing notifier of the object instancing operator.
2014-12-17 13:50:31 +01:00
a56e31c89c Fix triangulating concave quads
Resulting triangles could be pointing in opposing directions.
2014-12-17 11:34:16 +01:00
dc2617130b Fix: Never write previews for undo steps.
This may eat quite q bit of mem in the end (though nothing critical),
and icons (material ones e.g.) often ended up out of sync after undo.
2014-12-17 10:23:34 +01:00
b04d2f99f2 Fix T42927: Triangulate-beauty fails on quads
Regressions since 2.69.
2014-12-17 10:09:47 +01:00
15bde0dbea Docs: comments (hash table & beauty fill) 2014-12-17 09:58:23 +01:00
3e61478b1b Fix T42917 shadow maps not working on ATIs.
This is yet another issue with framebuffers. There are two issues: We
need the framebuffer fully bound to check for completeness and when we
bind a depth texture as frame buffer we need to disable read/write.
2014-12-16 21:52:55 +01:00
1b2fc74792 Fix typo in VBO 2014-12-16 20:20:41 +01:00
72330b97a2 Fix nasty typo in CPP RNA that would break on int or bool dynarrays... 2014-12-16 16:57:41 +01:00
1549fea999 Fix T42888: Separate and Combine HSV distorts the hue value
These nodes were assuming sRGB input/output which is for sure wrong for the
shader pipeline which works in the linear space.

So now conversion to/from linear space happens in these nodes which makes them
making sence in the shader context but which might change look and feel of
existing scenes.
2014-12-16 20:06:25 +05:00
137f557246 Remove NULL checking variable after using it. 2014-12-16 12:09:33 +01:00
72341537e8 Fix T42864: Knife-project fails with 'cut-through'
Removing edge-hit-doubles could incorrectly de-duplicate intersections between different edges.

Gave noticeable errors cutting through geometry that overlapped exactly.
2014-12-15 21:17:10 +01:00
76f50cd17a Fix for clip proxies builder reloading original footage frames
This isn't needed if the source is the image sequence.
2014-12-15 22:20:06 +05:00
f51b583ea0 Improve tip for simple deform origin 2014-12-15 16:10:17 +01:00
db0e2e7347 Fix T42864 (partial): knife-project included uncut backfaces
When knife-project ran with cut-through disabled,
it would still try to select faces behind the cut.

Now check if the faces are obscured.
2014-12-15 15:10:49 +01:00
2329b58fd3 Fix T42864 (partial): Knife-project had too-low precision 2014-12-15 15:10:49 +01:00
090ab750b3 Fix missing UI ID messages and/or I18N contexts for MovieClip/Mask/Palette/PaintCurve ID types. 2014-12-15 11:53:35 +01:00
c167ac1556 Tracking: Fix wrong logic in tracks synchronization
There was some stupidness in the way how tracks are synchronized from the job
to actual DNA data leading to all sort of weird and wonderful failures again.
2014-12-15 14:39:59 +05:00
06ea819c0d Tracking: Avoid possible treading issue reading the frame to sync 2014-12-15 14:34:47 +05:00
ca25fe98fc Tracking: Fix possible race condition accessing the tracks
Writing to the tracks was already inside the lock section, but
reading was not. This could have lead to race condition leading
to all sorts of weird and wonderful artifacts.
2014-12-15 14:31:19 +05:00
Severin
ae6f62c4e2 IME fix: Quit two assert failures
We could now also remove the win->ime_data assert in wm_window_IME_end,
but think it's better to leave it for further development.
2014-12-14 18:51:14 +01:00
c1d3532d2c Fix for idproperty comparison
comparing arrays had flipped logic
2014-12-14 18:24:13 +01:00
17253bec06 Fix T42892: UV pixel snap with negative values 2014-12-14 12:36:32 +01:00
9c81833430 Fix T42885: We still had a few wrong doc in mathutils about methods returning
instance of self while actually returning None...
2014-12-13 14:07:46 +01:00
d6beaad01c Fix T42875 GLSL display not correct in vertex array mode.
GLSL used a global variable to store the enabled vertex attributes which
were not set for vertex arrays after the VBO refactor.
2014-12-12 17:59:06 +01:00
28a0e1dae5 Fix T42883: ID-Prop arrays longer than 'shot' fail 2014-12-12 16:25:32 +01:00
fbd25174d1 Amend to previous 'append warning' commit.
Actually, append/link *is* converted/updated, issue here is IPO-to-FCurves
code is not called from our do_version code, but later, directly from BKE_blender's
setup_app_data. This is bad but not easily fixed it seems, so for now
keep a warning in this case.

thanks Sergey for the headup.
2014-12-12 12:38:54 +01:00
a6343696c1 Fix T42882: Now warn user when trying to append/link from older blender files.
Since we do not make any conversion in this case, worth warning user about
potential issues!
2014-12-12 12:13:30 +01:00
cea086dd97 cleanup: disallow NULL arg to uvedit_aspect
also some typo's
2014-12-12 11:18:03 +01:00
19eb700fef Fix blenderplayer compilation (tm) 2014-12-11 20:34:53 +01:00
f1ddf99580 Fix T42859 smart UV unwrap does not support aspect correction.
Can be considered TODO but it's not bad to support either. Also added
RNA api to get aspect ratio of assigned UV image - returns aspect
corrected image dimensions so needs adjustments for uv editing.
2014-12-11 19:46:35 +01:00
2309def874 Fix crash when changing worlds with world background active.
Freeing the preview will free the original gpu material so NULL that out
on copy.
2014-12-11 14:43:15 +01:00
754bdbe4b4 Cycles: Fix more wrong usages of RNA_id_pointer_create
Title says it all, just be more careful in the future.
2014-12-11 17:11:23 +05:00
cb7cf523e5 Fix T42829: Cycles crash rendering when file is saved to specific location
The issue was caused by the way how RNA pointer was created for the bMain:
namely Cycles was using RNA_id_pointer_create to create the pointer, which
would then try to refine the poniter based on the ID type.

This is just wrong and worked so far just because of co-incident, with the
file path from the bug report first letters in the ID name happened to be
NT which corresponds to NodeTree, and for sure refining such pointer will
fail.

Simple solution -- use proper way to create RNA pointer for non-ID block.
2014-12-11 16:55:10 +05:00
1999b5a814 Fix ping-pong actions when using the Action Actuator. 2014-12-11 00:05:11 -08:00
2617d37034 Libmv: Reshuffle CMake and SCons configuration files
The main idea is to share as much code between cases when feature-full built
is done and only logging is needed, so all the defines and include directories
are guaranteed to be the same.

This would hopefully make it so MinGW compilation is all happy about Cycles
logging for both CMake and SCons.
2014-12-11 11:58:03 +05:00
julianeisel
c71c7f0e0b Correction for non-Windows SCons compiling fix after IME Merge
As discussed in rB983c71931b1886d4, we should print a warning in case of building on non-Windows and WITH_BF_IME enabled. We also terminate build in this case, so the warning isn't scrolled away. Was worked out together with @sergey.
2014-12-11 00:22:17 +01:00
1e02a5ff43 Fix for object_utils.object_data_add: Now supports None obdata for
creating empties.

The documentation says None is a valid argument for obdata (making
empties), but this would cause an exception. Now obdata is only used
when it is defined. An optional name argument can be passed to override
obdata.name as well.
2014-12-10 17:22:26 +01:00
d7e4944e5b UI: add Shift-Drag to multiselect expanded enum items too.
Differential Revision: https://developer.blender.org/D928
2014-12-10 17:04:36 +01:00
aaa02bd490 startup.blend, update movie-tracking layout T41660
Layout by @sebastian_k, now includes 3D view.
2014-12-10 16:49:00 +01:00
bce0dc8cf7 cleanup: comment unused defines 2014-12-10 15:55:40 +01:00
d9ddc99a27 Fix T42184: Normal not displayed correctly in Material Viewport
There was a differences between how Cycles and BI treats Normal shader:

- Different normal direction assumption
- Different policy about vector normalization

Previous idea of trying to use single function and flip the output if
needed becomes more tricky, so i've just added new GLSL function which
corresponds to how Cycles deals with the Normal shader.
2014-12-10 19:12:54 +05:00
d68521df7b Cycles: Fix difference between SVM and OSL implementation of Normal node
SVM was normalizing the input normal, OSL did not. This lead to render
result differences across this shading systems.
2014-12-10 19:07:50 +05:00
668ffcd6e9 Fix for wrong flip of Normal node Dot output for new shading system
It was wrong to use invert(), we need to multiply by -1 instead.
2014-12-10 18:50:30 +05:00
01bda15832 Fix T42472: Undoing/Redoing repeated transform operator gives wrong final matrix on objects with no geom data.
This hack should not be needed here, quoting Sergey, the actual issue comes from BKE_object_handle_update_ex,
which is calling BKE_object_where_is_calc_ex when it shouldn't.

Propper fix is depsgraph refactor topic, though.
2014-12-10 13:57:16 +01:00
7366283c01 Fix T42818: Cycles SSS passes are incorrect for SSS size of 0
This was caused by some internal optimization which evaluated SSS with
size of zero as BSDF but used different ID so the evaluation result
didn't appear in regular diffuse pass.

This lead to situation when SSS data was nowhere stored if the
size was zero.

Now SSS with zero size and close-to-zero sizes will be handled in the
same way from the passes point of view.
2014-12-10 17:28:44 +05:00
602250d9fe Fix T42748: Crash in subsurf, threaded access
Allocating the iterator from a BLI_memarena wasn't threadsafe.
Change the API to use stack memory for iterators.

Thanks to @mont29 for finding exact cause of the bug.
2014-12-10 11:16:42 +01:00
47788b5e68 Switch to numpy 1.9 for windows platform 2014-12-10 13:50:51 +05:00
1807dcf619 Fix numpy installation on windows+cmake
The was caused by numpy never unpackign because of no
dpependnecy of any targets from the unpacked numpy.

Tried making it so blender target dpeends on it, but for
some reason it didn't work. For now added dedicated target
for unpacked numpy. A bit dirty but much better than just
totally failing.
2014-12-10 13:45:45 +05:00
8555595d17 Fixes for compilation with msvc
MSVC doesn't like caling macro argument f when using float values
in the macro, it simply replaces the f in the float value with the
argument..

CMake compilation still fails because of 77785ce708, numpy is never
getting unpacked.
2014-12-10 13:39:24 +05:00
9783d9297c cleanup: pep8 2014-12-09 21:49:46 +01:00
117a7e3545 Sequencer: optionally show strip offsets
was disabled in recent sequencer refactor, enable with view menu option.
2014-12-09 21:42:25 +01:00
17f0a01a56 Correct last commit checking knife edges 2014-12-09 20:57:37 +01:00
e77b25fabb Cycles: Code cleanup, typo 2014-12-10 00:08:33 +05:00
6fb1e1680b Knife: cuts along existing edges are now selected
This means cuts along existing edges don't have gaps in the selection.

Fixes T42616
2014-12-09 19:51:08 +01:00
2efc3211ab Knife: rename vert & edge 'draw' to 'is_cut'
More logical for checking if the edge is a cut into the mesh.
2014-12-09 17:24:19 +01:00
4d9f2f7e86 Knife: fix edge aligned cuts, could add redundant verts 2014-12-09 17:23:10 +01:00
d5abe8419d Smallhash: add support for iterating value pointers
also add reinsert function
2014-12-09 17:18:05 +01:00
233c650d55 Gooseberry request, circle select for graph editor 2014-12-09 16:54:15 +01:00
491839b3c8 Fix T42857: Inconsistency between cache line visibility and ability to change frame from image space 2014-12-09 20:34:28 +05:00
781db5f8a6 Knife: test if an edge is on the face boundary
Was checking if an edges midpoint was inside the face,
giving random results (point-inside for an edge location).
2014-12-09 15:57:59 +01:00
171a6bb5dc Fix T42488: Knife (selected_only + occlude) failed 2014-12-09 15:51:58 +01:00
8fe336ce7e Fix T4284: Drawing modified curves crashes 2014-12-09 14:38:32 +01:00
ebee593f26 Fix bug reported by kopias on irc, crash when attempting to set canvas
with a non-mesh object selected
2014-12-09 14:36:24 +01:00
59f1585d02 Fix T42175: Modifiers don't render in sculpt mode using multires
Modifier stack should ignore sculpt restrictions when creating derived render.
2014-12-09 17:21:02 +05:00
a5c3de2e49 Fix T42630: Triangulate returns invalid face-map
Triangulate with beautify caused a bug when there were existing edges
could make the bmesh-operator return an invalid face-map.

Now the beauty is calculated on the 2d-tri's resulting from polyfill,
its simpler and faster.
2014-12-09 13:08:28 +01:00
6076bedec0 Cleanup: remove scanfill define for polyfill code
also rename vars which were previously used for scanfill.
2014-12-09 12:19:26 +01:00
83cbcefac8 Add edgehash remove, clear functions, Heap clear
Edgehash was missing removal functions (remove, popkey, clear),
since it wasn't needed so far, but is based on same code as ghash which has them.

also add heap clear() method so we can reuse heaps.

(needed for upcoming fix).
2014-12-09 00:32:20 +01:00
55812e3acd Cleanup: simplify heap popmin 2014-12-09 00:13:35 +01:00
03760fed0d Cleanup: remove unused pointer in Heap 2014-12-09 00:02:50 +01:00
ab6417aa9f Fix Mesh Objects with missing textures or wrong texture path now import without texture 2014-12-08 19:57:50 +01:00
8545fb516e Fix T42824: Proxy bone custom-shape lost on undo 2014-12-08 16:46:42 +01:00
252bfc6f65 Fix T42838: Make dupli's real use_hierarchy fails
Regression since the dupli-object refactor.
2014-12-08 16:15:53 +01:00
7b6c9d23cf Cycles: Fix compilation error with MinGW and logging enabled 2014-12-08 19:37:41 +05:00
c07f6c02b3 Docs: reference the new manual 2014-12-08 11:18:58 +01:00
3e7e97f127 BMesh: ensure iterator macros assign to valid types
note, this is for C++ code which expects a cast, (will be added later)
also add a macro for nop-expressions (EXPR_NOP),
when we never want an expression to be evaluated, but it should still be valid.
2014-12-08 10:54:56 +01:00
690345a826 Cleanup: spelling 2014-12-08 09:46:21 +01:00
7ba2b37a8a Cleanup: remove unused operator-type member 2014-12-08 09:45:47 +01:00
julianeisel
b88e700df4 Cleanup: Minor edits to widget emboss code
* Rename "emboss" to "widget_emboss"
* Remove duplicated UI_GetThemeColor4ubv function

I made sure version bump and Save User Settings are working correctly ;P
2014-12-08 00:38:36 +01:00
julianeisel
983c71931b Fix non-Windows SCons compiling error after IME merge 2014-12-07 23:57:51 +01:00
Severin
12e5a32557 Forgot to add new files in recent IME commit
Sorry, my bad :/
2014-12-07 18:23:02 +01:00
fe4d0c234e Bugfix T42774: BSurface addon doesn't work on new builds
It turns out that several important modelling addons depend on the assumption
that Grease Pencil data gets created on the active object instead of on scene
level. This commit adds a toggle for setting whether new Grease Pencil data
is created on scene or object level.

These work as follows:
* "Scene" = The behaviour originally introduced as part of the GPencil_EditStrokes
  changes. New strokes are added to the scene instead of the active object, making
  it easier to manage things when working with Grease Pencil in general.
* "Object" = The previous behaviour (from 2.50 to 2.72), where new strokes are added
  to the active object. This is now being reintroduced to soften the transition
  for addons out there which have been doing this in a lazy/lax way so far.


Now, what may be slightly confusing are the "fallback" measures in place:
* "Scene" - To ensure that loading old files goes ok without needing a version patch,
   if the active object has GPencil data, that will be used in place of the scene's
   own GPencil data.
* "Object" - If there was no active object at the time of creating strokes
  (for instance, if you delete the active object immediately before drawing),
  GPencil data gets attached to the current scene instead.

Since some tweaks may still be needed here, I've decided to bump the subversion
number so that we have a reference point when doing version patches.
2014-12-08 02:42:45 +13:00
e67fd7a2cb Correct defines for binreloc
After recent moving path functions to appdir.c

patch T42826: by ldo (Lawrence D'Oliveiro)
2014-12-07 13:53:42 +01:00
Severin
e81d077c85 Input Method Editor (IME) support for text buttons
Original patch by @random (D765) with some minor work done by @campbell
and me.

At this place, I'd like call out a number of people who were involved and
deserve a big "Thank you!":
* At the first place @randon who developed and submitted the patch
* The Blendercn community which helped a lot with testing - espacially
* @yuzukyo, @leon_cheung and @kjym3
* @campbellbarton, @mont29 and @sergey for their help and advises during
* review
* @ton who realized the importance of this early on and asked me for
* reviewing

We are still not finished, as this is only the first part of the
implementaion, but there's more to come!
2014-12-07 00:58:17 +01:00
06515475b9 CMake: remove redundant include dir 2014-12-06 13:39:46 +01:00
81ae71fcd3 Fix crash in RE_AcquiredResultGet32 on debug builds introduced yesterday 2014-12-06 12:30:59 +01:00
6e8a8a72a3 OSX: change previous commit to not only make animation-player window frontmost but whole process 2014-12-06 12:13:28 +01:00
036f4e7a38 Cleanup: style from my previous commit 2014-12-06 03:48:41 -05:00
c077f5fa08 Fix T42789: support 3Dconnexion wireless devices
SpaceMouse Wireless
SpaceMouse Pro Wireless

Device info is from user reports. I don’t yet have the new devices, so
these are untested but likely to work :D
2014-12-06 02:48:51 -05:00
c8995ecc83 Fix inbetween mousemove event getting detected in hotkey buttons. 2014-12-06 02:28:05 +01:00
871cf70144 Fix playercompile after ecc03c8ed 2014-12-05 18:51:19 +01:00
825d6adef5 OSX: make sure window of new blender instance is front when playing animation 2014-12-05 18:42:10 +01:00
0493879401 Cycles: Report error via the new engine API
This way CUDA errors are visible in the image info line,
which makes things to behave the same across viewport and
final rendering.

That's right, we've got error reported via reports and info
line now. This is based on the feedback from our gooseberry
team.
2014-12-05 22:15:09 +05:00
ecc03c8ed0 Render API: Add RenderEngine.error_set() function
This function sets an error message which would be displayed after
rendering is over and info space lost the link to the engine.
2014-12-05 22:15:05 +05:00
2b4eeb79cd Cycles: Report error to the blender using report API
This way when something goes wrong in Cycles (for example out of VRAM, timelimit
launching the kernel etc) we'll have a nice report in the Info space header.

Sure it'll be nice to have mention of error in the image editor's information
line, but that's for the future.

This fixes T42747: "CUDA error" appears only momentarily, then disappears
2014-12-05 22:15:04 +05:00
bd0b9ed0c0 Cycles: Add dedicated Progress::set_error() call
Currently it acts the same as set_cancel(), but this way we're able to
distinguish situations when rendering was aborted by user demand (for
example pressing Esc in standalone renderer) or if something went horribly
wrong (for example out of VRAM error).
2014-12-05 22:15:04 +05:00
716890e864 Cycles: Early output from Scene::device_update when device error occurs
This way for example we wouldn't wait a fortune while BVH is building after
GPU run out of memory when loading images just to see the render failure
message.
2014-12-05 22:15:04 +05:00
0b67102bd6 Cycles: Code cleanup, whitespace 2014-12-05 22:15:04 +05:00
e1e984e437 Fix T42807, variance shadow map broken afterFBO changes.
This code was a bit do-it-yourself instead of relying on the API. Should
be OK now.
2014-12-05 16:01:18 +01:00
e54d571176 Amendment to previous commit: Add an option to scene strips to disable GPencil
On second thought, it is probably still worthwhile to be able to disable GPencil
drawing on strips. By default, GPencil strokes are still shown by default now,
but they can be turned off using this option if it turns out that they are
getting in the way (e.g. a director/animator make some planning notes in the shot
at an earlier stage which are hidden for normal display now, but are still there
popping up sproadically during the animatic).
2014-12-05 16:39:49 +13:00
3673a03226 Grease Pencil sketches get included when doing OpenGL previews for scene strips in sequencer
After double checking the sequencer code, there doesn't seem to be any reason to
exclude these from the sequencer previews. This makes it possible to use the
sequencer to non-destructively chain together difference Grease Pencil animated
shots together without having to render each image sequence first, allowing for
a smoother workflow.

Just in case the initial assumption isn't entirely correct, I've put in place
an extra arg to the relevant functions which can be hooked up to a suitable
option on the scene strip later to turn this on/off as needed.
2014-12-05 15:47:23 +13:00
844909b294 Fix for typo + memory leak 2014-12-05 14:15:46 +13:00
e93990dfc5 Bugfix T42697: Hiding/unhiding NLA strip doesn't update the 3D Viewport
The Toggle Muting operator was missing code to tag the animation to get recalculated.

This was also missing from a few other operators too, including Snap, and
Add/Paste FModifiers .
2014-12-05 14:14:50 +13:00
abab4f19e6 Fix scons+mingw64 compiling - Ensure WITH_BF_CYCLES_LOGGING is defined and turned off 2014-12-05 13:13:34 +13:00
030b694c7a To make Strokes Edit Mode a bit more "solid", Tab key can be used to toggle out of it 2014-12-05 12:12:03 +13:00
d87ff752af Selectmouse-drag now works to move GPencil verts 2014-12-05 12:12:03 +13:00
cf7bdb42ac BGE VideoTexture: refresh() on ImageFFmpeg should have no effect.
ImageFFmpeg objects will not refresh properly because the image
file is closed immediately after creation. Therefore refresh()
should have no effect on them.
This was causing problems with ImageMix using ImageFFmpeg as
sources: refreshing the ImageMix object is required to update
the mix but it has the side effect of refreshing the underlying
sources, hence the need to skip refresh on fixed images.
2014-12-04 23:55:53 +01:00
de724a258e Merge branch 'master' into texture_nodes_refactor 2014-10-14 10:36:27 +02:00
a4ba73311b Port some more nodes
Now only node group remained to be ported, all the rest of the nodes
cant' be actually supported and will be removed.

As a replacement for them we'll bring some more control by adding
some mapping sockets to the input nodes.
2014-10-14 00:50:26 +06:00
b35aafab6a Port procedural texture nodes to new framework 2014-10-13 21:09:38 +06:00
94dd73b995 Support some more nodes 2014-10-11 22:57:53 +06:00
e9e555fb85 Port several more nodes to the new system
Need to switch to some other work now, maybe someone will want to play
around with the code meanwhile.
2014-10-11 21:50:15 +06:00
5c50820e6a Bring back image input, checker, viewer and output nodes
This more like a prove-of-concept change because well, we've got
a dependency solver in the nodes already which seems to work just
fine for the shading nodes. So want to see if this is something we
can use for texture nodes now.

This isn't that far away from the original idea of having some
SVM-like machine for texture nodes.

Hell of a lot of nodes are not gonna to work yet,
2014-10-11 21:01:16 +06:00
f5c526f29c Port texture nodes to the exec pool in renderer
This only makes it so renderer uses the proper API to deal with the
tree evaluation. Tree nodes still does nothing because all the delegate
system has been just removed.

Painting and sculpting will also fail and abort .
2014-10-11 19:22:54 +06:00
4bd79aca12 Revert "Cycles: Implement an area preserving parameterization sampling for area lamps"
This reverts commit c4235ce820.
2014-10-11 19:05:09 +06:00
b2d6cd2e33 Bring material nodes back to the render engine
The idea is to make make it so per-tree execution data is owned by
the renderer and being passed to the tree evaluation routines.
2014-10-11 19:03:37 +06:00
98bd0b4027 Get rid of old legacy stuff happening all over the place
Basically get rid of texture nodes deligates and exec data stored
in the DNA node tree structure.

Blender is pretty much unusable now, because there are whole areas
to be ported over.
2014-10-11 17:01:16 +06:00
c4235ce820 Cycles: Implement an area preserving parameterization sampling for area lamps
Replace old code for area lamps which was more like incorrect with more correct
one using the following paper as a reference:

  Carlos Urena et al.
  An Area-Preserving Parametrization for Spherical Rectangles.
  https://www.solidangle.com/research/egsr2013_spherical_rectangle.pdf

Implementation is straight from the paper, currently the rectangle contants are
calculated for each of the samples. Ideally we need to pre-calculate them.

The old PDF is still used, which makes difference real subtle. This is to be
corrected before final commit.

Reviewers: brecht, juicyfruit

Subscribers: dingto, ton

Differential Revision: https://developer.blender.org/D823
2014-10-11 15:53:23 +06:00
271 changed files with 3530 additions and 2773 deletions

View File

@@ -318,8 +318,8 @@ mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
# Misc
if (WIN32)
option(WITH_INPUT_IME "Enable Input Method Editor (IME)" ON)
if(WIN32)
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
endif()
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${_init_INPUT_NDOF})
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
@@ -1152,7 +1152,11 @@ elseif(WIN32)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi imm32)
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi)
if(WITH_INPUT_IME)
list(APPEND PLATFORM_LINKLIBS imm32)
endif()
add_definitions(
-D_CRT_NONSTDC_NO_DEPRECATE
@@ -1508,7 +1512,12 @@ elseif(WIN32)
endif()
endif()
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -limm32)
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi)
if(WITH_INPUT_IME)
list(APPEND PLATFORM_LINKLIBS -limm32)
endif()
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
if(WITH_MINGW64)

View File

@@ -113,7 +113,7 @@ endif
# -----------------------------------------------------------------------------
# Build Blender
all:
all: FORCE
@echo
@echo Configuring Blender ...
@@ -142,13 +142,13 @@ bpy: all
# -----------------------------------------------------------------------------
# Configuration (save some cd'ing around)
config:
config: FORCE
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Help for build targets
help:
help: FORCE
@echo ""
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
@echo " * debug - build a debug binary"
@@ -214,13 +214,13 @@ help:
# -----------------------------------------------------------------------------
# Packages
#
package_debian:
package_debian: FORCE
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
package_pacman:
package_pacman: FORCE
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
package_archive:
package_archive: FORCE
make -C "$(BUILD_DIR)" -s package_archive
@echo archive in "$(BUILD_DIR)/release"
@@ -228,24 +228,24 @@ package_archive:
# -----------------------------------------------------------------------------
# Tests
#
test:
test: FORCE
cd $(BUILD_DIR) ; ctest . --output-on-failure
# run pep8 check check on scripts we distribute.
test_pep8:
test_pep8: FORCE
python3 tests/python/pep8.py > test_pep8.log 2>&1
@echo "written: test_pep8.log"
# run some checks on our cmakefiles.
test_cmake:
test_cmake: FORCE
python3 build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
@echo "written: test_cmake_consistency.log"
# run deprecation tests, see if we have anything to remove.
test_deprecated:
test_deprecated: FORCE
python3 tests/check_deprecated.py
test_style_c:
test_style_c: FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
@@ -253,7 +253,7 @@ test_style_c:
"$(BLENDER_DIR)/source/creator" \
--no-length-check
test_style_c_qtc:
test_style_c_qtc: FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \
@@ -266,7 +266,7 @@ test_style_c_qtc:
@echo "written: test_style.tasks"
test_style_osl:
test_style_osl: FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
@@ -274,7 +274,7 @@ test_style_osl:
"$(BLENDER_DIR)/release/scripts/templates_osl"
test_style_osl_qtc:
test_style_osl_qtc: FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \
@@ -289,13 +289,13 @@ test_style_osl_qtc:
# Project Files
#
project_qtcreator:
project_qtcreator: FORCE
python3 build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
project_netbeans:
project_netbeans: FORCE
python3 build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
project_eclipse:
project_eclipse: FORCE
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
@@ -303,40 +303,40 @@ project_eclipse:
# Static Checking
#
check_cppcheck:
check_cppcheck: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt"
check_clang_array:
check_clang_array: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
check_splint:
check_splint: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
check_sparse:
check_sparse: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
check_smatch:
check_smatch: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_spelling_py:
check_spelling_py: FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/release/scripts"
check_spelling_c:
check_spelling_c: FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
@@ -345,7 +345,7 @@ check_spelling_c:
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost" \
check_spelling_c_qtc:
check_spelling_c_qtc: FORCE
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
@@ -356,13 +356,13 @@ check_spelling_c_qtc:
> \
"$(BLENDER_DIR)/check_spelling_c.tasks"
check_spelling_osl:
check_spelling_osl: FORCE
cd "$(BUILD_DIR)" ;\
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions:
check_descriptions: FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python \
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
@@ -370,14 +370,14 @@ check_descriptions:
# Utilities
#
tgz:
tgz: FORCE
./build_files/utils/build_tgz.sh
icons:
icons: FORCE
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
update:
update: FORCE
if [ -d "../lib" ]; then \
svn update ../lib/* ; \
fi
@@ -390,23 +390,23 @@ update:
#
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py:
doc_py: FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
doc_doxy:
doc_doxy: FORCE
cd doc/doxygen; doxygen Doxyfile
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna:
doc_dna: FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man:
doc_man: FORCE
python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
help_features:
help_features: FORCE
@python3 -c \
"import re; \
print('\n'.join([ \
@@ -417,7 +417,9 @@ help_features:
if w.startswith('WITH_')]))" | uniq
clean:
clean: FORCE
$(MAKE) -C "$(BUILD_DIR)" clean
.PHONY: all
FORCE:

View File

@@ -266,6 +266,7 @@ if 'blenderlite' in B.targets:
target_env_defs['WITH_BF_BOOLEAN'] = False
target_env_defs['WITH_BF_REMESH'] = False
target_env_defs['WITH_BF_PYTHON'] = False
target_env_defs['WITH_BF_IME'] = False
target_env_defs['WITH_BF_3DMOUSE'] = False
target_env_defs['WITH_BF_LIBMV'] = False
target_env_defs['WITH_BF_FREESTYLE'] = False

View File

@@ -170,6 +170,8 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
WITH_BF_IME = True
WITH_BF_OPENMP = True
#CUDA
@@ -196,7 +198,10 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-limm32']
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi']
if WITH_BF_IME:
LLIBS.append('-limm32')
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']

View File

@@ -151,6 +151,8 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
WITH_BF_IME = True
WITH_BF_3DMOUSE = True
WITH_BF_OPENMP = True
@@ -235,7 +237,10 @@ C_WARN = []
CC_WARN = []
CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
if WITH_BF_IME:
LLIBS.append('imm32')
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']

View File

@@ -169,6 +169,8 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
WITH_BF_IME = True
WITH_BF_OPENMP = True
#Freestyle
@@ -190,7 +192,10 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-limm32']
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread']
if WITH_BF_IME:
LLIBS.append('-limm32')
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']

View File

@@ -154,6 +154,8 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
WITH_BF_IME = True
WITH_BF_3DMOUSE = True
WITH_BF_OPENMP = True
@@ -242,7 +244,10 @@ C_WARN = []
CC_WARN = []
CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
if WITH_BF_IME:
LLIBS.append('imm32')
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']

View File

@@ -654,7 +654,7 @@ def WinPyBundle(target=None, source=None, env=None):
# Extract Numpy
if env['WITH_BF_PYTHON_INSTALL_NUMPY']:
py_tar = env.subst(env['LCGDIR']).lstrip("#")
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.8.tar.gz'
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.9.tar.gz'
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages')

View File

@@ -174,6 +174,7 @@ def validate_arguments(args, bc):
'WITH_BF_CXX_GUARDEDALLOC',
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
'BUILDBOT_BRANCH',
'WITH_BF_IME',
'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE', 'BF_CYCLES_CUDA_ENV',
'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
@@ -507,6 +508,8 @@ def read_opts(env, cfg, args):
(BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)),
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
(BoolVariable('WITH_BF_IME', 'Enable Input Method Editor (IME) for complex Asian character input', False)),
(BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
(BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
('BF_3DMOUSE', '3d mouse library base path', ''),

View File

@@ -37,13 +37,42 @@ set(SRC
libmv-capi.h
)
if(WITH_LIBMV)
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
list(APPEND INC
third_party/gflags
third_party/glog/src
third_party/ceres/include
third_party/ceres/config
../../intern/guardedalloc
)
list(APPEND
INC_SYS
../Eigen3
${PNG_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
)
if(WIN32)
list(APPEND INC
third_party/glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
third_party/msinttypes
)
endif()
endif()
add_definitions(
-DWITH_LIBMV_GUARDED_ALLOC
-DGOOGLE_GLOG_DLL_DECL=
-DLIBMV_NO_FAST_DETECTOR=
)
endif()
if(WITH_LIBMV)
TEST_SHARED_PTR_SUPPORT()
if(SHARED_PTR_FOUND)
if(SHARED_PTR_TR1_MEMORY_HEADER)
@@ -56,20 +85,6 @@ if(WITH_LIBMV)
message(FATAL_ERROR "Unable to find shared_ptr.")
endif()
list(APPEND INC
third_party/gflags
third_party/glog/src
third_party/ceres/include
third_party/ceres/config
../../intern/guardedalloc
)
list(APPEND INC_SYS
../Eigen3
${PNG_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
)
list(APPEND SRC
intern/autotrack.cc
intern/camera_intrinsics.cc
@@ -202,17 +217,6 @@ if(WITH_LIBMV)
third_party/msinttypes/stdint.h
)
if(WIN32)
list(APPEND INC
third_party/glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
third_party/msinttypes
)
endif()
endif()
if(WITH_GTESTS)
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "" "")
@@ -262,7 +266,7 @@ if(WITH_LIBMV)
endif()
# make GLog a separate target, so it can be used for gtest as well.
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
# We compile GLog together with GFlag so we don't worry about
# adding extra lib to linker.
set(GLOG_SRC
@@ -338,13 +342,5 @@ if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
)
endif()
set(GLOG_INC
third_party/gflags
third_party/glog/src
)
set(GLOG_INC_SYS
)
blender_add_lib(extern_glog "${GLOG_SRC}" "${GLOG_INC}" "${GLOG_INC_SYS}")
blender_add_lib(extern_glog "${GLOG_SRC}" "${INC}" "${INC_SYS}")
endif()

View File

@@ -12,6 +12,22 @@ Import('env')
defs = []
incs = '.'
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
defs.append('GOOGLE_GLOG_DLL_DECL=')
defs.append('WITH_LIBMV_GUARDED_ALLOC')
defs.append('LIBMV_NO_FAST_DETECTOR')
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
else:
incs += ' ./third_party/glog/src'
if env['WITH_BF_LIBMV']:
if not env['WITH_SHARED_PTR_SUPPORT']:
print("-- Unable to find shared_ptr which is required for compilation.")
@@ -22,10 +38,6 @@ if env['WITH_BF_LIBMV']:
if env['SHARED_PTR_NAMESPACE'] == 'std::tr1':
defs.append('CERES_TR1_SHARED_PTR')
defs.append('GOOGLE_GLOG_DLL_DECL=')
defs.append('WITH_LIBMV_GUARDED_ALLOC')
defs.append('LIBMV_NO_FAST_DETECTOR')
src = env.Glob('intern/*.cc')
src.remove('intern' + os.sep + 'stub.cc')
src += env.Glob('libmv/autotrack/*.cc')
@@ -36,18 +48,6 @@ if env['WITH_BF_LIBMV']:
src += env.Glob('libmv/simple_pipeline/*.cc')
src += env.Glob('libmv/tracking/*.cc')
src += env.Glob('third_party/gflags/*.cc')
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
else:
incs += ' ./third_party/glog/src'
else:
src = env.Glob("intern/stub.cc")

107
extern/libmv/bundle.sh vendored
View File

@@ -130,25 +130,7 @@ set(SRC
libmv-capi.h
)
if(WITH_LIBMV)
add_definitions(
-DWITH_LIBMV_GUARDED_ALLOC
-DGOOGLE_GLOG_DLL_DECL=
-DLIBMV_NO_FAST_DETECTOR=
)
TEST_SHARED_PTR_SUPPORT()
if(SHARED_PTR_FOUND)
if(SHARED_PTR_TR1_MEMORY_HEADER)
add_definitions(-DCERES_TR1_MEMORY_HEADER)
endif()
if(SHARED_PTR_TR1_NAMESPACE)
add_definitions(-DCERES_TR1_SHARED_PTR)
endif()
else()
message(FATAL_ERROR "Unable to find shared_ptr.")
endif()
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
list(APPEND INC
third_party/gflags
third_party/glog/src
@@ -163,6 +145,38 @@ if(WITH_LIBMV)
\${ZLIB_INCLUDE_DIRS}
)
if(WIN32)
list(APPEND INC
third_party/glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
third_party/msinttypes
)
endif()
endif()
add_definitions(
-DWITH_LIBMV_GUARDED_ALLOC
-DGOOGLE_GLOG_DLL_DECL=
-DLIBMV_NO_FAST_DETECTOR=
)
endif()
if(WITH_LIBMV)
TEST_SHARED_PTR_SUPPORT()
if(SHARED_PTR_FOUND)
if(SHARED_PTR_TR1_MEMORY_HEADER)
add_definitions(-DCERES_TR1_MEMORY_HEADER)
endif()
if(SHARED_PTR_TR1_NAMESPACE)
add_definitions(-DCERES_TR1_SHARED_PTR)
endif()
else()
message(FATAL_ERROR "Unable to find shared_ptr.")
endif()
list(APPEND SRC
intern/autotrack.cc
intern/camera_intrinsics.cc
@@ -194,17 +208,6 @@ ${headers}
${third_headers}
)
if(WIN32)
list(APPEND INC
third_party/glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
third_party/msinttypes
)
endif()
endif()
if(WITH_GTESTS)
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "${INC}" "${INC_SYS}")
@@ -224,7 +227,7 @@ if(WITH_LIBMV)
endif()
# make GLog a separate target, so it can be used for gtest as well.
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
# We compile GLog together with GFlag so we don't worry about
# adding extra lib to linker.
set(GLOG_SRC
@@ -267,15 +270,7 @@ ${third_glog_headers}
)
endif()
set(GLOG_INC
third_party/gflags
third_party/glog/src
)
set(GLOG_INC_SYS
)
blender_add_lib(extern_glog "\${GLOG_SRC}" "\${GLOG_INC}" "\${GLOG_INC_SYS}")
blender_add_lib(extern_glog "\${GLOG_SRC}" "\${INC}" "\${INC_SYS}")
endif()
EOF
@@ -294,6 +289,22 @@ Import('env')
defs = []
incs = '.'
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
defs.append('GOOGLE_GLOG_DLL_DECL=')
defs.append('WITH_LIBMV_GUARDED_ALLOC')
defs.append('LIBMV_NO_FAST_DETECTOR')
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
else:
incs += ' ./third_party/glog/src'
if env['WITH_BF_LIBMV']:
if not env['WITH_SHARED_PTR_SUPPORT']:
print("-- Unable to find shared_ptr which is required for compilation.")
@@ -304,25 +315,9 @@ if env['WITH_BF_LIBMV']:
if env['SHARED_PTR_NAMESPACE'] == 'std::tr1':
defs.append('CERES_TR1_SHARED_PTR')
defs.append('GOOGLE_GLOG_DLL_DECL=')
defs.append('WITH_LIBMV_GUARDED_ALLOC')
defs.append('LIBMV_NO_FAST_DETECTOR')
src = env.Glob('intern/*.cc')
src.remove('intern' + os.sep + 'stub.cc')
$src
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
${win_src}
else:
incs += ' ./third_party/glog/src'
else:
src = env.Glob("intern/stub.cc")

View File

@@ -825,6 +825,14 @@ static void xml_read_background(const XMLReadState& state, pugi::xml_node node)
Shader *shader = state.scene->shaders[state.scene->default_background];
xml_read_bool(&shader->heterogeneous_volume, node, "heterogeneous_volume");
xml_read_int(&shader->volume_interpolation_method, node, "volume_interpolation_method");
if(xml_equal_string(node, "volume_sampling_method", "distance"))
shader->volume_sampling_method = VOLUME_SAMPLING_DISTANCE;
else if(xml_equal_string(node, "volume_sampling_method", "equiangular"))
shader->volume_sampling_method = VOLUME_SAMPLING_EQUIANGULAR;
else if(xml_equal_string(node, "volume_sampling_method", "multiple_importance"))
shader->volume_sampling_method = VOLUME_SAMPLING_MULTIPLE_IMPORTANCE;
xml_read_shader_graph(state, shader, node);
}

View File

@@ -20,6 +20,8 @@
#include "blender_sync.h"
#include "blender_util.h"
#include "util_logging.h"
CCL_NAMESPACE_BEGIN
/* Blender Camera Intermediate: we first convert both the offline and 3d view
@@ -400,6 +402,7 @@ void BlenderSync::sync_camera_motion(BL::Object b_ob, float motion_time)
tfm = blender_camera_matrix(tfm, cam->type);
if(tfm != cam->matrix) {
VLOG(1) << "Camera " << b_ob.name() << " motion detected.";
if(motion_time == -1.0f) {
cam->motion.pre = tfm;
cam->use_motion = true;

View File

@@ -27,6 +27,7 @@
#include "subd_split.h"
#include "util_foreach.h"
#include "util_logging.h"
#include "mikktspace.h"
@@ -761,11 +762,13 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Object *object, float motion
if(new_attribute) {
if(i != numverts || memcmp(mP, &mesh->verts[0], sizeof(float3)*numverts) == 0) {
/* no motion, remove attributes again */
VLOG(1) << "No actual motion for mesh " << b_mesh.name();
mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
if(attr_mN)
mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_NORMAL);
}
else if(time_index > 0) {
VLOG(1) << "Filling motion for mesh " << b_mesh.name();
/* motion, fill up previous steps that we might have skipped because
* they had no motion, but we need them anyway now */
float3 *P = &mesh->verts[0];

View File

@@ -30,6 +30,7 @@
#include "util_foreach.h"
#include "util_hash.h"
#include "util_logging.h"
CCL_NAMESPACE_BEGIN
@@ -251,6 +252,7 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
if(object && (scene->need_motion() == Scene::MOTION_PASS || object_use_motion(b_ob))) {
/* object transformation */
if(tfm != object->tfm) {
VLOG(1) << "Object " << b_ob.name() << " motion detected.";
if(motion_time == -1.0f) {
object->motion.pre = tfm;
object->use_motion = true;

View File

@@ -105,7 +105,7 @@ static PyObject *create_func(PyObject *self, PyObject *args)
BL::UserPreferences userpref(userprefptr);
PointerRNA dataptr;
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pydata), &dataptr);
RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr);
BL::BlendData data(dataptr);
PointerRNA sceneptr;
@@ -113,15 +113,15 @@ static PyObject *create_func(PyObject *self, PyObject *args)
BL::Scene scene(sceneptr);
PointerRNA regionptr;
RNA_id_pointer_create((ID*)pylong_as_voidptr_typesafe(pyregion), &regionptr);
RNA_pointer_create(NULL, &RNA_Region, pylong_as_voidptr_typesafe(pyregion), &regionptr);
BL::Region region(regionptr);
PointerRNA v3dptr;
RNA_id_pointer_create((ID*)pylong_as_voidptr_typesafe(pyv3d), &v3dptr);
RNA_pointer_create(NULL, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d), &v3dptr);
BL::SpaceView3D v3d(v3dptr);
PointerRNA rv3dptr;
RNA_id_pointer_create((ID*)pylong_as_voidptr_typesafe(pyrv3d), &rv3dptr);
RNA_pointer_create(NULL, &RNA_RegionView3D, pylong_as_voidptr_typesafe(pyrv3d), &rv3dptr);
BL::RegionView3D rv3d(rv3dptr);
/* create session */
@@ -196,7 +196,7 @@ static PyObject *bake_func(PyObject *self, PyObject *args)
void *b_result = PyLong_AsVoidPtr(pyresult);
PointerRNA bakepixelptr;
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pypixel_array), &bakepixelptr);
RNA_pointer_create(NULL, &RNA_BakePixel, PyLong_AsVoidPtr(pypixel_array), &bakepixelptr);
BL::BakePixel b_bake_pixel(bakepixelptr);
python_thread_state_save(&session->python_thread_state);
@@ -238,7 +238,7 @@ static PyObject *reset_func(PyObject *self, PyObject *args)
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
PointerRNA dataptr;
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pydata), &dataptr);
RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr);
BL::BlendData b_data(dataptr);
PointerRNA sceneptr;

View File

@@ -92,6 +92,7 @@ void BlenderSession::create_session()
/* reset status/progress */
last_status = "";
last_error = "";
last_progress = -1.0f;
start_resize_time = 0.0;
@@ -826,10 +827,8 @@ void BlenderSession::update_status_progress()
get_status(status, substatus);
get_progress(progress, total_time);
if(background) {
if(progress>0)
if(progress > 0)
remaining_time = (1.0 - (double)progress) * (total_time / (double)progress);
scene += " | " + b_scene.name();
@@ -843,12 +842,12 @@ void BlenderSession::update_status_progress()
if(samples > 0 && total_samples != USHRT_MAX)
remaining_time = (total_samples - samples) * (total_time / samples);
}
if(remaining_time>0) {
if(remaining_time > 0) {
BLI_timestr(remaining_time, time_str, sizeof(time_str));
timestatus += "Remaining:" + string(time_str) + " | ";
}
timestatus += string_printf("Mem:%.2fM, Peak:%.2fM", (double)mem_used, (double)mem_peak);
if(status.size() > 0)
@@ -865,6 +864,21 @@ void BlenderSession::update_status_progress()
b_engine.update_progress(progress);
last_progress = progress;
}
if (session->progress.get_error()) {
string error = session->progress.get_error_message();
if(error != last_error) {
/* TODO(sergey): Currently C++ RNA API doesn't let us to
* use mnemonic name for the variable. Would be nice to
* have this figured out.
*
* For until then, 1 << 5 means RPT_ERROR.
*/
b_engine.report(1 << 5, error.c_str());
b_engine.error_set(error.c_str());
last_error = error;
}
}
}
void BlenderSession::tag_update()

View File

@@ -91,6 +91,7 @@ public:
string b_rlay_name;
string last_status;
string last_error;
float last_progress;
int width, height;

View File

@@ -400,7 +400,7 @@ BVHNode* BVHBuild::build_node(const BVHRange& range, int level)
progress_total += left.size() + right.size() - range.size();
size_t total = progress_total;
/* leaft node */
/* left node */
BVHNode *leftnode = build_node(left, level + 1);
/* right node (modify start for splits) */

View File

@@ -76,7 +76,7 @@ public:
{
if(first_error) {
fprintf(stderr, "\nRefer to the Cycles GPU rendering documentation for possible solutions:\n");
fprintf(stderr, "http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/GPU_Rendering\n\n");
fprintf(stderr, "http://www.blender.org/manual/render/cycles/gpu_rendering.html\n\n");
first_error = false;
}
}

View File

@@ -681,7 +681,7 @@ ccl_device float3 shader_bsdf_subsurface(KernelGlobals *kg, ShaderData *sd)
for(int i = 0; i< sd->num_closure; i++) {
ShaderClosure *sc = &sd->closure[i];
if(CLOSURE_IS_BSSRDF(sc->type))
if(CLOSURE_IS_BSSRDF(sc->type) || CLOSURE_IS_BSDF_BSSRDF(sc->type))
eval += sc->weight;
}

View File

@@ -541,7 +541,7 @@ typedef enum AttributeStandard {
/* This struct is to be 16 bytes aligned, we also keep some extra precautions:
* - All the float3 members are in the beginning of the struct, so compiler
* does not put own pddings trying to align this members.
* does not put own padding trying to align this members.
* - We make sure OSL pointer is also 16 bytes aligned.
*/
typedef struct ShaderClosure {

View File

@@ -15,6 +15,7 @@
*/
#include "stdosl.h"
#include "node_color.h"
shader node_combine_hsv(
float H = 0.0,
@@ -22,6 +23,6 @@ shader node_combine_hsv(
float V = 0.0,
output color Color = 0.8)
{
Color = color("hsv", H, S, V);
Color = color_srgb_to_scene_linear(color("hsv", H, S, V));
}

View File

@@ -23,6 +23,6 @@ shader node_normal(
output float Dot = 1.0)
{
NormalOut = normalize(Direction);
Dot = dot(NormalOut, NormalIn);
Dot = dot(NormalOut, normalize(NormalIn));
}

View File

@@ -23,7 +23,7 @@ shader node_separate_hsv(
output float S = 0.0,
output float V = 0.0)
{
color col = rgb_to_hsv(Color);
color col = rgb_to_hsv(color_scene_linear_to_srgb(Color));
H = col[0];
S = col[1];

View File

@@ -26,7 +26,8 @@ ccl_device void svm_node_combine_hsv(KernelGlobals *kg, ShaderData *sd, float *s
float value = stack_load_float(stack, value_in);
/* Combine, and convert back to RGB */
float3 color = hsv_to_rgb(make_float3(hue, saturation, value));
float3 color = color_srgb_to_scene_linear(
hsv_to_rgb(make_float3(hue, saturation, value)));
if (stack_valid(color_out))
stack_store_float3(stack, color_out, color);
@@ -40,7 +41,7 @@ ccl_device void svm_node_separate_hsv(KernelGlobals *kg, ShaderData *sd, float *
float3 color = stack_load_float3(stack, color_in);
/* Convert to HSV */
color = rgb_to_hsv(color);
color = rgb_to_hsv(color_scene_linear_to_srgb(color));
if (stack_valid(hue_out))
stack_store_float(stack, hue_out, color.x);

View File

@@ -59,6 +59,10 @@ Integrator::Integrator()
mesh_light_samples = 1;
subsurface_samples = 1;
volume_samples = 1;
sample_all_lights_direct = true;
sample_all_lights_indirect = true;
method = PATH;
sampling_pattern = SAMPLING_PATTERN_SOBOL;

View File

@@ -153,81 +153,83 @@ void Scene::device_update(Device *device_, Progress& progress)
progress.set_status("Updating Shaders");
shader_manager->device_update(device, &dscene, this, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Images");
image_manager->device_update(device, &dscene, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Background");
background->device_update(device, &dscene, this);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Objects");
object_manager->device_update(device, &dscene, this, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Meshes");
mesh_manager->device_update(device, &dscene, this, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Objects Flags");
object_manager->device_update_flags(device, &dscene, this, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Hair Systems");
curve_system_manager->device_update(device, &dscene, this, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Lookup Tables");
lookup_tables->device_update(device, &dscene);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
/* TODO(sergey): Make sure camera is not needed above. */
progress.set_status("Updating Camera");
camera->device_update(device, &dscene, this);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Lights");
light_manager->device_update(device, &dscene, this, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Particle Systems");
particle_system_manager->device_update(device, &dscene, this, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Film");
film->device_update(device, &dscene, this);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Integrator");
integrator->device_update(device, &dscene, this);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Lookup Tables");
lookup_tables->device_update(device, &dscene);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Baking");
bake_manager->device_update(device, &dscene, this, progress);
if(progress.get_cancel()) return;
if(progress.get_cancel() || device->have_error()) return;
progress.set_status("Updating Device", "Writing constant memory");
device->const_copy_to("__data", &dscene.data, sizeof(dscene.data));
if(device->have_error() == false) {
progress.set_status("Updating Device", "Writing constant memory");
device->const_copy_to("__data", &dscene.data, sizeof(dscene.data));
}
}
Scene::MotionType Scene::need_motion(bool advanced_shading)

View File

@@ -251,7 +251,7 @@ void Session::run_gpu()
update_scene();
if(!device->error_message().empty())
progress.set_cancel(device->error_message());
progress.set_error(device->error_message());
if(progress.get_cancel())
break;
@@ -292,7 +292,7 @@ void Session::run_gpu()
}
if(!device->error_message().empty())
progress.set_cancel(device->error_message());
progress.set_error(device->error_message());
tiles_written = update_progressive_refine(progress.get_cancel());
@@ -540,7 +540,7 @@ void Session::run_cpu()
update_scene();
if(!device->error_message().empty())
progress.set_cancel(device->error_message());
progress.set_error(device->error_message());
if(progress.get_cancel())
break;
@@ -558,7 +558,7 @@ void Session::run_cpu()
need_tonemap = true;
if(!device->error_message().empty())
progress.set_cancel(device->error_message());
progress.set_error(device->error_message());
}
device->task_wait();
@@ -580,7 +580,7 @@ void Session::run_cpu()
}
if(!device->error_message().empty())
progress.set_cancel(device->error_message());
progress.set_error(device->error_message());
tiles_written = update_progressive_refine(progress.get_cancel());
}
@@ -604,7 +604,7 @@ void Session::load_kernels()
if(message.empty())
message = "Failed loading render kernel, see console for errors";
progress.set_cancel(message);
progress.set_error(message);
progress.set_status("Error", message);
progress.set_update();
return;

View File

@@ -19,7 +19,7 @@
#ifdef WITH_OSL
# if defined(_MSC_VER)
/* Prevent OSL from pollyting the context with weird macroses from windows.h.
/* Prevent OSL from polluting the context with weird macros from windows.h.
* TODO(sergey): Ideally it's only enough to have class/struct declarations in
* the header and skip header include here.
*/

View File

@@ -130,6 +130,9 @@
/* MinGW64 has conflicting declarations for these SSE headers in <windows.h>.
* Since we can't avoid including <windows.h>, better only include that */
#define NOGDI
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif

View File

@@ -46,6 +46,8 @@ public:
update_cb = NULL;
cancel = false;
cancel_message = "";
error = false;
error_message = "";
cancel_cb = NULL;
}
@@ -79,6 +81,8 @@ public:
sync_substatus = "";
cancel = false;
cancel_message = "";
error = false;
error_message = "";
}
/* cancel */
@@ -108,6 +112,28 @@ public:
cancel_cb = function;
}
/* error */
void set_error(const string& error_message_)
{
thread_scoped_lock lock(progress_mutex);
error_message = error_message_;
error = true;
/* If error happens we also stop rendering. */
cancel_message = error_message_;
cancel = true;
}
bool get_error()
{
return error;
}
string get_error_message()
{
thread_scoped_lock lock(progress_mutex);
return error_message;
}
/* tile and timing information */
void set_start_time(double start_time_)
@@ -259,6 +285,9 @@ protected:
volatile bool cancel;
string cancel_message;
volatile bool error;
string error_message;
};
CCL_NAMESPACE_END

View File

@@ -285,11 +285,11 @@ elseif(WIN32)
list(APPEND SRC
intern/GHOST_ImeWin32.cpp
intern/GHOST_ImeWin32.h
)
endif()
if(WITH_INPUT_NDOF)
list(APPEND SRC
intern/GHOST_NDOFManagerWin32.cpp

View File

@@ -906,8 +906,8 @@ extern float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle);
* \param w Requested width of the rectangle
* \param h Requested height of the rectangle
* \param complete Whether or not to complete the ongoing composition
* true: Start a new composition
* false: Move the IME windows to the given position without finishing it.
* true: Start a new composition
* false: Move the IME windows to the given position without finishing it.
*/
extern void GHOST_BeginIME(GHOST_WindowHandle windowhandle,
GHOST_TInt32 x,

View File

@@ -340,14 +340,13 @@ public:
* \param w Requested width of the rectangle
* \param h Requested height of the rectangle
* \param complete Whether or not to complete the ongoing composition
* true: Start a new composition
* false: Move the IME windows to the given position without finishing it.
* true: Start a new composition
* false: Move the IME windows to the given position without finishing it.
*/
virtual void beginIME(GHOST_TInt32 x,
GHOST_TInt32 y,
GHOST_TInt32 w,
GHOST_TInt32 h,
int completed) = 0;
virtual void beginIME(
GHOST_TInt32 x, GHOST_TInt32 y,
GHOST_TInt32 w, GHOST_TInt32 h,
int completed) = 0;
/**
* Disable the IME attached to the given window, i.e. prohibits any user-input

View File

@@ -1,401 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (c) 2010 The Chromium Authors. All rights reserved.
* All rights reserved.
*
* The Original Code is: some of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file ghost/intern/GHOST_ImeWin32.h
* \ingroup GHOST
*/
#ifndef __GHOST_IME_H__
#define __GHOST_IME_H__
#include <windows.h>
#include <string>
#include "GHOST_Event.h"
#include "GHOST_Rect.h"
#include <vector>
class GHOST_EventIME : public GHOST_Event
{
public:
/**
* Constructor.
* \param msec The time this event was generated.
* \param type The type of key event.
* \param key The key code of the key.
*/
GHOST_EventIME(GHOST_TUns64 msec,
GHOST_TEventType type,
GHOST_IWindow *window, void *customdata)
: GHOST_Event(msec, type, window)
{
this->m_data = customdata;
}
};
/**
* This header file defines a struct and a class used for encapsulating IMM32
* APIs, controls IMEs attached to a window, and enables the 'on-the-spot'
* input without deep knowledge about the APIs, i.e. knowledge about the
* language-specific and IME-specific behaviors.
* The following items enumerates the simplest steps for an (window)
* application to control its IMEs with the struct and the class defined
* this file.
* 1. Add an instance of the GHOST_ImeWin32 class to its window class.
* (The GHOST_ImeWin32 class needs a window handle.)
* 2. Add messages handlers listed in the following subsections, follow the
* instructions written in each subsection, and use the GHOST_ImeWin32 class.
* 2.1. WM_IME_SETCONTEXT (0x0281)
* Call the functions listed below:
* - GHOST_ImeWin32::CreateImeWindow();
* - GHOST_ImeWin32::CleanupComposition(), and;
* - GHOST_ImeWin32::SetImeWindowStyle().
* An application MUST prevent from calling ::DefWindowProc().
* 2.2. WM_IME_STARTCOMPOSITION (0x010D)
* Call the functions listed below:
* - GHOST_ImeWin32::CreateImeWindow(), and;
* - GHOST_ImeWin32::ResetComposition().
* An application MUST prevent from calling ::DefWindowProc().
* 2.3. WM_IME_COMPOSITION (0x010F)
* Call the functions listed below:
* - GHOST_ImeWin32::UpdateImeWindow();
* - GHOST_ImeWin32::GetResult();
* - GHOST_ImeWin32::GetComposition(), and;
* - GHOST_ImeWin32::ResetComposition() (optional).
* An application MUST prevent from calling ::DefWindowProc().
* 2.4. WM_IME_ENDCOMPOSITION (0x010E)
* Call the functions listed below:
* - GHOST_ImeWin32::ResetComposition(), and;
* - GHOST_ImeWin32::DestroyImeWindow().
* An application CAN call ::DefWindowProc().
* 2.5. WM_INPUTLANGCHANGE (0x0051)
* Call the functions listed below:
* - GHOST_ImeWin32::SetInputLanguage().
* An application CAN call ::DefWindowProc().
*/
/* This struct represents the status of an ongoing composition. */
struct ImeComposition {
/* Represents the cursor position in the IME composition. */
int cursor_position;
/* Represents the position of the beginning of the selection */
int target_start;
/* Represents the position of the end of the selection */
int target_end;
/**
* Represents the type of the string in the 'ime_string' parameter.
* Its possible values and description are listed bwlow:
* Value Description
* 0 The parameter is not used.
* GCS_RESULTSTR The parameter represents a result string.
* GCS_COMPSTR The parameter represents a composition string.
*/
int string_type;
/* Represents the string retrieved from IME (Input Method Editor) */
std::wstring ime_string;
std::vector<char> utf8_buf;
std::vector<unsigned char> format;
};
/**
* This class controls the IMM (Input Method Manager) through IMM32 APIs and
* enables it to retrieve the string being controled by the IMM. (I wrote
* a note to describe the reason why I do not use 'IME' but 'IMM' below.)
* NOTE(hbono):
* Fortunately or unfortunately, TSF (Text Service Framework) and
* CUAS (Cicero Unaware Application Support) allows IMM32 APIs for
* retrieving not only the inputs from IMEs (Input Method Editors), used
* only for inputting East-Asian language texts, but also the ones from
* tablets (on Windows XP Tablet PC Edition and Windows Vista), voice
* recognizers (e.g. ViaVoice and Microsoft Office), etc.
* We can disable TSF and CUAS in Windows XP Tablet PC Edition. On the other
* hand, we can NEVER disable either TSF or CUAS in Windows Vista, i.e.
* THIS CLASS IS NOT ONLY USED ON THE INPUT CONTEXTS OF EAST-ASIAN
* LANGUAGES BUT ALSO USED ON THE INPUT CONTEXTS OF ALL LANGUAGES.
*/
class GHOST_ImeWin32 {
public:
GHOST_ImeWin32();
~GHOST_ImeWin32();
/* Retrieves whether or not there is an ongoing composition. */
bool is_composing() const { return is_composing_; }
/**
* Retrieves the input language from Windows and update it.
* Return values
* * true
* The given input language has IMEs.
* * false
* The given input language does not have IMEs.
*/
bool SetInputLanguage();
/**
* Create the IME windows, and allocate required resources for them.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
*/
void CreateImeWindow(HWND window_handle);
/**
* Update the style of the IME windows.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
* * message [in] (UINT)
* * wparam [in] (WPARAM)
* * lparam [in] (LPARAM)
* Represent the windows message of the caller.
* These parameters are used for verifying if this function is called
* in a handler function for WM_IME_SETCONTEXT messages because this
* function uses ::DefWindowProc() to update the style.
* A caller just has to pass the input parameters for the handler
* function without modifications.
* * handled [out] (BOOL*)
* Returns ::DefWindowProc() is really called in this function.
* PLEASE DO NOT CALL ::DefWindowProc() IF THIS VALUE IS TRUE!
* All the window styles set in this function are over-written when
* calling ::DefWindowProc() after returning this function.
*/
void SetImeWindowStyle(HWND window_handle, UINT message,
WPARAM wparam, LPARAM lparam, BOOL* handled);
/**
* Destroy the IME windows and all the resources attached to them.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
*/
void DestroyImeWindow(HWND window_handle);
/**
* Update the position of the IME windows.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
*/
void UpdateImeWindow(HWND window_handle);
/**
* Clean up the all resources attached to the given GHOST_ImeWin32 object, and
* reset its composition status.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
*/
void CleanupComposition(HWND window_handle);
/**
* Reset the composition status.
* Cancel the ongoing composition if it exists.
* NOTE(hbono): This method does not release the allocated resources.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
*/
void ResetComposition(HWND window_handle);
/**
* Retrieve a composition result of the ongoing composition if it exists.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
* * lparam [in] (LPARAM)
* Specifies the updated members of the ongoing composition, and must be
* the same parameter of a WM_IME_COMPOSITION message handler.
* This parameter is used for checking if the ongoing composition has
* its result string,
* * composition [out] (ImeComposition)
* Represents the struct contains the composition result.
* Return values
* * true
* The ongoing composition has a composition result.
* * false
* The ongoing composition does not have composition results.
* Remarks
* This function is designed for being called from WM_IME_COMPOSITION
* message handlers.
*/
bool GetResult(HWND window_handle, LPARAM lparam,
ImeComposition* composition);
/**
* Retrieve the current composition status of the ongoing composition.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
* * lparam [in] (LPARAM)
* Specifies the updated members of the ongoing composition, and must be
* the same parameter of a WM_IME_COMPOSITION message handler.
* This parameter is used for checking if the ongoing composition has
* its result string,
* * composition [out] (ImeComposition)
* Represents the struct contains the composition status.
* Return values
* * true
* The status of the ongoing composition is updated.
* * false
* The status of the ongoing composition is not updated.
* Remarks
* This function is designed for being called from WM_IME_COMPOSITION
* message handlers.
*/
bool GetComposition(HWND window_handle, LPARAM lparam,
ImeComposition* composition);
/**
* Enable the IME attached to the given window, i.e. allows user-input
* events to be dispatched to the IME.
* In Chrome, this function is used when:
* * a renderer process moves its input focus to another edit control, or;
* * a renrerer process moves the position of the focused edit control.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
* * caret_rect [in] (const gfx::Rect&)
* Represent the rectangle of the input caret.
* This rectangle is used for controlling the positions of IME windows.
* * complete [in] (bool)
* Represents whether or not to complete the ongoing composition.
* + true
* After finishing the ongoing composition and close its IME windows,
* start another composition and display its IME windows to the given
* position.
* + false
* Just move the IME windows of the ongoing composition to the given
* position without finishing it.
*/
void EnableIME(HWND window_handle,
const GHOST_Rect& caret_rect,
bool complete);
/**
* Disable the IME attached to the given window, i.e. prohibits any user-input
* events from being dispatched to the IME.
* In Chrome, this function is used when:
* * a renreder process sets its input focus to a password input.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.
*/
void DisableIME(HWND window_handle);
/* Updatg resultInfo and compInfo */
void UpdateInfo(HWND window_handle);
/* disable ime when start up */
void CheckFirst(HWND window_handle);
ImeComposition resultInfo, compInfo;
GHOST_TEventImeData eventImeData;
protected:
/* Determines whether or not the given attribute represents a target (a.k.a. a selection). */
bool IsTargetAttribute(char attribute) const {
return (attribute == ATTR_TARGET_CONVERTED ||
attribute == ATTR_TARGET_NOTCONVERTED);
}
/* Retrieve the target area. */
void GetCaret(HIMC imm_context, LPARAM lparam,
ImeComposition* composition);
/* Update the position of the IME windows. */
void MoveImeWindow(HWND window_handle, HIMC imm_context);
/* Complete the ongoing composition if it exists. */
void CompleteComposition(HWND window_handle, HIMC imm_context);
/* Retrieve a string from the IMM. */
bool GetString(HIMC imm_context, WPARAM lparam, int type,
ImeComposition* composition);
private:
/**
* Represents whether or not there is an ongoing composition in a browser
* process, i.e. whether or not a browser process is composing a text.
*/
bool is_composing_;
/**
* This value represents whether or not the current input context has IMEs.
* The following table shows the list of IME status:
* Value Description
* false The current input language does not have IMEs.
* true The current input language has IMEs.
*/
bool ime_status_;
/**
* The current input Language ID retrieved from Windows, which consists of:
* * Primary Language ID (bit 0 to bit 9), which shows a natunal language
* (English, Korean, Chinese, Japanese, etc.) and;
* * Sub-Language ID (bit 10 to bit 15), which shows a geometrical region
* the language is spoken (For English, United States, United Kingdom,
* Australia, Canada, etc.)
* The following list enumerates some examples for the Language ID:
* * "en-US" (0x0409)
* MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
* * "ko-KR" (0x0412)
* MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN);
* * "zh-TW" (0x0404)
* MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL);
* * "zh-CN" (0x0804)
* MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED);
* * "ja-JP" (0x0411)
* MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN), etc.
* (See <winnt.h> for other available values.)
* This Language ID is used for processing language-specific operations in
* IME functions.
*/
LANGID input_language_id_;
/**
* Represents whether or not the current input context has created a system
* caret to set the position of its IME candidate window.
* * true: it creates a system caret.
* * false: it does not create a system caret.
*/
bool system_caret_;
/* The rectangle of the input caret retrieved from a renderer process. */
GHOST_Rect caret_rect_;
/* used for disable ime when start up */
bool is_first, is_enable;
};
#endif * __GHOST_IME_H__

View File

@@ -443,7 +443,7 @@ typedef struct {
/** similar to wmImeData */
typedef struct {
/** size_t */
GHOST_TUserDataPtr result_len, composite_len;
GHOST_TUserDataPtr result_len, composite_len;
/** char * utf8 encoding */
GHOST_TUserDataPtr result, composite;
/** Cursor position in the IME composition. */

View File

@@ -154,6 +154,14 @@ if env['BF_GHOST_DEBUG']:
else:
sources.remove('intern' + os.sep + 'GHOST_EventPrinter.cpp')
if env['WITH_BF_IME'] and window_system in ('win32-vc', 'win32-mingw', 'win64-vc', 'win64-mingw'):
defs.append('WITH_INPUT_IME')
elif env['WITH_BF_IME']:
print "IME input is only supported on Windows! Please disable WITH_BF_IME!"
Exit()
else:
sources.remove('intern' + os.sep + 'GHOST_ImeWin32.cpp')
if env['WITH_BF_3DMOUSE']:
defs.append('WITH_INPUT_NDOF')

View File

@@ -918,11 +918,9 @@ float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
#ifdef WITH_INPUT_IME
void GHOST_BeginIME(GHOST_WindowHandle windowhandle,
GHOST_TInt32 x,
GHOST_TInt32 y,
GHOST_TInt32 w,
GHOST_TInt32 h,
int complete)
GHOST_TInt32 x, GHOST_TInt32 y,
GHOST_TInt32 w, GHOST_TInt32 h,
int complete)
{
GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
window->beginIME(x, y, w, h, complete);
@@ -934,4 +932,4 @@ void GHOST_EndIME(GHOST_WindowHandle windowhandle)
window->endIME();
}
#endif /* WITH_INPUT_IME */
#endif /* WITH_INPUT_IME */

View File

@@ -114,7 +114,7 @@ struct ImeComposition {
/**
* Represents the type of the string in the 'ime_string' parameter.
* Its possible values and description are listed bwlow:
* Its possible values and description are listed below:
* Value Description
* 0 The parameter is not used.
* GCS_RESULTSTR The parameter represents a result string.

View File

@@ -146,8 +146,8 @@ static const NDOF_ButtonT SpaceExplorer_HID_map[] = {
NDOF_BUTTON_ROTATE
};
/* this is the older SpacePilot (sans Pro)
* thanks to polosson for info about this device */
// this is the older SpacePilot (sans Pro)
// thanks to polosson for info about this device
static const NDOF_ButtonT SpacePilot_HID_map[] = {
NDOF_BUTTON_1,
NDOF_BUTTON_2,
@@ -190,17 +190,17 @@ static const NDOF_ButtonT Generic_HID_map[] = {
static const int genericButtonCount = sizeof(Generic_HID_map) / sizeof(NDOF_ButtonT);
GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System &sys)
: m_system(sys),
m_deviceType(NDOF_UnknownDevice), /* each platform has its own device detection code */
m_buttonCount(genericButtonCount),
m_buttonMask(0),
m_hidMap(Generic_HID_map),
m_buttons(0),
m_motionTime(0),
m_prevMotionTime(0),
m_motionState(GHOST_kNotStarted),
m_motionEventPending(false),
m_deadZone(0.0f)
: m_system(sys),
m_deviceType(NDOF_UnknownDevice), // each platform has its own device detection code
m_buttonCount(genericButtonCount),
m_buttonMask(0),
m_hidMap(Generic_HID_map),
m_buttons(0),
m_motionTime(0),
m_prevMotionTime(0),
m_motionState(GHOST_kNotStarted),
m_motionEventPending(false),
m_deadZone(0.0f)
{
// to avoid the rare situation where one triple is updated and
// the other is not, initialize them both here:
@@ -228,7 +228,7 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
// that I don't have access to. Thanks!
switch (vendor_id) {
case 0x046D: // Logitech (3Dconnexion)
case 0x046D: // Logitech (3Dconnexion was a subsidiary)
switch (product_id) {
// -- current devices --
case 0xC626: // full-size SpaceNavigator
@@ -281,6 +281,29 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
printf("ndof: unknown Logitech product %04hx\n", product_id);
}
break;
case 0x256F: // 3Dconnexion
switch (product_id) {
case 0xC62E: // plugged in
case 0xC62F: // wireless
puts("ndof: using SpaceMouse Wireless");
m_deviceType = NDOF_SpaceMouseWireless;
m_buttonCount = 2;
m_hidMap = Modern3Dx_HID_map;
break;
case 0xC631: // plugged in
case 0xC632: // wireless
puts("ndof: using SpaceMouse Pro Wireless");
m_deviceType = NDOF_SpaceMouseProWireless;
m_buttonCount = 27;
// ^^ actually has 15 buttons, but their HID codes range from 0 to 26
m_buttonMask = 0x07C0F137;
m_hidMap = Modern3Dx_HID_map;
break;
default:
printf("ndof: unknown 3Dconnexion product %04hx\n", product_id);
}
break;
default:
printf("ndof: unknown device %04hx:%04hx\n", vendor_id, product_id);
}
@@ -390,9 +413,9 @@ void GHOST_NDOFManager::updateButtons(int button_bits, GHOST_TUns64 time)
void GHOST_NDOFManager::setDeadZone(float dz)
{
if (dz < 0.f) {
if (dz < 0.0f) {
// negative values don't make sense, so clamp at zero
dz = 0.f;
dz = 0.0f;
}
else if (dz > 0.5f) {
// warn the rogue user/developer, but allow it
@@ -405,14 +428,14 @@ void GHOST_NDOFManager::setDeadZone(float dz)
static bool atHomePosition(GHOST_TEventNDOFMotionData *ndof)
{
#define HOME(foo) (ndof->foo == 0.f)
#define HOME(foo) (ndof->foo == 0.0f)
return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
#undef HOME
}
static bool nearHomePosition(GHOST_TEventNDOFMotionData *ndof, float threshold)
{
if (threshold == 0.f) {
if (threshold == 0.0f) {
return atHomePosition(ndof);
}
else {
@@ -442,7 +465,7 @@ bool GHOST_NDOFManager::sendMotionEvent()
// scale axis values here to normalize them to around +/- 1
// they are scaled again for overall sensitivity in the WM based on user prefs
const float scale = 1.f / 350.f; // 3Dconnexion devices send +/- 350 usually
const float scale = 1.0f / 350.0f; // 3Dconnexion devices send +/- 350 usually
data->tx = scale * m_translation[0];
data->ty = scale * m_translation[1];

View File

@@ -20,7 +20,7 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __GHOST_NDOFMANAGER_H__
#define __GHOST_NDOFMANAGER_H__
@@ -38,6 +38,8 @@ typedef enum {
NDOF_SpaceExplorer,
NDOF_SpacePilotPro,
NDOF_SpaceMousePro,
NDOF_SpaceMouseWireless,
NDOF_SpaceMouseProWireless,
// older devices
NDOF_SpacePilot,

View File

@@ -645,6 +645,8 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
m_lionStyleFullScreen = true;
}
[NSApp activateIgnoringOtherApps:YES]; // raise application to front, important for new blender instance animation play case
[pool drain];
}

View File

@@ -40,7 +40,7 @@
#include "GHOST_Window.h"
#include "GHOST_TaskbarWin32.h"
#ifdef WITH_INPUT_IME
#include "GHOST_ImeWin32.h"
# include "GHOST_ImeWin32.h"
#endif
#include <wintab.h>
@@ -259,11 +259,10 @@ public:
#ifdef WITH_INPUT_IME
GHOST_ImeWin32 *getImeInput() {return &m_imeImput;}
virtual void beginIME(GHOST_TInt32 x,
GHOST_TInt32 y,
GHOST_TInt32 w,
GHOST_TInt32 h,
int completed);
virtual void beginIME(
GHOST_TInt32 x, GHOST_TInt32 y,
GHOST_TInt32 w, GHOST_TInt32 h,
int completed);
virtual void endIME();
#endif /* WITH_INPUT_IME */

View File

@@ -483,7 +483,7 @@ void
else lword = sizeof(double);
if ( Glu->MemModel == SYSTEM ) {
new_mem = (void *) SUPERLU_MALLOC(new_len * lword);
new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * (size_t)lword);
/* new_mem = (void *) calloc(new_len, lword); */
if ( no_expand != 0 ) {
tries = 0;
@@ -494,7 +494,7 @@ void
if ( ++tries > 10 ) return (NULL);
alpha = Reduce(alpha);
new_len = alpha * *prev_len;
new_mem = (void *) SUPERLU_MALLOC(new_len * lword);
new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * (size_t)lword);
/* new_mem = (void *) calloc(new_len, lword); */
}
}
@@ -509,7 +509,7 @@ void
} else { /* MemModel == USER */
if ( no_expand == 0 ) {
new_mem = suser_malloc(new_len * lword, HEAD);
new_mem = suser_malloc((size_t)new_len * (size_t)lword, HEAD);
if ( NotDoubleAlign(new_mem) &&
(type == LUSUP || type == UCOL) ) {
old_mem = new_mem;

Binary file not shown.

View File

@@ -38,10 +38,10 @@ __all__ = (
from _bpy import types, props, app, data, context
# python modules
from . import utils, path, ops
from . import utils, path
# fake operator module
ops = ops.ops_fake_module
from .ops import ops_fake_module as ops
def main():

View File

@@ -36,6 +36,7 @@ class BPyOps:
bpy.ops
"""
__slots__ = ()
def __getattr__(self, module):
"""

View File

@@ -99,7 +99,7 @@ def add_object_align_init(context, operator):
return location * rotation
def object_data_add(context, obdata, operator=None, use_active_layer=True):
def object_data_add(context, obdata, operator=None, use_active_layer=True, name=None):
"""
Add an object using the view context and preference to to initialize the
location, rotation and layer.
@@ -110,6 +110,8 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
:type obdata: valid object data type or None.
:arg operator: The operator, checked for location and rotation properties.
:type operator: :class:`bpy.types.Operator`
:arg name: Optional name
:type name: string
:return: the newly created object in the scene.
:rtype: :class:`bpy.types.ObjectBase`
"""
@@ -119,7 +121,10 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
for ob in scene.objects:
ob.select = False
obj_new = bpy.data.objects.new(obdata.name, obdata)
if name is None:
name = "Object" if obdata is None else obdata.name
obj_new = bpy.data.objects.new(name, obdata)
base = scene.objects.link(obj_new)
base.select = True
@@ -150,7 +155,7 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
obj_act.mode == 'EDIT' and
obj_act.type == obj_new.type):
_obdata = bpy.data.meshes.new(obdata.name)
_obdata = bpy.data.meshes.new(name)
obj_act = bpy.data.objects.new(_obdata.name, _obdata)
obj_act.matrix_world = obj_new.matrix_world
scene.objects.link(obj_act)
@@ -169,7 +174,8 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
#scene.objects.active = obj_new
bpy.ops.object.join() # join into the active.
bpy.data.meshes.remove(obdata)
if obdata:
bpy.data.meshes.remove(obdata)
# base is freed, set to active object
base = scene.object_bases.active

View File

@@ -487,6 +487,12 @@ def GetInfoOperatorRNA(bl_rna):
def BuildRNAInfo():
# needed on successive calls to prevent stale data access
for cls in (InfoStructRNA, InfoFunctionRNA, InfoOperatorRNA, InfoPropertyRNA):
cls.global_lookup.clear()
del cls
# Use for faster lookups
# use rna_struct.identifier as the key for each dict
rna_struct_dict = {} # store identifier:rna lookups

View File

@@ -5,7 +5,7 @@
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
emboss="#ffffff05"
widget_emboss="#ffffff05"
axis_x="#dc0000"
axis_y="#00dc00"
axis_z="#0000dc">

View File

@@ -5,7 +5,7 @@
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
emboss="#ffffff05"
widget_emboss="#ffffff05"
axis_x="#dc0000"
axis_y="#00dc00"
axis_z="#0000dc">

View File

@@ -5,7 +5,7 @@
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
emboss="#ffffff05"
widget_emboss="#ffffff05"
axis_x="#dc0000"
axis_y="#00dc00"
axis_z="#0000dc">

View File

@@ -5,7 +5,7 @@
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
emboss="#ffffff05"
widget_emboss="#ffffff05"
axis_x="#dc0000"
axis_y="#00dc00"
axis_z="#0000dc">

View File

@@ -5,7 +5,7 @@
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
emboss="#ffffff05"
widget_emboss="#ffffff05"
axis_x="#dc0000"
axis_y="#00dc00"
axis_z="#0000dc">

View File

@@ -5,7 +5,7 @@
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
emboss="#ffffff05"
widget_emboss="#ffffff05"
axis_x="#dc4800"
axis_y="#73dc00"
axis_z="#00c2ff">

View File

@@ -5,7 +5,7 @@
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
emboss="#ffffff05"
widget_emboss="#ffffff05"
axis_x="#ff5a5a"
axis_y="#58ff58"
axis_z="#6262ff">

View File

@@ -5,7 +5,7 @@
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
emboss="#ffffff05"
widget_emboss="#ffffff05"
axis_x="#dc0000"
axis_y="#00dc00"
axis_z="#0000dc">

View File

@@ -708,6 +708,7 @@ def main(context,
island_margin,
projection_limit,
user_area_weight,
use_aspect
):
global USER_FILL_HOLES
global USER_FILL_HOLES_QUALITY
@@ -720,7 +721,6 @@ def main(context,
global dict_matrix
dict_matrix = {}
# Constants:
# Takes a list of faces that make up a UV island and rotate
# until they optimally fit inside a square.
@@ -992,9 +992,31 @@ def main(context,
print("Smart Projection time: %.2f" % (time.time() - time1))
# Window.DrawProgressBar(0.9, "Smart Projections done, time: %.2f sec" % (time.time() - time1))
# aspect correction is only done in edit mode - and only smart unwrap supports currently
if is_editmode:
bpy.ops.object.mode_set(mode='EDIT')
if use_aspect:
import bmesh
aspect = context.scene.uvedit_aspect(context.active_object)
if aspect[0] > aspect[1]:
aspect[0] = aspect[1]/aspect[0];
aspect[1] = 1.0
else:
aspect[1] = aspect[0]/aspect[1];
aspect[0] = 1.0
bm = bmesh.from_edit_mesh(me)
uv_act = bm.loops.layers.uv.active
faces = [f for f in bm.faces if f.select]
for f in faces:
for l in f.loops:
l[uv_act].uv[0] *= aspect[0]
l[uv_act].uv[1] *= aspect[1]
dict_matrix.clear()
#XXX Window.DrawProgressBar(1.0, "")
@@ -1017,7 +1039,7 @@ def main(context,
]
"""
from bpy.props import FloatProperty
from bpy.props import FloatProperty, BoolProperty
class SmartProject(Operator):
@@ -1046,6 +1068,11 @@ class SmartProject(Operator):
min=0.0, max=1.0,
default=0.0,
)
use_aspect = BoolProperty(
name="Correct Aspect",
description="Map UVs taking image aspect ratio into account",
default=True
)
@classmethod
def poll(cls, context):
@@ -1056,6 +1083,7 @@ class SmartProject(Operator):
self.island_margin,
self.angle_limit,
self.user_area_weight,
self.use_aspect
)
return {'FINISHED'}

View File

@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Menu, UIList
@@ -38,7 +37,7 @@ def gpencil_stroke_placement_settings(context, layout, gpd):
row.prop_enum(gpd, "draw_mode", 'STROKE')
row = col.row(align=False)
row.active = gpd.draw_mode in ('SURFACE', 'STROKE')
row.active = gpd.draw_mode in {'SURFACE', 'STROKE'}
row.prop(gpd, "use_stroke_endpoints")
@@ -64,16 +63,23 @@ class GreasePencilDrawingToolsPanel():
row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
row = col.row(align=True)
row.prop(context.tool_settings, "use_grease_pencil_sessions", text="Continuous Drawing")
if context.space_data.type in {'VIEW_3D', 'CLIP_EDITOR'}:
col.separator()
col.label("Data Source:")
row = col.row(align=True)
if context.space_data.type == 'VIEW_3D':
row.prop(context.tool_settings, "grease_pencil_source", expand=True)
elif context.space_data.type == 'CLIP_EDITOR':
row.prop(context.space_data, "grease_pencil_source", expand=True)
gpd = context.gpencil_data
if gpd:
col.separator()
gpencil_stroke_placement_settings(context, col, gpd)
if context.space_data.type == 'VIEW_3D':
col.separator()
col.separator()
@@ -228,7 +234,7 @@ class GPENCIL_PIE_settings_palette(Menu):
layout = self.layout
pie = layout.menu_pie()
gpd = context.gpencil_data
# gpd = context.gpencil_data
gpl = context.active_gpencil_layer
# W - Stroke draw settings
@@ -246,7 +252,7 @@ class GPENCIL_PIE_settings_palette(Menu):
# S - Layer settings
col = pie.column()
col.prop(gpl, "line_width", slider=True)
#col.prop(gpl, "use_volumetric_strokes")
# col.prop(gpl, "use_volumetric_strokes")
col.prop(gpl, "use_onion_skinning")
# N - Active Layer
@@ -254,12 +260,12 @@ class GPENCIL_PIE_settings_palette(Menu):
col = pie.column()
col.label("Active Layer: ")
col.prop(gpl, "info", text="")
#col.prop(gpd, "layers")
# col.prop(gpd, "layers")
row = col.row()
row.prop(gpl, "lock")
row.prop(gpl, "hide")
class GPENCIL_PIE_tools_more(Menu):
"""A pie menu for accessing more Grease Pencil tools"""
bl_label = "More Grease Pencil Tools"
@@ -273,20 +279,19 @@ class GPENCIL_PIE_tools_more(Menu):
layout = self.layout
pie = layout.menu_pie()
gpd = context.gpencil_data
# gpd = context.gpencil_data
pie.operator("gpencil.select_more", icon='ZOOMIN')
pie.operator("gpencil.select_less", icon='ZOOMOUT')
pie.operator("transform.mirror", icon='MOD_MIRROR').gpencil_strokes = True
pie.operator("transform.bend", icon='MOD_SIMPLEDEFORM').gpencil_strokes = True
pie.operator("transform.shear", icon='MOD_TRIANGULATE').gpencil_strokes = True
pie.operator("transform.tosphere", icon='MOD_MULTIRES').gpencil_strokes = True
pie.operator("gpencil.convert", icon='OUTLINER_OB_CURVE')
pie.operator("wm.call_menu_pie", text="Back to Main Palette...").name = "GPENCIL_PIE_tool_palette"
###############################
class GPENCIL_UL_layer(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
@@ -328,8 +333,9 @@ class GreasePencilDataPanel():
gpd = context.gpencil_data
# Owner Selector
# XXX: add this for 3D view too
if context.space_data.type == 'CLIP_EDITOR':
if context.space_data.type == 'VIEW_3D':
layout.prop(context.tool_settings, "grease_pencil_source", expand=True)
elif context.space_data.type == 'CLIP_EDITOR':
layout.prop(context.space_data, "grease_pencil_source", expand=True)
# Grease Pencil data selector
@@ -390,8 +396,8 @@ class GreasePencilDataPanel():
col = split.column(align=True)
col.prop(gpl, "show_x_ray")
#if debug:
# layout.prop(gpl, "show_points")
# if debug:
# layout.prop(gpl, "show_points")
layout.separator()
@@ -417,7 +423,7 @@ class GreasePencilDataPanel():
row.prop(gpl, "use_onion_skinning")
row.prop(gpl, "use_ghost_custom_colors", text="", icon='COLOR')
split = col.split(percentage = 0.5)
split = col.split(percentage=0.5)
split.active = gpl.use_onion_skinning
# - Before Frames
@@ -427,7 +433,6 @@ class GreasePencilDataPanel():
row.prop(gpl, "before_color", text="")
sub.prop(gpl, "ghost_before_range", text="Before")
# - After Frames
sub = split.column(align=True)
row = sub.row(align=True)
@@ -451,7 +456,7 @@ class GreasePencilToolsPanel():
def draw(self, context):
layout = self.layout
gpd_owner = context.gpencil_data_owner
# gpd_owner = context.gpencil_data_owner
gpd = context.gpencil_data
layout.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)

View File

@@ -279,7 +279,7 @@ class INFO_MT_help(Menu):
def draw(self, context):
layout = self.layout
layout.operator("wm.url_open", text="Manual", icon='HELP').url = "http://wiki.blender.org/index.php/Doc:2.6/Manual"
layout.operator("wm.url_open", text="Manual", icon='HELP').url = "http://www.blender.org/manual"
layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/%d.%d" % bpy.app.version[:2]
layout.separator()

View File

@@ -72,7 +72,6 @@ class SEQUENCER_HT_header(Header):
row.prop(scene, "lock_frame_selection_to_range", text="", toggle=True)
layout.prop(st, "view_type", expand=True, text="")
layout.prop(st, "waveform_draw_type", text="")
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
layout.prop(st, "display_mode", expand=True, text="")
@@ -163,8 +162,10 @@ class SEQUENCER_MT_view(Menu):
layout = self.layout
st = context.space_data
is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
is_sequencer_view = st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}
if st.view_type in {'PREVIEW'}:
if st.view_type == 'PREVIEW':
# Specifying the REGION_PREVIEW context is needed in preview-only
# mode, else the lookup for the shortcut will fail in
# wm_keymap_item_find_props() (see #32595).
@@ -174,10 +175,10 @@ class SEQUENCER_MT_view(Menu):
layout.separator()
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
if is_sequencer_view:
layout.operator("sequencer.view_all", text="View all Sequences")
layout.operator("sequencer.view_selected")
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
if is_preview:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("sequencer.view_all_preview", text="Fit preview in window")
@@ -195,11 +196,14 @@ class SEQUENCER_MT_view(Menu):
# # XXX, invokes in the header view
# layout.operator("sequencer.view_ghost_border", text="Overlay Border")
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
if is_sequencer_view:
layout.prop(st, "show_seconds")
layout.prop(st, "show_frame_indicator")
layout.prop(st, "show_strip_offset")
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
layout.prop_menu_enum(st, "waveform_draw_type")
if is_preview:
if st.display_mode == 'IMAGE':
layout.prop(st, "show_safe_margin")
elif st.display_mode == 'WAVEFORM':
@@ -207,7 +211,7 @@ class SEQUENCER_MT_view(Menu):
layout.separator()
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
if is_sequencer_view:
layout.prop(st, "use_marker_sync")
layout.separator()
@@ -793,6 +797,8 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
layout.label(text="Camera Override")
layout.template_ID(strip, "scene_camera")
layout.prop(strip, "use_grease_pencil", text="Show Grease Pencil")
if scene:
layout.prop(scene, "audio_volume", text="Audio Volume")

View File

@@ -776,7 +776,7 @@ class USERPREF_PT_theme(Panel):
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "emboss")
colsub.row().prop(ui, "widget_emboss")
col.separator()
col.separator()

View File

@@ -57,7 +57,7 @@
<p class="p5"><span class="s3">General information <a href="http://www.blender.org/"><span class="s4">www.blender.org</span></a> <br>
Full release log <a href="http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.73"><span class="s4">wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.73</span></a><br>
Tutorials <a href="http://www.blender.org/support/tutorials/"><span class="s4">www.blender.org/support/tutorials/</span></a> <br>
Manual <a href="http://wiki.blender.org/index.php/Doc:2.6/Manual"><span class="s4">wiki.blender.org/index.php/Doc:2.6/Manual</span></a><br>
Manual <a href="http://www.blender.org/manual"><span class="s4">www.blender.org/manual</span></a><br>
User Forum <a href="http://www.blenderartists.org/"><span class="s4">www.blenderartists.org</span></a><br>
IRC <a href="irc://irc.freenode.net/#blenderchat"><span class="s4">#blenderchat</span></a> or <a href="irc://irc.freenode.net/#blender"><span class="s4">#blender</span></a> on irc.freenode.net</span></p>
<p class="p4">Developers:</p>

View File

@@ -163,6 +163,8 @@ const char *BLF_translate_do_new_dataname(const char *msgctxt, const char *msgid
#define BLF_I18NCONTEXT_ID_MESH "Mesh"
#define BLF_I18NCONTEXT_ID_NODETREE "NodeTree"
#define BLF_I18NCONTEXT_ID_OBJECT "Object"
#define BLF_I18NCONTEXT_ID_PAINTCURVE "PaintCurve"
#define BLF_I18NCONTEXT_ID_PALETTE "Palette"
#define BLF_I18NCONTEXT_ID_PARTICLESETTINGS "ParticleSettings"
#define BLF_I18NCONTEXT_ID_SCENE "Scene"
#define BLF_I18NCONTEXT_ID_SCREEN "Screen"
@@ -207,11 +209,15 @@ typedef struct
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LAMP, "id_lamp"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LIBRARY, "id_library"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LATTICE, "id_lattice"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MASK, "id_mask"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MATERIAL, "id_material"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_METABALL, "id_metaball"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MESH, "id_mesh"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MOVIECLIP, "id_movieclip"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_NODETREE, "id_nodetree"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_OBJECT, "id_object"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_PAINTCURVE, "id_paintcurve"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_PALETTE, "id_palette"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_PARTICLESETTINGS, "id_particlesettings"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SCENE, "id_scene"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SCREEN, "id_screen"), \
@@ -223,8 +229,6 @@ typedef struct
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_VFONT, "id_vfont"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_WORLD, "id_world"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_WINDOWMANAGER, "id_windowmanager"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MOVIECLIP, "id_movieclip"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MASK, "id_mask"), \
{NULL, NULL, NULL} \
}

View File

@@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 272
#define BLENDER_SUBVERSION 2
#define BLENDER_SUBVERSION 3
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
#define BLENDER_MINVERSION 270
#define BLENDER_MINSUBVERSION 5

View File

@@ -41,13 +41,13 @@ typedef union IDPropertyTemplate {
double d;
struct {
char *str;
short len;
int len;
char subtype;
} string;
struct ID *id;
struct {
short type;
short len;
int len;
char type;
} array;
struct {
int matvec_size;
@@ -110,7 +110,7 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
bool IDP_EqualsProperties(struct IDProperty *prop1, struct IDProperty *prop2) ATTR_WARN_UNUSED_RESULT;
struct IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
struct IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void IDP_FreeProperty(struct IDProperty *prop);

View File

@@ -36,6 +36,7 @@
extern "C" {
#endif
struct bNodeTreeExecPool;
struct Main;
struct Material;
struct ID;
@@ -96,10 +97,16 @@ struct Material *BKE_material_pop_id(struct ID *id, int index, bool update_data)
void BKE_material_clear_id(struct ID *id, bool update_data);
/* rendering */
void init_render_material(struct Material *, int, float *);
void init_render_materials(struct Main *, int, float *);
void end_render_material(struct Material *);
void end_render_materials(struct Main *);
void init_render_material(struct Material *mat,
struct bNodeTreeExecPool *exec_tree_pool,
int render_mode, float *amb);
void init_render_materials(struct Main *bmain,
struct bNodeTreeExecPool *exec_tree_pool,
int render_mode, float *amb);
void end_render_material(struct bNodeTreeExecPool *exec_tree_pool,
struct Material *mat);
void end_render_materials(struct Main *bmain,
struct bNodeTreeExecPool *exec_tree_pool);
bool material_in_material(struct Material *parmat, struct Material *mat);

View File

@@ -46,6 +46,7 @@ void BKE_movieclip_unlink(struct Main *bmain, struct MovieClip *clip);
struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name);
void BKE_movieclip_reload(struct MovieClip *clip);
void BKE_movieclip_clear_cache(struct MovieClip *clip);
void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip);
struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struct MovieClipUser *user, int postprocess_flag);

View File

@@ -84,6 +84,7 @@ struct ColorManagedViewSettings;
struct ColorManagedDisplaySettings;
struct bNodeInstanceHash;
typedef struct bNodeTreeExecPool bNodeTreeExecPool;
/* ************** NODE TYPE DEFINITIONS ***** */
@@ -773,7 +774,7 @@ struct ShadeResult;
struct bNodeTreeExec *ntreeShaderBeginExecTree(struct bNodeTree *ntree);
void ntreeShaderEndExecTree(struct bNodeTreeExec *exec);
bool ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
bool ntreeShaderExecTree(bNodeTreeExecPool *exec_tree_pool, struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
void ntreeShaderGetTexcoMode(struct bNodeTree *ntree, int osa, short *texco, int *mode);
/* switch material render loop */
@@ -999,13 +1000,24 @@ struct TexResult;
int ntreeTexTagAnimated(struct bNodeTree *ntree);
void ntreeTexCheckCyclics(struct bNodeTree *ntree);
struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree);
struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree) ATTR_WARN_UNUSED_RESULT;
void ntreeTexEndExecTree(struct bNodeTreeExec *exec);
int ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target,
int ntreeTexExecTree(bNodeTreeExecPool *pool,
struct bNodeTree *ntree, struct TexResult *target,
float coord[3], float dxt[3], float dyt[3], int osatex, const short thread,
struct Tex *tex, short which_output, int cfra, int preview, struct ShadeInput *shi, struct MTex *mtex);
bNodeTreeExecPool *BKE_node_tree_exec_pool_new(void);
void BKE_node_tree_exec_pool_free(bNodeTreeExecPool *pool);
void BKE_node_tree_exec_pool_put(bNodeTreeExecPool *pool,
struct ID *id,
void *data);
void *BKE_node_tree_exec_pool_get(bNodeTreeExecPool *pool,
struct ID *id);
void *BKE_node_tree_exec_pool_pop(bNodeTreeExecPool *pool,
struct ID *id);
/*************************************************/
void init_nodesystem(void);

View File

@@ -393,7 +393,7 @@ struct Sequence *BKE_sequencer_add_sound_strip(struct bContext *C, ListBase *seq
struct Sequence *BKE_sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
/* view3d draw callback, run when not in background view */
typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, struct Object *, int, int, unsigned int, int, bool, bool, int, char[256]);
typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, struct Object *, int, int, unsigned int, int, bool, bool, bool, int, char[256]);
extern SequencerDrawView sequencer_view3d_cb;
/* copy/paste */

View File

@@ -277,6 +277,13 @@ set(SRC
intern/pbvh_intern.h
)
if(WITH_BINRELOC)
list(APPEND INC_SYS
${BINRELOC_INCLUDE_DIRS}
)
add_definitions(-DWITH_BINRELOC)
endif()
add_definitions(${GL_DEFINITIONS})
if(WIN32)

View File

@@ -170,6 +170,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', '
incs += ' ' + env['BF_PTHREADS_INC']
incs += ' ../../../intern/utfconv'
if env['WITH_BF_BINRELOC']:
incs += ' #extern/binreloc/include'
defs.append('WITH_BINRELOC')
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [166,25]) #, cc_compileflags = env['CCFLAGS'].append('/WX') )

View File

@@ -172,29 +172,19 @@ static void *_ehash_lookup(EHash *eh, void *key)
/**/
typedef struct _EHashIterator {
EHash *eh;
int curBucket;
EHEntry *curEntry;
} EHashIterator;
static EHashIterator *_ehashIterator_new(EHash *eh)
static void _ehashIterator_init(EHash *eh, EHashIterator *ehi)
{
EHashIterator *ehi = EHASH_alloc(eh, sizeof(*ehi));
/* fill all members */
ehi->eh = eh;
ehi->curEntry = NULL;
ehi->curBucket = -1;
ehi->curEntry = NULL;
while (!ehi->curEntry) {
ehi->curBucket++;
if (ehi->curBucket == ehi->eh->curSize)
break;
ehi->curEntry = ehi->eh->buckets[ehi->curBucket];
}
return ehi;
}
static void _ehashIterator_free(EHashIterator *ehi)
{
EHASH_free(ehi->eh, ehi);
}
static void *_ehashIterator_getCurrent(EHashIterator *ehi)
@@ -3051,17 +3041,17 @@ void *ccgSubSurf_getFaceGridData(CCGSubSurf *ss, CCGFace *f, int gridIndex, int
/*** External API iterator functions ***/
CCGVertIterator *ccgSubSurf_getVertIterator(CCGSubSurf *ss)
void ccgSubSurf_initVertIterator(CCGSubSurf *ss, CCGVertIterator *viter)
{
return (CCGVertIterator *) _ehashIterator_new(ss->vMap);
_ehashIterator_init(ss->vMap, viter);
}
CCGEdgeIterator *ccgSubSurf_getEdgeIterator(CCGSubSurf *ss)
void ccgSubSurf_initEdgeIterator(CCGSubSurf *ss, CCGEdgeIterator *eiter)
{
return (CCGEdgeIterator *) _ehashIterator_new(ss->eMap);
_ehashIterator_init(ss->eMap, eiter);
}
CCGFaceIterator *ccgSubSurf_getFaceIterator(CCGSubSurf *ss)
void ccgSubSurf_initFaceIterator(CCGSubSurf *ss, CCGFaceIterator *fiter)
{
return (CCGFaceIterator *) _ehashIterator_new(ss->fMap);
_ehashIterator_init(ss->fMap, fiter);
}
CCGVert *ccgVertIterator_getCurrent(CCGVertIterator *vi)
@@ -3076,10 +3066,6 @@ void ccgVertIterator_next(CCGVertIterator *vi)
{
_ehashIterator_next((EHashIterator *) vi);
}
void ccgVertIterator_free(CCGVertIterator *vi)
{
_ehashIterator_free((EHashIterator *) vi);
}
CCGEdge *ccgEdgeIterator_getCurrent(CCGEdgeIterator *vi)
{
@@ -3093,10 +3079,6 @@ void ccgEdgeIterator_next(CCGEdgeIterator *vi)
{
_ehashIterator_next((EHashIterator *) vi);
}
void ccgEdgeIterator_free(CCGEdgeIterator *vi)
{
_ehashIterator_free((EHashIterator *) vi);
}
CCGFace *ccgFaceIterator_getCurrent(CCGFaceIterator *vi)
{
@@ -3110,10 +3092,6 @@ void ccgFaceIterator_next(CCGFaceIterator *vi)
{
_ehashIterator_next((EHashIterator *) vi);
}
void ccgFaceIterator_free(CCGFaceIterator *vi)
{
_ehashIterator_free((EHashIterator *) vi);
}
/*** Extern API final vert/edge/face interface ***/

View File

@@ -53,6 +53,13 @@ typedef struct CCGAllocatorIFC {
void (*release) (CCGAllocatorHDL a);
} CCGAllocatorIFC;
/* private, so we can allocate on the stack */
typedef struct _EHashIterator {
struct _EHash *eh;
int curBucket;
struct _EHEntry *curEntry;
} EHashIterator;
/***/
typedef enum {
@@ -163,27 +170,24 @@ int ccgSubSurf_getNumFinalFaces (const CCGSubSurf *ss);
/***/
typedef struct CCGVertIterator CCGVertIterator;
typedef struct CCGEdgeIterator CCGEdgeIterator;
typedef struct CCGFaceIterator CCGFaceIterator;
typedef struct _EHashIterator CCGVertIterator;
typedef struct _EHashIterator CCGEdgeIterator;
typedef struct _EHashIterator CCGFaceIterator;
CCGVertIterator* ccgSubSurf_getVertIterator (CCGSubSurf *ss);
CCGEdgeIterator* ccgSubSurf_getEdgeIterator (CCGSubSurf *ss);
CCGFaceIterator* ccgSubSurf_getFaceIterator (CCGSubSurf *ss);
void ccgSubSurf_initVertIterator(CCGSubSurf *ss, CCGVertIterator *viter);
void ccgSubSurf_initEdgeIterator(CCGSubSurf *ss, CCGEdgeIterator *eiter);
void ccgSubSurf_initFaceIterator(CCGSubSurf *ss, CCGFaceIterator *fiter);
CCGVert* ccgVertIterator_getCurrent (CCGVertIterator *vi);
int ccgVertIterator_isStopped (CCGVertIterator *vi);
void ccgVertIterator_next (CCGVertIterator *vi);
void ccgVertIterator_free (CCGVertIterator *vi);
CCGEdge* ccgEdgeIterator_getCurrent (CCGEdgeIterator *ei);
int ccgEdgeIterator_isStopped (CCGEdgeIterator *ei);
void ccgEdgeIterator_next (CCGEdgeIterator *ei);
void ccgEdgeIterator_free (CCGEdgeIterator *ei);
CCGFace* ccgFaceIterator_getCurrent (CCGFaceIterator *fi);
int ccgFaceIterator_isStopped (CCGFaceIterator *fi);
void ccgFaceIterator_next (CCGFaceIterator *fi);
void ccgFaceIterator_free (CCGFaceIterator *fi);
#endif /* __CCGSUBSURF_H__ */

View File

@@ -1484,8 +1484,8 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
MultiresModifierData *mmd = get_multires_modifier(scene, ob, 0);
const bool has_multires = (mmd && mmd->sculptlvl != 0);
bool multires_applied = false;
const bool sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt;
const bool sculpt_dyntopo = (sculpt_mode && ob->sculpt->bm);
const bool sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt && !useRenderParams;
const bool sculpt_dyntopo = (sculpt_mode && ob->sculpt->bm) && !useRenderParams;
const int draw_flag = dm_drawflag_calc(scene->toolsettings);
/* Generic preview only in object mode! */

View File

@@ -1654,6 +1654,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
pchanw.next = pchan->next;
pchanw.parent = pchan->parent;
pchanw.child = pchan->child;
pchanw.custom_tx = pchan->custom_tx;
pchanw.mpath = pchan->mpath;
pchan->mpath = NULL;

View File

@@ -454,7 +454,7 @@ void BKE_camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3])
float dummy_drawsize;
const float dummy_scale[3] = {1.0f, 1.0f, 1.0f};
BKE_camera_view_frame_ex(scene, camera, false, 1.0, dummy_scale,
BKE_camera_view_frame_ex(scene, camera, 0.0, true, dummy_scale,
dummy_asp, dummy_shift, &dummy_drawsize, r_vec);
}

View File

@@ -2357,6 +2357,15 @@ void DAG_on_visible_update(Main *bmain, const bool do_time)
ob->recalc |= OB_RECALC_DATA;
lib_id_recalc_tag(bmain, &ob->id);
}
/* This should not be needed here, but in some cases, like after a redo, we can end up with
* a wrong final matrix (see T42472).
* Quoting Sergey, this comes from BKE_object_handle_update_ex, which is calling
* BKE_object_where_is_calc_ex when it shouldn't, but that issue is not easily fixable.
*/
else {
ob->recalc |= OB_RECALC_OB;
lib_id_recalc_tag(bmain, &ob->id);
}
if (ob->proxy && (ob->proxy_group == NULL)) {
ob->proxy->recalc |= OB_RECALC_DATA;
lib_id_recalc_tag(bmain, &ob->id);

View File

@@ -42,10 +42,18 @@
#include "MEM_guardedalloc.h"
#include "BLI_strict_flags.h"
/* IDPropertyTemplate is a union in DNA_ID.h */
/**
* if the new is 'IDP_ARRAY_REALLOC_LIMIT' items less,
* than #IDProperty.totallen, reallocate anyway.
*/
#define IDP_ARRAY_REALLOC_LIMIT 200
/*local size table.*/
static char idp_size_table[] = {
static size_t idp_size_table[] = {
1, /*strings*/
sizeof(int),
sizeof(float),
@@ -158,9 +166,8 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
BLI_assert(prop->type == IDP_IDPARRAY);
/* first check if the array buffer size has room */
/* if newlen is 200 items less than totallen, reallocate anyway */
if (newlen <= prop->totallen) {
if (newlen < prop->len && prop->totallen - newlen < 200) {
if (newlen < prop->len && prop->totallen - newlen < IDP_ARRAY_REALLOC_LIMIT) {
int i;
for (i = newlen; i < prop->len; i++)
@@ -194,7 +201,7 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
*/
newsize = newlen;
newsize = (newsize >> 3) + (newsize < 9 ? 3 : 6) + newsize;
prop->data.pointer = MEM_recallocN(prop->data.pointer, sizeof(IDProperty) * newsize);
prop->data.pointer = MEM_recallocN(prop->data.pointer, sizeof(IDProperty) * (size_t)newsize);
prop->len = newlen;
prop->totallen = newsize;
}
@@ -235,8 +242,7 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
const bool is_grow = newlen >= prop->len;
/* first check if the array buffer size has room */
/* if newlen is 200 chars less than totallen, reallocate anyway */
if (newlen <= prop->totallen && prop->totallen - newlen < 200) {
if (newlen <= prop->totallen && prop->totallen - newlen < IDP_ARRAY_REALLOC_LIMIT) {
idp_resize_group_array(prop, newlen, prop->data.pointer);
prop->len = newlen;
return;
@@ -256,7 +262,8 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
if (is_grow == false)
idp_resize_group_array(prop, newlen, prop->data.pointer);
prop->data.pointer = MEM_recallocN(prop->data.pointer, idp_size_table[(int)prop->subtype] * newsize);
prop->data.pointer = MEM_recallocN(
prop->data.pointer, idp_size_table[(int)prop->subtype] * (size_t)newsize);
if (is_grow == true)
idp_resize_group_array(prop, newlen, prop->data.pointer);
@@ -336,14 +343,14 @@ IDProperty *IDP_NewString(const char *st, const char *name, int maxlen)
}
else {
/* include null terminator '\0' */
int stlen = strlen(st) + 1;
int stlen = (int)strlen(st) + 1;
if (maxlen > 0 && maxlen < stlen)
stlen = maxlen;
prop->data.pointer = MEM_mallocN(stlen, "id property string 2");
prop->data.pointer = MEM_mallocN((size_t)stlen, "id property string 2");
prop->len = prop->totallen = stlen;
BLI_strncpy(prop->data.pointer, st, stlen);
BLI_strncpy(prop->data.pointer, st, (size_t)stlen);
}
prop->type = IDP_STRING;
@@ -374,18 +381,18 @@ void IDP_AssignString(IDProperty *prop, const char *st, int maxlen)
int stlen;
BLI_assert(prop->type == IDP_STRING);
stlen = strlen(st);
stlen = (int)strlen(st);
if (maxlen > 0 && maxlen < stlen)
stlen = maxlen;
if (prop->subtype == IDP_STRING_SUB_BYTE) {
IDP_ResizeArray(prop, stlen);
memcpy(prop->data.pointer, st, stlen);
memcpy(prop->data.pointer, st, (size_t)stlen);
}
else {
stlen++;
IDP_ResizeArray(prop, stlen);
BLI_strncpy(prop->data.pointer, st, stlen);
BLI_strncpy(prop->data.pointer, st, (size_t)stlen);
}
}
@@ -395,7 +402,7 @@ void IDP_ConcatStringC(IDProperty *prop, const char *st)
BLI_assert(prop->type == IDP_STRING);
newlen = prop->len + strlen(st);
newlen = prop->len + (int)strlen(st);
/* we have to remember that prop->len includes the null byte for strings.
* so there's no need to add +1 to the resize function.*/
IDP_ResizeArray(prop, newlen);
@@ -795,10 +802,15 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
case IDP_DOUBLE:
return (IDP_Double(prop1) == IDP_Double(prop2));
case IDP_STRING:
return ((prop1->len == prop2->len) && strncmp(IDP_String(prop1), IDP_String(prop2), prop1->len) == 0);
{
return (((prop1->len == prop2->len) &&
strncmp(IDP_String(prop1), IDP_String(prop2), (size_t)prop1->len) == 0));
}
case IDP_ARRAY:
if (prop1->len == prop2->len && prop1->subtype == prop2->subtype) {
return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[(int)prop1->subtype] * prop1->len);
return (memcmp(IDP_Array(prop1),
IDP_Array(prop2),
idp_size_table[(int)prop1->subtype] * (size_t)prop1->len) == 0);
}
return false;
case IDP_GROUP:
@@ -870,7 +882,7 @@ bool IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
* IDP_AddToGroup or MEM_freeN the property, doing anything else might result in
* a memory leak.
*/
IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *name)
IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char *name)
{
IDProperty *prop = NULL;
@@ -897,8 +909,10 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
{
prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
prop->subtype = val->array.type;
if (val->array.len)
prop->data.pointer = MEM_callocN(idp_size_table[val->array.type] * val->array.len, "id property array");
if (val->array.len) {
prop->data.pointer = MEM_callocN(
idp_size_table[val->array.type] * (size_t)val->array.len, "id property array");
}
prop->len = prop->totallen = val->array.len;
break;
}
@@ -918,9 +932,9 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
prop->len = 0;
}
else {
prop->data.pointer = MEM_mallocN(val->string.len, "id property string 2");
prop->data.pointer = MEM_mallocN((size_t)val->string.len, "id property string 2");
prop->len = prop->totallen = val->string.len;
memcpy(prop->data.pointer, st, val->string.len);
memcpy(prop->data.pointer, st, (size_t)val->string.len);
}
prop->subtype = IDP_STRING_SUB_BYTE;
}
@@ -932,10 +946,10 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
prop->len = 1; /*NULL string, has len of 1 to account for null byte.*/
}
else {
int stlen = strlen(st) + 1;
prop->data.pointer = MEM_mallocN(stlen, "id property string 3");
int stlen = (int)strlen(st) + 1;
prop->data.pointer = MEM_mallocN((size_t)stlen, "id property string 3");
prop->len = prop->totallen = stlen;
memcpy(prop->data.pointer, st, stlen);
memcpy(prop->data.pointer, st, (size_t)stlen);
}
prop->subtype = IDP_STRING_SUB_UTF8;
}

View File

@@ -1058,12 +1058,15 @@ static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int r_mode
}
}
void init_render_material(Material *mat, int r_mode, float *amb)
void init_render_material(Material *mat,
bNodeTreeExecPool *exec_tree_pool,
int r_mode, float *amb)
{
do_init_render_material(mat, r_mode, amb);
if (mat->nodetree && mat->use_nodes) {
struct bNodeTreeExec *exec_data;
/* mode_l will take the pipeline options from the main material, and the or-ed
* result of non-pipeline options from the nodes. shadeless is an exception,
* mode_l will have it set when all node materials are shadeless. */
@@ -1074,9 +1077,15 @@ void init_render_material(Material *mat, int r_mode, float *amb)
ntreeShaderGetTexcoMode(mat->nodetree, r_mode, &mat->texco, &mat->mode_l);
init_render_nodetree(mat->nodetree, mat, r_mode, amb);
if (!mat->nodetree->execdata)
mat->nodetree->execdata = ntreeShaderBeginExecTree(mat->nodetree);
exec_data = BKE_node_tree_exec_pool_get(exec_tree_pool,
&mat->nodetree->id);
if (exec_data == NULL) {
exec_data = ntreeShaderBeginExecTree(mat->nodetree);
BKE_node_tree_exec_pool_put(exec_tree_pool,
&mat->nodetree->id,
exec_data);
}
}
else {
mat->mode_l = mat->mode;
@@ -1087,7 +1096,9 @@ void init_render_material(Material *mat, int r_mode, float *amb)
}
}
void init_render_materials(Main *bmain, int r_mode, float *amb)
void init_render_materials(Main *bmain,
bNodeTreeExecPool *exec_tree_pool,
int r_mode, float *amb)
{
Material *ma;
@@ -1106,27 +1117,32 @@ void init_render_materials(Main *bmain, int r_mode, float *amb)
/* is_used flag comes back in convertblender.c */
ma->flag &= ~MA_IS_USED;
if (ma->id.us)
init_render_material(ma, r_mode, amb);
init_render_material(ma, exec_tree_pool, r_mode, amb);
}
init_render_material(&defmaterial, r_mode, amb);
init_render_material(&defmaterial, exec_tree_pool, r_mode, amb);
}
/* only needed for nodes now */
void end_render_material(Material *mat)
void end_render_material(bNodeTreeExecPool *exec_tree_pool,
Material *mat)
{
if (mat && mat->nodetree && mat->use_nodes) {
if (mat->nodetree->execdata)
ntreeShaderEndExecTree(mat->nodetree->execdata);
struct bNodeTreeExec *exec_data;
exec_data = BKE_node_tree_exec_pool_pop(exec_tree_pool,
&mat->nodetree->id);
if (exec_data != NULL) {
ntreeShaderEndExecTree(exec_data);
}
}
}
void end_render_materials(Main *bmain)
void end_render_materials(Main *bmain, bNodeTreeExecPool *exec_tree_pool)
{
Material *ma;
for (ma = bmain->mat.first; ma; ma = ma->id.next)
if (ma->id.us)
end_render_material(ma);
end_render_material(exec_tree_pool, ma);
}
static bool material_in_nodetree(bNodeTree *ntree, Material *mat)

View File

@@ -525,6 +525,15 @@ static bool put_imbuf_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, i
}
}
static bool moviecache_check_free_proxy(ImBuf *UNUSED(ibuf),
void *userkey,
void *UNUSED(userdata))
{
MovieClipImBufCacheKey *key = (MovieClipImBufCacheKey *)userkey;
return !(key->proxy == IMB_PROXY_NONE && key->render_flag == 0);
}
/*********************** common functions *************************/
/* only image block itself */
@@ -1167,6 +1176,15 @@ void BKE_movieclip_clear_cache(MovieClip *clip)
free_buffers(clip);
}
void BKE_movieclip_clear_proxy_cache(MovieClip *clip)
{
if (clip->cache && clip->cache->moviecache) {
IMB_moviecache_cleanup(clip->cache->moviecache,
moviecache_check_free_proxy,
NULL);
}
}
void BKE_movieclip_reload(MovieClip *clip)
{
/* clear cache */

View File

@@ -46,11 +46,12 @@
#include "DNA_world_types.h"
#include "DNA_linestyle_types.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_string.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
#include "BLF_translation.h"
@@ -1129,9 +1130,6 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, Main *bmain, bool do_
id_us_plus((ID *)newtree->gpd);
/* in case a running nodetree is copied */
newtree->execdata = NULL;
BLI_listbase_clear(&newtree->nodes);
BLI_listbase_clear(&newtree->links);
@@ -1625,13 +1623,7 @@ static void node_free_node_ex(bNodeTree *ntree, bNode *node, bool remove_animdat
if (ntree->typeinfo->free_node_cache)
ntree->typeinfo->free_node_cache(ntree, node);
/* texture node has bad habit of keeping exec data around */
if (ntree->type == NTREE_TEXTURE && ntree->execdata) {
ntreeTexEndExecTree(ntree->execdata);
ntree->execdata = NULL;
}
if (node->typeinfo->freefunc)
node->typeinfo->freefunc(node);
}
@@ -1705,24 +1697,7 @@ void ntreeFreeTree_ex(bNodeTree *ntree, const bool do_id_user)
bNodeSocket *sock, *nextsock;
if (ntree == NULL) return;
/* XXX hack! node trees should not store execution graphs at all.
* This should be removed when old tree types no longer require it.
* Currently the execution data for texture nodes remains in the tree
* after execution, until the node tree is updated or freed.
*/
if (ntree->execdata) {
switch (ntree->type) {
case NTREE_SHADER:
ntreeShaderEndExecTree(ntree->execdata);
break;
case NTREE_TEXTURE:
ntreeTexEndExecTree(ntree->execdata);
ntree->execdata = NULL;
break;
}
}
/* XXX not nice, but needed to free localized node groups properly */
free_localized_node_groups(ntree);
@@ -3716,3 +3691,47 @@ bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
return true;
}
/* Node execution. */
typedef struct bNodeTreeExecPool {
GHash *hash;
} bNodeTreeExecPool;
struct bNodeTreeExecPool *BKE_node_tree_exec_pool_new(void)
{
bNodeTreeExecPool *pool;
pool = MEM_callocN(sizeof(bNodeTreeExecPool), __func__);
pool->hash = BLI_ghash_ptr_new(__func__);
return pool;
}
void BKE_node_tree_exec_pool_free(bNodeTreeExecPool *pool)
{
/* Only destroys pool, all exec data is expected to be freed already. */
BLI_assert(pool != NULL);
BLI_ghash_free(pool->hash, NULL, NULL);
MEM_freeN(pool);
}
void BKE_node_tree_exec_pool_put(bNodeTreeExecPool *pool,
struct ID *id,
void *data)
{
BLI_assert(pool != NULL);
BLI_ghash_insert(pool->hash, id, data);
}
void *BKE_node_tree_exec_pool_get(bNodeTreeExecPool *pool,
struct ID *id)
{
BLI_assert(pool != NULL);
return BLI_ghash_lookup(pool->hash, id);
}
void *BKE_node_tree_exec_pool_pop(bNodeTreeExecPool *pool,
struct ID *id)
{
BLI_assert(pool != NULL);
return BLI_ghash_popkey(pool->hash, id, NULL);
}

View File

@@ -2571,12 +2571,19 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
if (pid->cache->flag & PTCACHE_DISK_CACHE) {
ptcache_path(pid, path);
len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
dir = opendir(path);
if (dir==NULL)
return;
len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
/* append underscore terminator to ensure we don't match similar names
* from objects whose names start with the same prefix
*/
if (len < sizeof(filename) - 2) {
BLI_strncpy(filename + len, "_", sizeof(filename) - 2 - len);
len += 1;
}
BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
while ((de = readdir(dir)) != NULL) {

View File

@@ -2529,6 +2529,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
int do_seq;
// bool have_seq = false; /* UNUSED */
bool have_comp = false;
bool use_gpencil = true;
Scene *scene;
int is_thread_main = BLI_thread_is_main();
@@ -2553,6 +2554,10 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
BKE_scene_camera_switch_update(scene);
camera = scene->camera;
}
if (seq->flag & SEQ_SCENE_NO_GPENCIL) {
use_gpencil = false;
}
if (have_comp == false && camera == NULL) {
scene->r.cfra = oldcfra;
@@ -2586,7 +2591,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
ibuf = sequencer_view3d_cb(scene, camera, width, height, IB_rect,
context->scene->r.seq_prev_type,
(context->scene->r.seq_flag & R_SEQ_SOLID_TEX) != 0,
true, scene->r.alphamode, err_out);
use_gpencil, true, scene->r.alphamode, err_out);
if (ibuf == NULL) {
fprintf(stderr, "seq_render_scene_strip failed to get opengl buffer: %s\n", err_out);
}

View File

@@ -407,7 +407,7 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
CCGFace **faceMap;
MTFace *tf;
MLoopUV *mluv;
CCGFaceIterator *fi;
CCGFaceIterator fi;
int index, gridSize, gridFaces, /*edgeSize,*/ totface, x, y, S;
MLoopUV *dmloopuv = CustomData_get_layer_n(&dm->loopData, CD_MLOOPUV, n);
/* need to update both CD_MTFACE & CD_MLOOPUV, hrmf, we could get away with
@@ -434,11 +434,10 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
/* make a map from original faces to CCGFaces */
faceMap = MEM_mallocN(totface * sizeof(*faceMap), "facemapuv");
for (fi = ccgSubSurf_getFaceIterator(uvss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
for (ccgSubSurf_initFaceIterator(uvss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
ccgFaceIterator_free(fi);
/* load coordinates from uvss into tface */
tf = tface;
@@ -695,9 +694,9 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3])
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
CCGSubSurf *ss = ccgdm->ss;
CCGVertIterator *vi;
CCGEdgeIterator *ei;
CCGFaceIterator *fi;
CCGVertIterator vi;
CCGEdgeIterator ei;
CCGFaceIterator fi;
CCGKey key;
int i, edgeSize = ccgSubSurf_getEdgeSize(ss);
int gridSize = ccgSubSurf_getGridSize(ss);
@@ -707,25 +706,23 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3])
if (!ccgSubSurf_getNumVerts(ss))
r_min[0] = r_min[1] = r_min[2] = r_max[0] = r_max[1] = r_max[2] = 0.0;
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
CCGVert *v = ccgVertIterator_getCurrent(vi);
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
float *co = ccgSubSurf_getVertData(ss, v);
minmax_v3_v3v3(co, r_min, r_max);
}
ccgVertIterator_free(vi);
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
CCGElem *edgeData = ccgSubSurf_getEdgeDataArray(ss, e);
for (i = 0; i < edgeSize; i++)
minmax_v3_v3v3(CCG_elem_offset_co(&key, edgeData, i), r_min, r_max);
}
ccgEdgeIterator_free(ei);
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
for (S = 0; S < numVerts; S++) {
@@ -736,7 +733,6 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3])
minmax_v3_v3v3(CCG_grid_elem_co(&key, faceGridData, x, y), r_min, r_max);
}
}
ccgFaceIterator_free(fi);
}
static int ccgDM_getNumVerts(DerivedMesh *dm)
@@ -1429,9 +1425,9 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
int edgeSize = ccgSubSurf_getEdgeSize(ss);
int gridSize = ccgSubSurf_getGridSize(ss);
int i;
CCGVertIterator *vi;
CCGEdgeIterator *ei;
CCGFaceIterator *fi;
CCGVertIterator vi;
CCGEdgeIterator ei;
CCGFaceIterator fi;
CCGFace **faceMap2;
CCGEdge **edgeMap2;
CCGVert **vertMap2;
@@ -1439,30 +1435,27 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
totvert = ccgSubSurf_getNumVerts(ss);
vertMap2 = MEM_mallocN(totvert * sizeof(*vertMap2), "vertmap");
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
CCGVert *v = ccgVertIterator_getCurrent(vi);
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
vertMap2[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))] = v;
}
ccgVertIterator_free(vi);
totedge = ccgSubSurf_getNumEdges(ss);
edgeMap2 = MEM_mallocN(totedge * sizeof(*edgeMap2), "edgemap");
for (ei = ccgSubSurf_getEdgeIterator(ss), i = 0; !ccgEdgeIterator_isStopped(ei); i++, ccgEdgeIterator_next(ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
for (ccgSubSurf_initEdgeIterator(ss, &ei), i = 0; !ccgEdgeIterator_isStopped(&ei); i++, ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
edgeMap2[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))] = e;
}
ccgEdgeIterator_free(ei);
totface = ccgSubSurf_getNumFaces(ss);
faceMap2 = MEM_mallocN(totface * sizeof(*faceMap2), "facemap");
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
faceMap2[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
ccgFaceIterator_free(fi);
i = 0;
for (index = 0; index < totface; index++) {
@@ -1512,12 +1505,12 @@ static void ccgDM_foreachMappedVert(
DMForeachFlag flag)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
CCGVertIterator *vi;
CCGVertIterator vi;
CCGKey key;
CCG_key_top_level(&key, ccgdm->ss);
for (vi = ccgSubSurf_getVertIterator(ccgdm->ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
CCGVert *v = ccgVertIterator_getCurrent(vi);
for (ccgSubSurf_initVertIterator(ccgdm->ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
const int index = ccgDM_getVertMapIndex(ccgdm->ss, v);
if (index != -1) {
@@ -1526,8 +1519,6 @@ static void ccgDM_foreachMappedVert(
func(userData, index, CCG_elem_co(&key, vd), no, NULL);
}
}
ccgVertIterator_free(vi);
}
static void ccgDM_foreachMappedEdge(
@@ -1537,14 +1528,14 @@ static void ccgDM_foreachMappedEdge(
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
CCGSubSurf *ss = ccgdm->ss;
CCGEdgeIterator *ei;
CCGEdgeIterator ei;
CCGKey key;
int i, edgeSize = ccgSubSurf_getEdgeSize(ss);
CCG_key_top_level(&key, ss);
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
const int index = ccgDM_getEdgeMapIndex(ss, e);
if (index != -1) {
@@ -1554,8 +1545,6 @@ static void ccgDM_foreachMappedEdge(
}
}
}
ccgEdgeIterator_free(ei);
}
static void ccgDM_foreachMappedLoop(
@@ -1593,28 +1582,26 @@ static void ccgDM_drawVerts(DerivedMesh *dm)
CCGSubSurf *ss = ccgdm->ss;
int edgeSize = ccgSubSurf_getEdgeSize(ss);
int gridSize = ccgSubSurf_getGridSize(ss);
CCGVertIterator *vi;
CCGEdgeIterator *ei;
CCGFaceIterator *fi;
CCGVertIterator vi;
CCGEdgeIterator ei;
CCGFaceIterator fi;
glBegin(GL_POINTS);
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
CCGVert *v = ccgVertIterator_getCurrent(vi);
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
glVertex3fv(ccgSubSurf_getVertData(ss, v));
}
ccgVertIterator_free(vi);
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
int x;
for (x = 1; x < edgeSize - 1; x++)
glVertex3fv(ccgSubSurf_getEdgeData(ss, e, x));
}
ccgEdgeIterator_free(ei);
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
glVertex3fv(ccgSubSurf_getFaceCenterData(f));
@@ -1626,7 +1613,6 @@ static void ccgDM_drawVerts(DerivedMesh *dm)
for (x = 1; x < gridSize - 1; x++)
glVertex3fv(ccgSubSurf_getFaceGridData(ss, f, S, x, y));
}
ccgFaceIterator_free(fi);
glEnd();
}
@@ -2749,15 +2735,15 @@ static void ccgDM_drawMappedEdges(DerivedMesh *dm,
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
CCGSubSurf *ss = ccgdm->ss;
CCGEdgeIterator *ei;
CCGEdgeIterator ei;
CCGKey key;
int i, useAging, edgeSize = ccgSubSurf_getEdgeSize(ss);
CCG_key_top_level(&key, ss);
ccgSubSurf_getUseAgeCounts(ss, &useAging, NULL, NULL, NULL);
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
CCGElem *edgeData = ccgSubSurf_getEdgeDataArray(ss, e);
int index = ccgDM_getEdgeMapIndex(ss, e);
@@ -2775,8 +2761,6 @@ static void ccgDM_drawMappedEdges(DerivedMesh *dm,
}
glEnd();
}
ccgEdgeIterator_free(ei);
}
static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm,
@@ -2787,14 +2771,14 @@ static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm,
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
CCGSubSurf *ss = ccgdm->ss;
CCGKey key;
CCGEdgeIterator *ei;
CCGEdgeIterator ei;
int i, useAging, edgeSize = ccgSubSurf_getEdgeSize(ss);
CCG_key_top_level(&key, ss);
ccgSubSurf_getUseAgeCounts(ss, &useAging, NULL, NULL, NULL);
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
CCGElem *edgeData = ccgSubSurf_getEdgeDataArray(ss, e);
int index = ccgDM_getEdgeMapIndex(ss, e);
@@ -2813,8 +2797,6 @@ static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm,
}
glEnd();
}
ccgEdgeIterator_free(ei);
}
static void ccgDM_foreachMappedFaceCenter(
@@ -2826,12 +2808,12 @@ static void ccgDM_foreachMappedFaceCenter(
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
CCGSubSurf *ss = ccgdm->ss;
CCGKey key;
CCGFaceIterator *fi;
CCGFaceIterator fi;
CCG_key_top_level(&key, ss);
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
const int index = ccgDM_getFaceMapIndex(ss, f);
if (index != -1) {
@@ -2841,8 +2823,6 @@ static void ccgDM_foreachMappedFaceCenter(
func(userData, index, CCG_elem_co(&key, vd), no);
}
}
ccgFaceIterator_free(fi);
}
static void ccgDM_release(DerivedMesh *dm)
@@ -3438,9 +3418,9 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
DerivedMesh *dm)
{
CCGDerivedMesh *ccgdm = MEM_callocN(sizeof(*ccgdm), "ccgdm");
CCGVertIterator *vi;
CCGEdgeIterator *ei;
CCGFaceIterator *fi;
CCGVertIterator vi;
CCGEdgeIterator ei;
CCGFaceIterator fi;
int index, totvert, totedge, totface;
int i;
int vertNum, edgeNum, faceNum;
@@ -3573,30 +3553,27 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
totvert = ccgSubSurf_getNumVerts(ss);
ccgdm->vertMap = MEM_mallocN(totvert * sizeof(*ccgdm->vertMap), "vertMap");
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
CCGVert *v = ccgVertIterator_getCurrent(vi);
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
ccgdm->vertMap[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))].vert = v;
}
ccgVertIterator_free(vi);
totedge = ccgSubSurf_getNumEdges(ss);
ccgdm->edgeMap = MEM_mallocN(totedge * sizeof(*ccgdm->edgeMap), "edgeMap");
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
ccgdm->edgeMap[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e;
}
ccgEdgeIterator_free(ei);
totface = ccgSubSurf_getNumFaces(ss);
ccgdm->faceMap = MEM_mallocN(totface * sizeof(*ccgdm->faceMap), "faceMap");
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
ccgdm->faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))].face = f;
}
ccgFaceIterator_free(fi);
ccgdm->reverseFaceMap = MEM_callocN(sizeof(int) * ccgSubSurf_getNumFinalFaces(ss), "reverseFaceMap");
@@ -4001,13 +3978,13 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3])
*/
CCGSubSurf *ss = _getSubSurf(NULL, 1, 3, CCG_USE_ARENA);
float edge_sum[3], face_sum[3];
CCGVertIterator *vi;
CCGVertIterator vi;
DerivedMesh *dm = CDDM_from_mesh(me);
ss_sync_from_derivedmesh(ss, dm, NULL, 0);
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
CCGVert *v = ccgVertIterator_getCurrent(vi);
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
int idx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
int N = ccgSubSurf_getVertNumEdges(v);
int numFaces = ccgSubSurf_getVertNumFaces(v);
@@ -4036,7 +4013,6 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3])
r_positions[idx][1] = (co[1] * N * N + edge_sum[1] * 4 + face_sum[1]) / (N * (N + 5));
r_positions[idx][2] = (co[2] * N * N + edge_sum[2] * 4 + face_sum[2]) / (N * (N + 5));
}
ccgVertIterator_free(vi);
ccgSubSurf_free(ss);

View File

@@ -835,10 +835,7 @@ Tex *BKE_texture_copy(Tex *tex)
if (texn->ot) texn->ot = BKE_copy_oceantex(texn->ot);
if (tex->preview) texn->preview = BKE_previewimg_copy(tex->preview);
if (tex->nodetree) {
if (tex->nodetree->execdata) {
ntreeTexEndExecTree(tex->nodetree->execdata);
}
if (tex->nodetree != NULL) {
texn->nodetree = ntreeCopyTree(tex->nodetree);
}

View File

@@ -383,13 +383,17 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
int frame = BKE_movieclip_remap_scene_to_clip_frame(
context->clips[options->clip_index],
context->user.framenr);
bool has_marker;
if (libmv_autoTrackGetMarker(context->autotrack,
options->clip_index,
frame,
options->track_index,
&libmv_current_marker))
{
BLI_spin_lock(&context->spin_lock);
has_marker = libmv_autoTrackGetMarker(context->autotrack,
options->clip_index,
frame,
options->track_index,
&libmv_current_marker);
BLI_spin_unlock(&context->spin_lock);
if (has_marker) {
if (!tracking_check_marker_margin(&libmv_current_marker,
options->track->margin,
context->frame_width,
@@ -427,7 +431,7 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
}
else {
options->is_failed = true;
options->failed_frame = frame;
options->failed_frame = frame + frame_delta;
}
ok = true;
}
@@ -442,11 +446,11 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
void BKE_autotrack_context_sync(AutoTrackContext *context)
{
int newframe = context->user.framenr,
frame_delta = context->backwards ? -1 : 1;
int newframe, frame_delta = context->backwards ? -1 : 1;
int clip, frame;
BLI_spin_lock(&context->spin_lock);
newframe = context->user.framenr;
for (frame = context->sync_frame;
frame != (context->backwards ? newframe - 1 : newframe + 1);
frame += frame_delta)
@@ -459,22 +463,18 @@ void BKE_autotrack_context_sync(AutoTrackContext *context)
AutoTrackOptions *options = &context->options[track];
int track_frame = BKE_movieclip_remap_scene_to_clip_frame(
context->clips[options->clip_index], frame);
if (options->is_failed) {
if (options->failed_frame == track_frame) {
MovieTrackingMarker *prev_marker =
BKE_tracking_marker_get_exact(
options->track,
frame);
if (prev_marker) {
marker = *prev_marker;
marker.framenr = context->backwards ?
track_frame - 1 :
track_frame + 1;
marker.flag |= MARKER_DISABLED;
BKE_tracking_marker_insert(options->track, &marker);
}
if (options->is_failed && options->failed_frame == track_frame) {
MovieTrackingMarker *prev_marker =
BKE_tracking_marker_get_exact(options->track, frame);
if (prev_marker) {
marker = *prev_marker;
marker.framenr = context->backwards ?
track_frame - 1 :
track_frame + 1;
marker.flag |= MARKER_DISABLED;
BKE_tracking_marker_insert(options->track, &marker);
continue;
}
continue;
}
if (libmv_autoTrackGetMarker(context->autotrack,
clip,

View File

@@ -39,6 +39,7 @@
#include "DNA_texture_types.h"
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
@@ -138,6 +139,8 @@ World *BKE_world_copy(World *wrld)
if (wrld->preview)
wrldn->preview = BKE_previewimg_copy(wrld->preview);
BLI_listbase_clear(&wrldn->gpumaterial);
return wrldn;
}
@@ -162,6 +165,8 @@ World *localize_world(World *wrld)
wrldn->preview = NULL;
BLI_listbase_clear(&wrldn->gpumaterial);
return wrldn;
}

View File

@@ -51,9 +51,9 @@
}))
#else
# define CHECK_TYPE(var, type)
# define CHECK_TYPE_PAIR(var_a, var_b)
# define CHECK_TYPE_PAIR_INLINE(var_a, var_b) (void)0
# define CHECK_TYPE(var, type) { EXPR_NOP(var); }(void)0
# define CHECK_TYPE_PAIR(var_a, var_b) { (EXPR_NOP(var_a), EXPR_NOP(var_b)); }(void)0
# define CHECK_TYPE_PAIR_INLINE(var_a, var_b) (EXPR_NOP(var_a), EXPR_NOP(var_b))
#endif
/* can be used in simple macros */
@@ -66,10 +66,15 @@
((void)(((type)0) != (0 ? (val) : ((type)0))))
#endif
#define CHECK_TYPE_NONCONST(var) { \
void *non_const = 0 ? (var) : NULL; \
(void)non_const; \
} (void)0
#if defined(__GNUC__) || defined(__clang__)
# define CHECK_TYPE_NONCONST(var) __extension__ ({ \
void *non_const = 0 ? (var) : NULL; \
(void)non_const; \
})
#else
# define CHECK_TYPE_NONCONST(var) EXPR_NOP(var)
#endif
/**
* CHECK_TYPE_ANY: handy macro, eg:

View File

@@ -26,7 +26,6 @@
/** \file BLI_edgehash.h
* \ingroup bli
* \author Daniel Dunbar
* \brief A general unordered 2-int pair hash table ADT.
*/
#include "BLI_compiler_attrs.h"
@@ -55,6 +54,9 @@ bool BLI_edgehash_reinsert(EdgeHash *eh, unsigned int v0, unsigned in
void *BLI_edgehash_lookup(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
void *BLI_edgehash_lookup_default(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val_default) ATTR_WARN_UNUSED_RESULT;
void **BLI_edgehash_lookup_p(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
bool BLI_edgehash_remove(EdgeHash *eh, unsigned int v0, unsigned int v1, EdgeHashFreeFP valfreefp);
void *BLI_edgehash_popkey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
bool BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
int BLI_edgehash_size(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT;
void BLI_edgehash_clear_ex(EdgeHash *eh, EdgeHashFreeFP valfreefp,

View File

@@ -30,7 +30,6 @@
/** \file BLI_ghash.h
* \ingroup bli
* \brief A general (pointer -> pointer) hash table ADT
*/
#include "BLI_sys_types.h" /* for bool */
@@ -41,6 +40,7 @@ extern "C" {
#endif
typedef unsigned int (*GHashHashFP) (const void *key);
/** returns false when equal */
typedef bool (*GHashCmpFP) (const void *a, const void *b);
typedef void (*GHashKeyFreeFP) (void *key);
typedef void (*GHashValFreeFP) (void *val);

View File

@@ -37,6 +37,7 @@ typedef void (*HeapFreeFP)(void *ptr);
* are recycled, so memory usage will not shrink. */
Heap *BLI_heap_new_ex(unsigned int tot_reserve) ATTR_WARN_UNUSED_RESULT;
Heap *BLI_heap_new(void) ATTR_WARN_UNUSED_RESULT;
void BLI_heap_clear(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1);
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1);
/* Insert heap node with a value (often a 'cost') and pointer into the heap,

View File

@@ -77,6 +77,7 @@ float volume_tetrahedron_signed_v3(const float v1[3], const float v2[3], const f
bool is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
bool is_quad_convex_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2]);
bool is_poly_convex_v2(const float verts[][2], unsigned int nr);
int is_quad_flip_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
/********************************* Distance **********************************/

View File

@@ -37,4 +37,7 @@ void BLI_polyfill_calc(
const int coords_sign,
unsigned int (*r_tris)[3]);
/* default size of polyfill arena */
#define BLI_POLYFILL_ARENA_SIZE MEM_SIZE_OPTIMAL(1 << 14)
#endif /* __BLI_POLYFILL2D_H__ */

View File

@@ -0,0 +1,39 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BLI_POLYFILL2D_BEAUTIFY_H__
#define __BLI_POLYFILL2D_BEAUTIFY_H__
struct EdgeHash;
struct Heap;
struct MemArena;
void BLI_polyfill_beautify(
const float (*coords)[2],
const unsigned int coords_tot,
unsigned int (*tris)[3],
/* structs for reuse */
struct MemArena *arena, struct Heap *eheap, struct EdgeHash *eh);
/* avoid realloc's when creating new structures for polyfill ngons */
#define BLI_POLYFILL_ALLOC_NGON_RESERVE 64
#endif /* __BLI_POLYFILL2D_BEAUTIFY_H__ */

View File

@@ -52,7 +52,7 @@ typedef struct SmallHash {
} SmallHash;
typedef struct {
SmallHash *sh;
const SmallHash *sh;
unsigned int i;
} SmallHashIter;
@@ -61,13 +61,16 @@ void BLI_smallhash_init_ex(SmallHash *sh,
void BLI_smallhash_init(SmallHash *sh) ATTR_NONNULL(1);
void BLI_smallhash_release(SmallHash *sh) ATTR_NONNULL(1);
void BLI_smallhash_insert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1);
bool BLI_smallhash_reinsert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1);
bool BLI_smallhash_remove(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1);
void *BLI_smallhash_lookup(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
void **BLI_smallhash_lookup_p(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
bool BLI_smallhash_haskey(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1);
int BLI_smallhash_count(SmallHash *sh) ATTR_NONNULL(1);
void *BLI_smallhash_lookup(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
void **BLI_smallhash_lookup_p(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
bool BLI_smallhash_haskey(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1);
int BLI_smallhash_count(const SmallHash *sh) ATTR_NONNULL(1);
void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
void *BLI_smallhash_iternew(SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
void **BLI_smallhash_iternext_p(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
void *BLI_smallhash_iternew(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
void **BLI_smallhash_iternew_p(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
/* void BLI_smallhash_print(SmallHash *sh); */ /* UNUSED */
#ifdef DEBUG

View File

@@ -219,6 +219,8 @@ extern "C" {
/* reusable ELEM macro */
#define ELEM(...) VA_NARGS_CALL_OVERLOAD(_VA_ELEM, __VA_ARGS__)
/* no-op for expressions we don't want to instansiate, but must remian valid */
#define EXPR_NOP(expr) (void)(0 ? ((void)(expr), 1) : 0)
/* shift around elements */
#define SHIFT3(type, a, b, c) { \

View File

@@ -85,6 +85,7 @@ set(SRC
intern/noise.c
intern/path_util.c
intern/polyfill2d.c
intern/polyfill2d_beautify.c
intern/quadric.c
intern/rand.c
intern/rct.c
@@ -161,6 +162,7 @@ set(SRC
BLI_noise.h
BLI_path_util.h
BLI_polyfill2d.h
BLI_polyfill2d_beautify.h
BLI_quadric.h
BLI_rand.h
BLI_rect.h
@@ -189,13 +191,6 @@ set(SRC
PIL_time_utildefines.h
)
if(WITH_BINRELOC)
list(APPEND INC_SYS
${BINRELOC_INCLUDE_DIRS}
)
add_definitions(-DWITH_BINRELOC)
endif()
if(WITH_MEM_VALGRIND)
add_definitions(-DWITH_MEM_VALGRIND)
endif()

Some files were not shown because too many files have changed in this diff Show More