Compare commits

...

246 Commits

Author SHA1 Message Date
d8e2ed8ae2 svn merge ^/trunk/blender -r50999:51100 2013-01-07 07:56:54 +00:00
5323a2f18f Collada Code Fix 2012-11-04 07:06:10 +00:00
c112e1b796 merge with trunk -r50910 2012-09-26 14:53:41 +00:00
4e39a8f939 merge with trunk r50303 2012-08-31 22:23:28 +00:00
803c462f04 Scons:
* Fix scons compilation, by moving some arguments to the second argument list.
2012-08-26 13:20:41 +00:00
cd47ae2f98 svn merge ^/trunk/blender -r50010:50095 2012-08-21 18:15:40 +00:00
2d836dbd06 - bf_fbx: cleanup import defaults, fix typos and UI descriptions. 2012-08-20 17:25:04 +00:00
2ea6bce72b - bf_assimp, bf_fbx: make assimp and fbx import settings accessible from the UI / add them to SRNA. 2012-08-20 14:28:21 +00:00
97da892ed1 - bf_fbx: expose more of assimp's fbx import settings to Blender. 2012-08-20 12:50:31 +00:00
fad0a9954e Code cleanup 2012-08-19 18:36:02 +00:00
db15c04783 code cleanup 2012-08-19 13:13:45 +00:00
4414509071 fix for incorrect clamping for rgb_invert() function 2012-08-19 11:51:58 +00:00
11b0aadf8c svn merge ^/trunk/blender -r49963:50010 2012-08-19 11:29:25 +00:00
d0a4234d6d fix for build error after merging 2012-08-19 11:18:27 +00:00
0eb51702d4 svn merge ^/trunk/blender -r49900:49963 2012-08-19 11:04:01 +00:00
19885babaf svn merge ^/trunk/blender -r49800:49900 2012-08-19 11:01:31 +00:00
78f393f0c3 svn merge ^/trunk/blender -r49750:49800 2012-08-19 10:54:07 +00:00
1f40c0ffa7 Texture Paint Alpha Masks
=========================
* Add rotation for masks
* Fix rotation for projection painting.
* For now mask acts only as stencil for the cursor (ie non projective)
This can change though based on user input
2012-08-17 20:48:11 +00:00
522af38d6a Mask textures for texture paint
=================================
Cleanup options available for mask textures
2012-08-17 19:17:14 +00:00
892ccaea80 Fix update of mask overlay 2012-08-17 18:35:33 +00:00
74f0263a1f [COLLADA]Mesh Controller improvements 2012-08-17 18:01:09 +00:00
43a2baa935 Texture Paint Alpha Masks
==========================
* Cleanup of panels
2012-08-17 17:52:26 +00:00
09b53a5e4e Fix overlay for tiled mapping. This involves separating the overlay
generation code between alpha(brush curve, mask texture) and image
opengl textures and combining the two with multitexture combiners
(ancient functionality that should work everywhere). It still needs some
testing but result is now as expected.
2012-08-16 03:14:28 +00:00
14eb8a895c Isomap unwrapper
================
* Robustness: Avoid nan in sqrt calculation
* Do a much simpler calculation of projected point.
2012-08-11 18:40:15 +00:00
a5616dff7f Isomap Unwrapper
================
* Substitute geodesic distance calculation method with one found in
"Computing Geodesic Distances on Triangular Meshes"
by Marcin Novotni and Reinhard Klein.

At last we have a good result! :)
2012-08-11 18:40:08 +00:00
534d106cfa [COLLADA]Morph Controller Import. 2012-08-11 18:07:01 +00:00
30d31089db - bf_fbx: add settings parameter to entry point, enable the assimp log pipe by default. 2012-08-11 13:42:44 +00:00
08010511b0 [COLLADA] Morph export fixes and fiddling. 2012-08-11 09:32:25 +00:00
d664ae35f8 *Fix quadratic equation solution formula (hadn't used this since high
school)
*Add some debug prints
2012-08-11 01:17:16 +00:00
8b7021c56a Isomap unwrapper
================
* Calculation code for geodesic distance based on two neighbours. Still
not functional. Based on "Computing Geodesic Paths on manifolds" by
R.Kimmel and J.A. Sethian. with slight modifications (obtuse angle
triangles are split instead of looking for suitable vertex in the graph)

The result is still not good, hunting for bugs.
2012-08-11 00:34:27 +00:00
5d12b5c4f3 [COLLADA] Morph animation export intro. 2012-08-10 21:17:20 +00:00
0c128dec7c [COLLADA]Morph Controller export. 2012-08-10 20:22:30 +00:00
43e4e3f451 [COLLADA]ControllerExporter , Re-factor from ArmatureExporter 2012-08-10 16:25:58 +00:00
85400cf7cb Morph target export to COLLADA fix 2012-08-10 15:25:50 +00:00
539c3d296d merge with trunk 49750 2012-08-10 00:42:11 +00:00
30fda0216b Isomap Unwrapper
================
* Add code that determines the distance based on nearby vertices, if any
of them have had their distance calculated. That has been achallenge as
can be seen from the loads of debug code that went into it.
2012-08-09 23:59:41 +00:00
a71155ec95 Isomap Unwrapper
================
* Testing: Make distance update step depend on two triangle vertices.
Calculation is not yet done, still this test is essential to make sure
the algorithm will converge.
* comment cleanup
2012-08-09 23:59:36 +00:00
778938ee1f Isomap Unwrapper
=================
* Cleanup, separate common code to function
2012-08-09 23:59:28 +00:00
df6683c4c5 Morph controller geometries export.
Export of mesh shape keys for Morph controller targets.
2012-08-09 20:36:21 +00:00
942a5545c0 Functions to allow overriding of the color of a button. Use these functions to make the white and black color picker buttons white and black. 2012-08-09 03:59:28 +00:00
5013881074 Cleanup, remove isomap old O(n^4) distance calculation method 2012-08-08 00:52:14 +00:00
2fc95ffbde merge troonk revusion 49612 2012-08-06 13:14:03 +00:00
89b241304f Isomap Unwrapper
================
* Update graph distance as well if needed.
2012-08-05 14:22:44 +00:00
028634c9ab Isomap Unwrapper
=================
* Fix, pass squares of distances to eigen solver
* Use a heap instead of a stack to get the next vertex to iterate
through in Dijkstra graph search algorithm. This is needed because we
may follow a non-optimal path and not get the nearest path between
vertices. This introduces the O(n*log(n)) performance (was more like
simply O(n) till now, but unfortunately, it was incorrect).
2012-08-05 02:34:31 +00:00
32c51654c0 Isomap Unwrapper
=================
* First part of optimizations found in paper:

"Texture Mapping using Surface Flattening via Multi-Dimensional Scaling"
by Gil Zigelman, Ron Kimmel and Nahum Kiryati

(Multi-Dimensional Scaling is actually isomap with another name).

Implemented Dijkstra graph search algorithm that drops distance build
times from n^4 to n*(n*logn). The paper also describes a better distance
calulation algorithm so it seems like we shall soon see ISOMAP in its
full glory after all ;)
2012-08-04 01:49:33 +00:00
4c0bda38b9 Comment cleanup 2012-08-03 22:52:59 +00:00
205f24b8a3 Isomap Unwrapper
==================
* First working version, however:

1) It's extremely slow (finding geodesic distances between all vertices
on mesh is O^4 expensive!) It can be optimized away, however there is
problem number...
2) The result is not that good when only using mesh connectivity from
edges. I may have to look at an alternative to calculate distances.

However, reading some more papers it looks like this is quite an
expensive algorithm. Coupled with the fact that it can't support pinned
UVs this will probably as far as this will go since there is no time to
investigate other methods. I will try to see if result can be improved a
bit though.
2012-08-03 22:52:55 +00:00
1c304e27a4 Isomap Unwrapper
==================
Add more debug prints, do math more according to the paper. Still not
having a good result :/
2012-08-03 17:08:45 +00:00
5b17058430 Isomap Unwrapper
================
* Add warnings
* Change return value so that result gets packed
* Fix uber stupid index mistake.

Result is still not sane but now I am getting something that is at least
visible in the UV editor.
2012-08-01 18:48:10 +00:00
cdb83471a3 Isomap Unwrapper
=================
* Numerical part, still not functional though.
* eigenvalues seem to be very high I think it's to be expected since I
use MAX_FLOAT for non connected points in the code. Investigating theory
and code to fix. Paper states "for non connected points set distance to
infinite"
2012-08-01 17:54:14 +00:00
2000254119 Add files and some initial code for isomap unwrapper. 2012-08-01 17:54:08 +00:00
243927d20a Add gui options for isomap 2012-08-01 17:54:00 +00:00
1cf0edb370 fix blenderplayer link 2012-08-01 00:55:43 +00:00
56c8076d56 User request from blenderartists: Invert brush colour.
=======================================================
To invert the brush either select the invert option under the colour
picker or press Ctrl when stroking. Doing both will do normal drawing.
There is a known issue with fixed brushes on image editor which will be
addressed next.
The inversion happens after applying the texture to the brush colour, so
the total colour of the brush gets inverted.
2012-07-31 16:25:40 +00:00
966d54d07d merge with trunk 49411 2012-07-31 14:01:28 +00:00
ff8441dcd7 IK constraint animation export, fixed. 2012-07-28 19:16:02 +00:00
7a3054126c Another iteration of the manipulator. The 2-dimension scaling blocks have become lines instead, but the same block area is used to control them. Thus, it has the same function but is a bit less visually cluttered. 2012-07-28 00:50:38 +00:00
d048fd36a8 Add the ability to query the last redoable operator from in python. Add the ability to mark certain operator properties as "Primary" meaning that they're the most important ones, and the ones that should be shown if the operator's representation must be shortened. Built an example/prototype floating control which shows the last operator and, if clicked, opens the f6 window for that operator. It has a few problems though, such as that it can't seem to access all operator properties and I can't figure out how to get it to render white. 2012-07-26 22:26:50 +00:00
5d7915ace9 Restore the widgets to the 3D view header, they shouldn't come out until someone does a proper re-design, even if they're redundant. 2012-07-24 01:01:59 +00:00
7ae476991c Mirrored Unwrap
===============
Pack after unwrap to get rid of the extra mirrored faces.
2012-07-24 00:57:40 +00:00
4fdf7d431e Update floating controls paneltype for the new userprefs option. 2012-07-24 00:39:20 +00:00
10ddbd2a76 Move floating controls option to the Interface tab where it fits better. 2012-07-24 00:29:11 +00:00
15112dc8b0 UV mirrored unwrap
====================
* Code cleanup, avoid duplication.
2012-07-23 22:57:53 +00:00
142492f066 Mirrored Unwrap
================
* support for ngons in regular unwrap.
2012-07-23 22:57:47 +00:00
a891ac3ce8 Mirrored unwrap
================
* better support for regular unwrap, fixed incorrect indices of edges
when calculating seams, made it possible to take seam on mirror border
into account so that mirrored part can be "cut" during unwrapping.
2012-07-23 21:09:13 +00:00
ca2b7d6fa5 Solve compilation erro (missing 'r' intended) 2012-07-23 02:16:26 +00:00
35b1591bd4 Support mirror unwrap for normal unwrapping. Only non-ngons in this
commit.
2012-07-21 13:59:55 +00:00
d4ff8f911c UV mirrored unwrap
===================
* Separate common mirror functionality from modifier files to BKE_*
files
* Now subsurfed unwrap can flush the result of the mirrored mesh to the
solver
* TODO: add support for regular unwrap, pack the result to 0.0-0.5 range
if the appropriate mirror uv option is selected in the modifier
2012-07-21 02:09:11 +00:00
4ae1d51db5 Another experiment with arranging the two-dimension scale/translate manipulators such that they don't look so cluttered. 2012-07-20 22:18:32 +00:00
02fb1cf686 Attempting fix for strange issue with menus becoming unresponsive and
flickering of floating panels.
2012-07-20 20:01:56 +00:00
9a11885c70 Add a button to switch back to object mode. 2012-07-18 23:27:10 +00:00
af175013c7 Better fix for last fix 2012-07-18 22:43:35 +00:00
a5c99a57e8 Fix silly crash on meshes without modifiers due to own commit 2012-07-18 22:43:28 +00:00
dcc59e5b52 Introduce an operator which switches to edit mode and activates a specific edit selection mode at the same time. This lets a designer create buttons that go to a specific edit selection mode when the user is in object mode. Use this operator to implement more functionality for the floating controls. 2012-07-18 22:29:31 +00:00
f1828714a8 * Cleanup of subsurf unwrap code
Now take subsurf levels and type from the modifier stack (Now simple
subdivision will work too). Subsurf unwrap won't work if there's no
subsurf first or after mirror in the modifier stack. This is done to
alleviate having to set subsurf levels in two places, usually user will
want the tool to autodetect the setting from the stack. This sets the
paradigm that will be followed by mirrored unwrap as well.
2012-07-18 21:43:37 +00:00
1e44465c0f UV transform correction
========================
* Fix crash when moving single vertices or vertices/faces not attached
to faces.
2012-07-18 20:01:06 +00:00
193e6ab816 UV unwrap mirrored
=====================
* Dummy GUI/RNA operator properties
2012-07-18 20:00:59 +00:00
257931bba1 merge with trunk 49039 2012-07-18 18:53:03 +00:00
bf24b557ed Created floating buttons for changing the edit selection mode, vert edge or face. These buttons work similar to the manipulator buttons in that pressing one shuts off the others, unless shift is down. 2012-07-17 21:59:20 +00:00
9d1c214ca7 Update the 3d view after the floating controls option is changed. 2012-07-17 20:56:01 +00:00
22bb90d57d Added a "clear" function for bit-field boolean RNA properties, used by a "clearfield" parameter for the "prop" command. This allows python scripts to create buttons which clear the entire bitfield before setting a value, thus enabling mutually exclusive buttons where only one can be toggled at a time. This behavior can be overridden if shift is held down by the user. All of this is used by the TRS floating buttons so that clicking one clears the others. 2012-07-17 03:05:42 +00:00
b14202c8fe 2012-07-14 17:15:20 +00:00
2d2b64a7f0 IK constraint animation export.(not complete) 2012-07-14 03:37:39 +00:00
a508c58793 The buttons should set the manipulator mode, not do the transform. Use prop instead of operator so there can be multiple modes enables at once. 2012-07-13 23:42:40 +00:00
9f07335efb UV transform correction
=========================
* Add visual debug code, slightly offsets edges whose loops are used for
projection
* Numerical robustness: Clamp dot products to avoid nans in acos.

With this commit, I consider UV transform correction robust for use.
Feel free to test and send comments/bugs.
2012-07-13 21:43:48 +00:00
fc5fd8ed0e UV transform correction
=========================
* Little fix, using final instead of original coordinates
* Take mean value of displacement for boundary edges. Now the
displacement is solved for both boundary edges if the edges are
parallel.
2012-07-13 19:59:38 +00:00
e9eab8e661 UV transform correction
=======================
* Make a better estimate of closest loops by taking angle sign into
account.
2012-07-13 19:20:18 +00:00
2a3d6244b1 modifications to get the mask alpha in overlay. Still quite some fixes
needed for it to work properly
2012-07-12 19:56:47 +00:00
d22172c0ef More cleanup of brush modes for texture paint mode 2012-07-12 19:56:34 +00:00
8626f05626 Another experiment with arranging the two-dimension scale/translate manipulators such that they don't overlap and their function is a bit more obvious. It's a bit more cluttered than before though. 2012-07-12 19:29:38 +00:00
d7e8d13e6a python refactoring: separate mask texture properties to their own panel.
Also remove 'Fixed Texture' property from 3D toolbar as it is only
relevant for 2D painting
2012-07-12 19:11:38 +00:00
be268b9baf Overlay for texpaint
=====================
* add an extra mode for mapping, solves some overlay issues.
2012-07-12 18:43:07 +00:00
27c2af959c UV transform correction
=========================
* Code for better out-of-mesh-bounds interpolation. For now just choose
one of the boundary faces and do interpolation based on that. Eventually
will do a linear combination for a two-face solve.
2012-07-12 17:34:13 +00:00
b2afee8546 Update function signature, fix for r48825 2012-07-12 06:47:34 +00:00
9057600e70 By request, X button for each item on the UV Maps list box. 2012-07-11 07:47:09 +00:00
b749aad05d merge with trunk 48817 2012-07-10 21:45:15 +00:00
2d434f61f5 UV transform correction
========================
* extrapolation for out of mesh boundaries

Testing also revealed some cases where minimum angle calculation doesn't
work as it should. Solution will probably be to store according to
winding
2012-07-10 01:14:03 +00:00
2b5eafe9c9 Deleting the selected item in the vertex groups listbox leaves the selection on the next rather than the preceding item. 2012-07-09 23:46:48 +00:00
c25a23c81f Add OPTYPE_CLEAR_SEARCH to an operator type to prevent a search panel built for that operator from automatically filling in the previous search. 2012-07-09 22:32:00 +00:00
fbb0a2e33d - bf_assimp: add settings parameter to bassimp_import(). Settings include a reportlist to report to plus some assimp-specific stuff (triangulation, unit scaling etc) . Not all settings are implemented yet and they are also not yet offered in the GUI. 2012-07-08 14:10:29 +00:00
e333cd9e59 - SCons: add WITH_BF_ASSIMP=False and WITH_BF_FBX=False to all configs. 2012-07-08 00:35:13 +00:00
8fce748a21 + SCons build for bf_fbx, bf_assimp and ext_assimp (off by default, not in config yet) 2012-07-08 00:00:51 +00:00
93abfa3b02 Revert previous commit and fix crash. Found the cause on MinGW since it
won't excuse uninitialized variables. projectSVdata still does the wrong
thing, better fix it than disable it though.
2012-07-07 01:05:41 +00:00
f995e4c71e An option to turn off the floating controls from the user preferences, or move them to different areas of the screen. 2012-07-07 00:17:46 +00:00
e13791655b disable data interpolation through projectSVdata. The function causes
crashes with the new uv transform correction code, probably due to the
already known shrinking effect. I could generalize the data
interpolation function I have written for all custom data but it
requires preprocessing to detect data space islands. I hope I can figure
out a way to fix this properly, possibly using a combination of the two
codes.
2012-07-06 22:39:28 +00:00
4b3eea4b81 UV transform correction
========================
* Big rewrite of the tool, now properly supporting seams and extensions
outside mesh boundaries.
* todo, coming ASAP is fixing of exceptional case where boundary edges
are parallel (needs another way to map to data space)
2012-07-06 22:05:10 +00:00
d714ccaeb3 UV transform correction
========================
* minor speedup, calculate edge lengths only on startup.
2012-07-06 01:39:41 +00:00
cbcc618a33 Utility function, project point along vector to plane. will be needed
for uv transform correction.
2012-07-06 01:39:27 +00:00
fd321a01ab Support for columns to lay out items in the center or bottom. Currently it's only used for the 3d view so it uses the entire region height to calculate, this may not work in other cases. 2012-07-06 00:33:09 +00:00
656a8d276b Armature animation improvements. 2012-07-05 19:19:50 +00:00
ea0047d2aa Shift actually does not do anything here anymore. 2012-07-05 18:33:52 +00:00
a1083934f4 More fixes for brush overlay. 2012-07-05 16:41:19 +00:00
07300856cd merge with trunk 48648 2012-07-05 14:30:35 +00:00
ca2e5347c5 Define static glew for sculpt and paint since I use a few extra GL calls that reference extensions. 2012-07-05 13:25:47 +00:00
b5c7bd26ac Switch the floating controls panel over to python drawing. 2012-07-05 04:25:01 +00:00
b07a8126c7 Update this description to reflect its new behavior since the drag-select patch. 2012-07-05 03:25:23 +00:00
d99651defe Give the main 3d window a UI handler so it can process button events. 2012-07-04 23:44:43 +00:00
1f0b0ef6ad leaf bone fix.
the length of the leaf bones are set to the minimum length of non leaf bones.
2012-07-04 14:22:41 +00:00
b98cb11d22 Created an invisible region that lays over top of the 3d view and can be used for placing floating controls. The controls can't be interacted with yet. 2012-07-03 23:59:49 +00:00
522fa17972 Fix rake overlay for image editor 2012-07-03 23:18:49 +00:00
3a20f5ce45 Cleanup, move 2D paint stuff to their own file. 2012-07-03 16:59:27 +00:00
45c6d10a2d Armature Importer fix.
Bone length and tail values.
2012-07-03 16:26:38 +00:00
a9bbf4d3df Fixes for brush size and overlay in image editor 2012-07-03 15:06:14 +00:00
6b2cb71552 merge with trunk 48524 2012-07-03 10:48:04 +00:00
4ad64e7547 ArmatureImporter.cpp refactor. 2012-07-02 20:05:28 +00:00
66f571f824 Export Armature fix.
Instead of exporting pose_mat, exporting arm_mat now.
2012-07-02 09:34:13 +00:00
e200e360f6 Armature Import Fix. 2012-06-30 19:15:18 +00:00
d6c8adcef8 - bf_fbx: fix bug that caused fbx file filter to fail. 2012-06-29 00:24:28 +00:00
28c15e1735 - bf_fbx: FBX gets its own module, menu item and file handling (even though the import function currently just invokes bf_assimp). 2012-06-28 23:31:50 +00:00
061763d18d Fixes to synchronize rake overlay with actual result for texpaint in 3D
view.
2012-06-28 22:42:12 +00:00
3eda0f35bb Added additional manipulators for scaling/translating in two dimensions at once, and added mouseover highlighting for the manipulator handles. 2012-06-28 20:48:18 +00:00
33295c43d1 More shameless hacking, make mapping mode depend on the tool. I really
have to expose support for mapping modes in image paint too. Only area
is really hard to support anyway...Now that overlay sort of works, it's
plain that the overlay is not exactly as it should be for texpaint.
Working out why not.
2012-06-28 20:07:09 +00:00
0045c579c3 Extra/Ultra/Super/Dooper/Uber hackish commit to set mapping mode of
texpaint brushes to tiled, same as they behave currently. Unfortunately
there's no straightforward way to detect which brush goes to which paint
mode so a version patch is hard to write.
2012-06-28 19:38:02 +00:00
111ed9852b Rename sculpt_paint_capabilities to paint_capabilities, only expose
mapping options for sculpt brushes (until properly supported, if ever,
for texpaint too)
2012-06-28 18:45:33 +00:00
b20ddef743 Important! Revert to texture unit 0 before resetting matrix or we get
corruption in the viewport on rake or rotated brushes.
2012-06-28 18:36:49 +00:00
295ab026d8 Constraint export modification. 2012-06-28 05:33:09 +00:00
0caf9d4ac7 Overlay for Tiled style brushes. The implementation uses openGL
multitexture to minimize texture uploads. The curve strength is written
to a separate texture and modulated with the view texture at runtime.
Unfortunately, I haven't found a way to get a consistent result with the
rest of the brushes because this would require inverting the alpha after
the texture combine operation.
2012-06-26 18:06:42 +00:00
079e43a35e Fixes, still not there, fighting with TexEnv currently 2012-06-26 16:49:52 +00:00
78f3454833 Add code to properly support tiled mode overlay. Not functional yet but
I am positive it's a matter of a few glTexEnv tweaks
2012-06-26 16:15:16 +00:00
f5b358ea00 A slightly different way of dealing with the shift problem that doesn't involve a hack. It also changes the design of the layer buttons slightly such that clicking one doesn't automatically reset the others, which I think may be a usability improvement anyway as their purpose is to act like layers, which should be independent of each other. To make up for this I've added a ctrl-click which acts as before, selecting a single layer to the exclusion of others. 2012-06-26 01:18:30 +00:00
0a584f991d Clicking on an object in an unselected scene would select the scene but not the object, this is now fixed. 2012-06-25 21:44:42 +00:00
63c3221343 Cleanup: Setting to use mask texture. Only expose texture option if the
option is ticked.
2012-06-25 21:22:36 +00:00
861592eb05 Fix numbers in the color bars not updating when the black and white buttons are pressed. 2012-06-25 21:08:45 +00:00
1083be35cf merge with trunk 48272 2012-06-25 14:38:19 +00:00
f2dabad45b Matrix node transform import fix. 2012-06-23 17:44:28 +00:00
bf50e84c1f Fix drag related problems that cropped up after the non-modal patch. 2012-06-23 00:05:49 +00:00
1191e4dfc5 More unification of paint cursor code. Move image editor zoom factor to
paint_draw_cursor.
2012-06-22 22:39:17 +00:00
21d5e29ae4 Unification of display functions for sculpt/image paint. Still it errors out in a few cases. Investigating 2012-06-22 21:47:35 +00:00
dfa5cefbb2 This fixes some of the problems associated with r48184, the drag-toggle patch 2012-06-22 21:10:43 +00:00
5b1ae63f4c Refactoring: Move Sculpt variables that deal with brush drawing to
inified paint settings in preparation to unification of display
function.
2012-06-22 19:40:58 +00:00
dd2475fce6 constraint animation export fix. 2012-06-22 19:20:40 +00:00
d281a2621a Looks like there has already been a setting for preserving the brush
size. I will use that instead for radius sync. In Sculpt mode it uses
projection to mesh to make things work. Doing collision detection on
other modes may not be practical due to lack of acceleration routinces.
2012-06-22 18:44:08 +00:00
b6d13803c6 Refactoring. 2012-06-22 18:19:30 +00:00
5fb5a1e262 More renaming missed 2012-06-22 17:51:47 +00:00
f0ab977f0b Constraint Animation export fix, with Node of objects, 2012-06-22 17:41:59 +00:00
5e38ae4d1f Rename 'Zoom Scale' to 'Radius Sync' 2012-06-22 16:54:01 +00:00
fae40f3218 Texture masks
==============
Mask support for image editor
2012-06-22 16:53:34 +00:00
4f79b0f058 2012-06-22 15:43:51 +00:00
2777cd63eb fix for broken merge 2012-06-22 12:11:32 +00:00
5b5fa99578 Extended r48184 to work with RNA property buttons as well. 2012-06-22 02:59:07 +00:00
01d6919dc6 Clicking and dragging an a series of toggle buttons with the same function toggles them all to the same state. Works for lots of different kinds of toggle buttons, such as the layout buttons, buttons in the outliner, and listbox buttons. State variables are stored in G, which is perhaps not appropriate, but is the best place I've found so far to store such things. 2012-06-22 02:43:40 +00:00
0d59599afd I'm not sure G is the best place to store this, but it's an improvement over RNA. 2012-06-22 00:04:31 +00:00
d8f1a71f46 Texture paint mask textures
============================
* rename alpha_mtex property to mask_mtex
* More forgotten initialization stuff
* do_versions code to initialize the mask properly
* Mask works now :).

I need to expose more properties for mask textures so that they can be
modified independently. Also I need to see how to modify the properties
panel to accomodate the new brush texture type
2012-06-20 20:07:28 +00:00
0c4bdde377 Texture paint mask textures
============================
* Add initialization and file save/load code
2012-06-20 17:52:09 +00:00
fc8ed3855a forgot label for image editor 2012-06-20 17:35:00 +00:00
e8e131171e Separate Alpha Masks
=====================
Add GUI that exposes an extra slot for alpha mtex slot in brushes. Only
shown for texture painting.
2012-06-20 17:32:25 +00:00
a37e9d2b09 Add the listbox X for shape keys. 2012-06-19 21:01:20 +00:00
c60787634c Brush zoom resize
==================
* Account for float to int conversion and also clamp the result to 5
pixels or scaling up won't work after scaling to a very small size
2012-06-19 17:21:59 +00:00
50bf24a903 Brush Zoom Scale
=================
* initial commit, enabled for all paint modes. Pending code to make zoom
to mouse position slightly better. For projection viewport it is a
impossible to get the same brush radius on a different view than the one
we have currently though.
2012-06-19 17:21:43 +00:00
6a86d86c99 merge with trunk 48082 2012-06-19 15:01:28 +00:00
d7b3f43807 Add an X button to the screen and scene dropdowns that allow the user to delete screens and scenes without switching to them. 2012-06-19 06:11:52 +00:00
2940b11668 Texture Size Randomize
======================
* Refactor the code to be less obtrusive to other modes. If a randomized
size is required, it is explicitly requested. I will probably have to
change the texture sample functions too to explicitly return a
randomized result.
2012-06-15 13:40:17 +00:00
ba693b08c5 revert brush size randomize commit, it interferes with other modes badly. 2012-06-15 12:49:48 +00:00
8c626fe487 - bf_assimp: blender now reads the list of supported file extensions directly from assimp. 2012-06-14 23:41:07 +00:00
5468474e1d export of constraint targets to COLLADA 2012-06-14 20:15:55 +00:00
43c5b2903e Texpaint tools
===============
* Highly experimental but useful feature. Random brush size during
stroke. This can be quite useful for texture authoring but it may cause
strange things to happen if not configured right. State and memory
allocations (which makes the tool experimental) often depend on brush
size so I made a function to get the non-randomized size too. I will
most likely change the naming so that BKE_brush_size returns the non-
Still no crashes here and a few very cool things can be done with this
brush setting :)
2012-06-14 14:19:05 +00:00
cb87b8b3f7 Rake brushes for texture paint
==============================
* port brushes correctly to projection painting
* put rake state to unified settings, it's probably the most accessible
place for texpaint/sculpt/display functions. Ideally I would put these
in the paint or brush structs but since these are actually screen-space
state they can be unique for each space and common to all brushes. This
is in preparation to unifying brush draw code.
2012-06-14 11:47:22 +00:00
7b183d0ed1 forgot this brush rotation, remove debug printf 2012-06-14 11:47:11 +00:00
ee7ba49462 Remove remaining merge conflict marker and fix an error caused by renaming of a variable. Needs check by Phabtar! 2012-06-14 08:24:51 +00:00
aa7db6c9cb add missing files from merge 2012-06-14 07:53:52 +00:00
5aeb130df6 merge with trunk r47866 2012-06-14 07:22:39 +00:00
e03c1adfa9 export constraint to COLLADA edit. 2012-06-14 03:43:11 +00:00
c8a1077264 Added X's for deleting vertex groups. 2012-06-14 02:21:21 +00:00
46f66fe5fd Added X's for deleting render layers. 2012-06-14 01:52:53 +00:00
f287c1d04c Added X's for deleting keying sets. 2012-06-14 01:22:48 +00:00
5b32f6a210 Add R key to change rotation type for texpaint brushes 2012-06-13 19:56:13 +00:00
833f3262eb Move transform apply code to recalcData_view3d 2012-06-13 18:56:31 +00:00
f2810202e8 Add X buttons in the material slots list box to delete a specific material slot without selecting it. 2012-06-13 06:35:50 +00:00
53fc210dd3 Don't lose the return value from this call to ui_handle_button_event 2012-06-12 06:35:12 +00:00
61db28bef7 UV transform correction tool
============================
* Fix support for stitches.
2012-06-11 23:16:41 +00:00
5c0b0765a1 UV transform Correction tool
=============================
* initial support for uv islands. There are still a few weird results
that I have to look into. This commit makes it so that only one island
gets the "best" fit, others get a simple average. This is not the best
solution for external out of face displacement so I will most probably
work out a solution. There are already some sketches of code for this
2012-06-11 23:16:34 +00:00
8f0c324db4 UV transform correction tool
============================
* change uv information struct to use loops instead of uvs and iterate
over this struct instead of over the loops. This change is needed
because now we sort the loops according to island
2012-06-11 23:16:25 +00:00
b47344d5e1 UV transform correction tool
=============================
* Sort UVs according to island, this will save some time and pain when
flushing uvs of separate uv islands
* Cleanup unneeded assert code and old variables
2012-06-11 23:16:05 +00:00
9effec5f26 Fix rendering corruption when trying to merge an split with multiple areas on one side. For now this is disabled, hopefully later I'll get around to making a patch that allows the user to join multiple areas at once. 2012-06-11 22:09:15 +00:00
e0976e3b0f UV transform correction tool
=============================
* Fix transformations to choose correct face, also comment some annoying
debug code. With this commit the tool should work very well for interior
vertices. Coming next: seam support. Final tweak will be done to support
exterior vertex moving.
2012-06-11 18:40:55 +00:00
6b0c7a76e7 Enable Ctrl-F for rake brushes 2012-06-11 17:53:59 +00:00
aa637b4b53 merge with trunk -r47747 2012-06-11 17:06:17 +00:00
32787351ee UV transform correction tool
=============================
* fix the projection in uv space and some fixes for selecting the face
to project on. The code still does the wrong choise sometimes.
2012-06-10 09:10:56 +00:00
40d928cfe2 This was preventing panels in the 3D view from animating open and closed. 2012-06-09 20:20:41 +00:00
e2da1a0332 Texture Rake brushes
====================
* Random angle for brushes
2012-06-09 15:32:24 +00:00
a4acc62346 Texture rake brushes
====================
* User angle option now usable.
2012-06-09 12:56:54 +00:00
8b814caad0 Bake Object Animation export Fix. 2012-06-08 19:24:11 +00:00
c541cee5c5 Texture rake brushes for texture paint mode
===========================================
* Reading into the code, i am starting to get the hang of what is going
on :)
* I disabled the texture rake for projection paint because it didn't
work too well (will check why next). I suspect a sampling offset issue.
So I started implementing rake brushes for regular non-projective
texturing and uv/image viewwer. This commit makes this work :). I will
probably have to move the rotation part from the BKE_brush_sample_tex
function and modify the coordinates directly. This will ensure that for
projective or even fixed mode texturing this will work as expected (?)
2012-06-08 16:26:46 +00:00
ebe84e5f3f merge the paint fix 2012-06-08 13:08:58 +00:00
1f36116aac merge with trunk 47606 2012-06-08 12:41:07 +00:00
f967d9fb93 Texture Rake for texture painting
=================================
* Do some initial coding and exposing of the tool for the user. The
result is again, jumpy, still it will provide a good base so commiting.
I will need to cleanup which options appear to the user as well.

LOTS of state for texture painting, I will have to verify that I am
touching the right state.
2012-06-06 19:49:25 +00:00
edb8514495 Tweak for the previous patch. Loading factory settings should load userprefs as well. 2012-06-06 18:55:44 +00:00
5de103d589 Preferences are saved independently from the default startup project. The preferences file omits most other data blocks and saves only user preferences. It's loaded before the startup blend is loaded, and the preferences information in the startup blend isn't loaded. "Save to defaults" in the preferences screen saves to the preferences blend instead of the default blend. Saving the homefile was renamed from "Save User Settings" to "Save Start-Up Project" for clarity. 2012-06-06 18:16:53 +00:00
63887f1c0f merge with trunk 47515 2012-06-06 14:01:01 +00:00
0481a56416 Allow activating the area move operator while pressing CTRL to facilitate the CTRL-blocking-merge bit. 2012-06-06 01:34:54 +00:00
4b946c9690 Dragging areas closed may be disabled by holding the ctrl key. 2012-06-05 23:50:05 +00:00
734764ab7b UV Transform Correction tool
============================
* better algorithm that relies on finding closest face to moved vertex.
The code then projects the translation vector to the edge vectors space
to calculate the uv translation. This code looks more promising than the
previous one but the result still is a bit jumpy, due to the math being
a bit tricky probably and some corner case not handled.
2012-06-05 22:53:17 +00:00
bf3d8885f7 UV transform correction tool
============================
* Fix for proportional editing. It seems that the reason that the tool
didn't work for proportional editing was that TransformData are sorted
making editvert indices invalid. I thought that BMVerts were sorted
instead, then I realized that they are not used during transform. I
wrestled with the idea of copying the indices during sort to avoid
storing the initial positions of BM_Verts again but I didn't want to
slow it down. Copying the coordinates of the vertices instead uses a bit
more memory (96 instead of 64 bits for 64 bit pointer) but does the
trick. 
* Also removed a lot of debug stuff.
2012-06-05 22:38:22 +00:00
b7f082040d merge with trunk to resolve any unlikely mask transform conflicts with UV transform correction tool 2012-06-05 15:30:48 +00:00
a5dfc9895e Fix for r47301. Not handling this return value caused text areas to misbehave. 2012-06-05 05:09:48 +00:00
01b461279d Don't allow the user to auto-close the info area. Most users want it always open and new users don't want to accidentally close it. 2012-06-05 04:41:37 +00:00
3e0263009c merge with trunk 47382 2012-06-03 19:10:19 +00:00
fe36c75000 Bake Object constraint animations. 2012-06-03 17:10:36 +00:00
61572a4233 Fix for r47301 2012-06-02 16:52:01 +00:00
1eb0936e20 Fix for using the scroll wheel on and around color pickers and menus, after the non-modal change. Hovering the mouse over the color picker/menu will scroll in the picker/menu, and hovering the mouse elsewhere will scroll whatever's underneath. Relies on r47251 2012-05-31 21:45:46 +00:00
3cc214b41d UV transform correction tool
============================
* Allow edge ratios to be negative, allows for better displacement when
leaving the boundaries of the uv islands a vertex is in.
* minor cleanup of unused variables.
2012-05-31 09:08:09 +00:00
b4b930c240 UV transforc correction tool
============================
* Next set of corrections that makes multiple selection + transform much
more robust. Calcualate final edge length based on initial position of
vertex on the other side of the loop.
2012-05-31 08:38:14 +00:00
60c89c54cc UV transform correction tool
=============================
* Getting a MUCH better result by projecting the final edges on the
initial edges and then getting the ratio between final/initial length
2012-05-31 08:16:33 +00:00
f75c55da10 This is an experimental patch to remove the modality of menus and other popup regions. It also activates and presses any button under the mouse cursor even though a menu is up. One effect of this is that the user can open one menu and then click to open a second without closing the first. 2012-05-31 04:43:25 +00:00
07a2f208b5 Two buttons on the color picker to choose black and white. No icons exist yet and I can't figure how to set the color, so I marked the buttons with W and B for now. 2012-05-30 23:00:03 +00:00
6f0c31f58c Fix color wheel not closing when the mouse moves away. Looks like this was caused by an oversight in r24808. 2012-05-30 18:50:16 +00:00
d97fe70ec7 UV Transform Correction tool
=============================
*support for cancel that restores uvs of vertices
2012-05-30 18:40:35 +00:00
b49100ae5f Fix crash when not in edit mode and correct uvs is on 2012-05-30 18:21:54 +00:00
81756f32a9 UV Transform Correction tool
==============================
* First functional tool. Looks that since we count each edge twice, we
need to count the loops only once instead of twice. This is weird to me
but it works.

TODOS:
* support for cancel. Right now uvs stay in their modified state when
cancelling the transform.
* support for uvs on stitches.
* Check how this plays with edge slide
2012-05-30 17:57:13 +00:00
55539ec70f UV transform correction tool
=============================
Do a calculation of edge length for both loops of each face. Still
giving the wrong results but this is needed
2012-05-30 17:18:50 +00:00
69be2f51a2 Revert tooltips so I can do it the right way 2012-05-30 16:37:12 +00:00
e68b07f8d9 UV transform correction tool
=============================
* Made transform somewhat better, but still nt correct.
* Added notifier so that uv editor gets refreshed on transform
2012-05-30 15:14:18 +00:00
c5a426c5a5 UV transform correction tool
============================
*Fixed crashers due to wrong indices (been there, done that) and enabled
tool.
*Uvs get modified but result is wrong. Investigating.
2012-05-30 14:24:33 +00:00
e6ad102bf9 UV transform correction tool
=============================
Commit work so far to have a stable backup where I
can diff against. The first part of the tool should be "finished" but
the code is disabled because i get crashes. I expect that when I resolve
the crashes I will at least have a working tool for uvs that do not
reside on stitches. Due to my misdesigning the tool I didn't account for
that but it will be added later, plus it will be a good test to see if
the principle works.
2012-05-30 13:22:51 +00:00
233c223fc2 If a tooltip has been open recently, don't hesitate to open another. 2012-05-30 04:26:31 +00:00
a91262499e Close an area by dragging an edge between two areas. Also works while dragging out a new area using the new area handle. 2012-05-29 05:32:59 +00:00
ba9df2c63c - initial assimp importer version. This adds /source/blender/assimp containing a first version of the assimp->blender bridge and /extern/assimp containing the assimp source. See http://wiki.blender.org/index.php/User:Aramis_acg/FBX2012-AssimpIntegration for more details.
# SCons not yet updated!
2012-05-29 03:07:35 +00:00
ebef726fad UV transform correction tool
============================

*Add struct UVTransCorrection for the tool and cleanup code for the
struct.
*After some thought it looks like I cannot use unwrap for this tool
since it will likely invalidate any custom uv layout made by the artist
and replace it with the position from the unwrapper. So I will do it
with the second method, by modifying the uvs based on the ratios of edge
lengths. This will probably require some mathematical correction that I
will have to work on.
2012-05-28 20:18:06 +00:00
e7572d428e UV Transform Correction tool
============================
Minor commit to hook up the new correction code to the transformation
code and fixes ensure that no leaks/crashes/hangs occur.
2012-05-28 16:48:56 +00:00
c261618ffd Tracking constraint Blender Profile for nodes. 2012-05-28 05:25:29 +00:00
d1e187a148 Reuse UVCALC_TRANSFORM_CORRECT as Campbell suggested. I have enabled it
default for now to test with all transforms when ready and will probably
disable for certain transformations later. This resolves #29771.
Also fixed evil crasher due to index variable strolling out of bounds.
2012-05-24 16:21:15 +00:00
dee8f6ea87 svn merge ^/trunk/blender revision 46974 2012-05-24 14:55:39 +00:00
7973e19209 Maintain image transform tool
==================================
Add intermediate function to detect boundary edges that will be
artificially pinned and faces to reunwrap. Still not 100% certain the
reunwrap method will work, still I hope it will do the trick. Still, a
similar function will likely be needed for the second method that I will
use, should the first one fail.
2012-05-21 19:52:41 +00:00
5b421fbc32 Maintain image transform tool
===============================
GUI and RNA options for retain image transform tool. This is known as
"preserve UVs" in other programs, but I find this terminology deceptive
because UVs are, in fact, modified. It is actually the image that is
maintained on the mesh.
2012-05-21 14:05:39 +00:00
459d28a6c4 svn merge ^/trunk/blender -r46037:46826 2012-05-21 06:37:28 +00:00
f8e8078996 new gsoc branch 2012-05-20 15:35:43 +00:00
381 changed files with 8156 additions and 3627 deletions

View File

@@ -120,7 +120,7 @@ option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default (recommend to leave off)" OFF)
mark_as_advanced(WITH_PYTHON) # dont want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a security issue, rather than have them patch it, make a build option.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distrobutions see this as a security issue, rather than have them patch it, make a build option.
option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
@@ -216,6 +216,8 @@ endif()
# 3D format support
# disable opencollada on non-apple unix because opencollada has no package for debian
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" OFF)
option(WITH_ASSIMP "Enable Assimp Support (http://www.assimp.sourceforge.net)" OFF)
option(WITH_FBX "Enable FBX support using Assimp" OFF)
# Sound output
option(WITH_SDL "Enable SDL for sound and joystick support" ON)
@@ -356,6 +358,10 @@ if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
message(FATAL_ERROR "WITH_MOD_OCEANSIM requires WITH_FFTW3 to be ON")
endif()
if(NOT WITH_ASSIMP AND WITH_FBX)
message(FATAL_ERROR "WITH_FBX requires WITH_ASSIMP")
endif()
# may as well build python module without a UI
if(WITH_PYTHON_MODULE)
set(WITH_HEADLESS ON)
@@ -371,7 +377,7 @@ if(WITH_CYCLES OR WITH_MOD_BOOLEAN)
set(WITH_BOOST ON)
endif()
# don't store paths to libs for portable distribution
# don't store paths to libs for portable distrobution
if(WITH_INSTALL_PORTABLE)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
endif()
@@ -566,7 +572,7 @@ if(UNIX AND NOT APPLE)
mark_as_advanced(FFMPEG)
# lame, but until we have proper find module for ffmpeg
# lame, but until we have propper find module for ffmpeg
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
if(EXISTS "${FFMPEG}/include/ffmpeg/")
list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg")
@@ -1010,6 +1016,7 @@ elseif(WIN32)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG_INCLUDE_DIRS
${LIBDIR}/ffmpeg/include
@@ -1303,7 +1310,7 @@ elseif(WIN32)
set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
## DISABLE - causes linking errors
## for re-distribution, so users dont need mingw installed
## for re-distrobution, so users dont need mingw installed
# set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-libgcc -static-libstdc++")
endif()
@@ -1648,13 +1655,12 @@ elseif(APPLE)
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
endif()
if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
else()
set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
@@ -1828,6 +1834,9 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
# # this causes too many warnings, disable
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEFINED -Wundef)
# disable because it gives warnings for printf() & friends.
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
@@ -1838,17 +1847,14 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_LOGICAL_OP -Wlogical-op)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self) # needs -Wuninitialized
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
# causes too many warnings
if(NOT APPLE)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
endif()
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
@@ -2033,6 +2039,8 @@ if(FIRST_RUN)
info_cfg_option(WITH_IK_SOLVER)
info_cfg_option(WITH_IK_ITASC)
info_cfg_option(WITH_OPENCOLLADA)
info_cfg_option(WITH_ASSIMP)
info_cfg_option(WITH_FBX)
info_cfg_option(WITH_FFTW3)
info_cfg_option(WITH_INTERNATIONAL)
info_cfg_option(WITH_INPUT_NDOF)

View File

@@ -262,6 +262,10 @@ BF_OPENGL_LIB = 'GL GLU'
BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
#OpenCollada flags
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'

View File

@@ -148,6 +148,10 @@ BF_OPENGL_LIB = 'GL GLU X11 Xi'
BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = False
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'

View File

@@ -148,6 +148,10 @@ BF_OPENGL_LIB = 'GL GLU X11 Xi'
BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = False
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'

View File

@@ -148,6 +148,10 @@ BF_OPENGL_LIB = 'GL GLU X11 Xi'
BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = False
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'

View File

@@ -182,6 +182,11 @@ BF_OPENGL_LIB = 'GL GLU X11 Xi'
BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = False
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'

View File

@@ -155,6 +155,10 @@ BF_OPENMP = LIBDIR + '/gcc/gomp'
BF_OPENMP_INC = '${BF_OPENMP}/include'
BF_OPENMP_LIBPATH = '${BF_OPENMP}/lib'
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = False
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'

View File

@@ -140,6 +140,10 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a'
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
@@ -201,7 +205,7 @@ LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
## DISABLED, causes linking errors!
## for re-distribution, so users dont need mingw installed
## for re-distrobution, so users dont need mingw installed
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False

View File

@@ -138,6 +138,10 @@ BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'

View File

@@ -137,6 +137,10 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a'
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
@@ -199,7 +203,7 @@ LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
## DISABLED, causes linking errors!
## for re-distribution, so users dont need mingw installed
## for re-distrobution, so users dont need mingw installed
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False

View File

@@ -134,6 +134,10 @@ BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
# note: WITH_BF_FBX==True needs WITH_BF_ASSIMP to be enabled as well
WITH_BF_ASSIMP = False
WITH_BF_FBX = False
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'

View File

@@ -127,6 +127,8 @@ def validate_arguments(args, bc):
'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH', 'WITH_BF_STATICFFTW3', 'BF_FFTW3_LIB_STATIC',
'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
'WITH_BF_COLLADA', 'BF_COLLADA', 'BF_COLLADA_INC', 'BF_COLLADA_LIB', 'BF_OPENCOLLADA', 'BF_OPENCOLLADA_INC', 'BF_OPENCOLLADA_LIB', 'BF_OPENCOLLADA_LIBPATH', 'BF_PCRE', 'BF_PCRE_LIB', 'BF_PCRE_LIBPATH', 'BF_EXPAT', 'BF_EXPAT_LIB', 'BF_EXPAT_LIBPATH',
'WITH_BF_ASSIMP',
'WITH_BF_FBX',
'WITH_BF_PLAYER',
'WITH_BF_NOBLENDER',
'WITH_BF_BINRELOC',
@@ -464,6 +466,9 @@ def read_opts(env, cfg, args):
('BF_EXPAT_LIB', 'Expat library', ''),
('BF_EXPAT_LIBPATH', 'Expat library path', ''),
(BoolVariable('WITH_BF_ASSIMP', 'Build assimp import module if true', False)),
(BoolVariable('WITH_BF_FBX', 'Build fbx import module if true (depends on WITH_BF_ASSIMP)', False)),
(BoolVariable('WITH_BF_JEMALLOC', 'Use jemalloc if true', False)),
(BoolVariable('WITH_BF_STATICJEMALLOC', 'Staticly link to jemalloc', False)),
('BF_JEMALLOC', 'jemalloc base path', ''),
@@ -475,14 +480,6 @@ 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_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', ''),
('BF_3DMOUSE_INC', '3d mouse library include path', ''),
('BF_3DMOUSE_LIB', '3d mouse library', ''),
('BF_3DMOUSE_LIBPATH', '3d mouse library path', ''),
('BF_3DMOUSE_LIB_STATIC', '3d mouse static library', ''),
('CFLAGS', 'C only flags', []),
('CCFLAGS', 'Generic C and C++ flags', []),
('CXXFLAGS', 'C++ only flags', []),
@@ -591,6 +588,14 @@ def read_opts(env, cfg, args):
('BF_BOOST_LIB', 'Boost library', ''),
('BF_BOOST_LIBPATH', 'Boost library path', ''),
('BF_BOOST_LIB_STATIC', 'Boost static library', ''),
(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', ''),
('BF_3DMOUSE_INC', '3d mouse library include path', ''),
('BF_3DMOUSE_LIB', '3d mouse library', ''),
('BF_3DMOUSE_LIBPATH', '3d mouse library path', ''),
('BF_3DMOUSE_LIB_STATIC', '3d mouse static library', ''),
(BoolVariable('WITH_GHOST_XDND', 'Build with drag-n-drop support on Linux platforms using XDND protocol', True)),
(BoolVariable('WITH_BF_COMPOSITOR_LEGACY', 'Enable the legacy compositor', False))

View File

@@ -77,3 +77,7 @@ if(WITH_GHOST_XDND)
add_subdirectory(xdnd)
endif()
endif()
if(WITH_ASSIMP)
add_subdirectory(assimp)
endif()

3
extern/SConscript vendored
View File

@@ -34,6 +34,9 @@ if env['WITH_BF_LIBMV']:
if env['WITH_BF_BOOLEAN']:
SConscript(['carve/SConscript'])
print(env)
if env['WITH_BF_ASSIMP']:
SConscript(['assimp/SConscript'])
if env['WITH_GHOST_XDND']:
# FreeBSD doesn't seems to support XDND protocol

View File

@@ -84,7 +84,7 @@ public:
* Sets the highest passed frequency.
* \param high The highest passed frequency.
*/
void setHigh(float high);
void setHigh(float hight);
virtual AUD_IReader* createReader();
};

View File

@@ -38,7 +38,7 @@ extern "C" {
#endif
/**
* Initializes the Python module.
* Initalizes the Python module.
*/
extern PyObject *AUD_initPython(void);

View File

@@ -59,7 +59,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
col = split.column()
sub = col.column()
sub.active = (device_type == 'NONE' or cscene.device == 'CPU')
sub.enabled = (device_type == 'NONE' or cscene.device == 'CPU')
sub.prop(cscene, "progressive")
sub = col.column(align=True)
@@ -437,7 +437,6 @@ class Cycles_PT_mesh_displacement(CyclesButtonsPanel, Panel):
layout.prop(cdata, "use_subdivision")
layout.prop(cdata, "dicing_rate")
class Cycles_PT_mesh_normals(CyclesButtonsPanel, Panel):
bl_label = "Normals"
bl_context = "data"
@@ -457,7 +456,7 @@ class Cycles_PT_mesh_normals(CyclesButtonsPanel, Panel):
col.prop(mesh, "show_double_sided")
col = split.column()
col.label()
prop.label()
class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel):
@@ -954,7 +953,7 @@ def draw_device(self, context):
layout.prop(cscene, "device")
elif device_type == 'OPENCL' and cscene.feature_set == 'EXPERIMENTAL':
layout.prop(cscene, "device")
if cscene.feature_set == 'EXPERIMENTAL' and cscene.device == 'CPU' and engine.with_osl():
layout.prop(cscene, "shading_system")

View File

@@ -94,7 +94,7 @@ static float blender_camera_focal_distance(BL::Object b_ob, BL::Camera b_camera)
return fabsf(transform_get_column(&mat, 3).z);
}
static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob, bool skip_panorama = false)
static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob)
{
BL::ID b_ob_data = b_ob.data();
@@ -111,10 +111,7 @@ static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob, boo
bcam->type = CAMERA_ORTHOGRAPHIC;
break;
case BL::Camera::type_PANO:
if(!skip_panorama)
bcam->type = CAMERA_PANORAMA;
else
bcam->type = CAMERA_PERSPECTIVE;
bcam->type = CAMERA_PANORAMA;
break;
case BL::Camera::type_PERSP:
default:
@@ -381,7 +378,7 @@ void BlenderSync::sync_camera_motion(BL::Object b_ob, int motion)
/* Sync 3D View Camera */
static void blender_camera_from_view(BlenderCamera *bcam, BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height, bool skip_panorama = false)
static void blender_camera_from_view(BlenderCamera *bcam, BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height)
{
/* 3d view parameters */
bcam->nearclip = b_v3d.clip_start();
@@ -394,7 +391,7 @@ static void blender_camera_from_view(BlenderCamera *bcam, BL::Scene b_scene, BL:
BL::Object b_ob = (b_v3d.lock_camera_and_layers())? b_scene.camera(): b_v3d.camera();
if(b_ob) {
blender_camera_from_object(bcam, b_ob, skip_panorama);
blender_camera_from_object(bcam, b_ob);
/* magic zoom formula */
bcam->zoom = (float)b_rv3d.view_camera_zoom();
@@ -450,7 +447,7 @@ static void blender_camera_border(BlenderCamera *bcam, BL::Scene b_scene, BL::Sp
/* get viewport viewplane */
BlenderCamera view_bcam;
blender_camera_init(&view_bcam);
blender_camera_from_view(&view_bcam, b_scene, b_v3d, b_rv3d, width, height, true);
blender_camera_from_view(&view_bcam, b_scene, b_v3d, b_rv3d, width, height);
blender_camera_viewplane(&view_bcam, width, height,
&view_left, &view_right, &view_bottom, &view_top, &view_aspect, &sensor_size);
@@ -463,7 +460,7 @@ static void blender_camera_border(BlenderCamera *bcam, BL::Scene b_scene, BL::Sp
/* get camera viewplane */
BlenderCamera cam_bcam;
blender_camera_init(&cam_bcam);
blender_camera_from_object(&cam_bcam, b_ob, true);
blender_camera_from_object(&cam_bcam, b_ob);
width = (int)(r.resolution_x()*r.resolution_percentage()/100);
height = (int)(r.resolution_y()*r.resolution_percentage()/100);

View File

@@ -320,7 +320,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
hide = hide || !(ob_layer & scene_layer);
if(!hide) {
progress.set_sync_status("Synchronizing object", (*b_ob).name());
progress.set_status("Synchronizing object", (*b_ob).name());
int num_particles = object_count_particles(*b_ob);
@@ -367,8 +367,6 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
}
}
progress.set_sync_status("");
if(!cancel && !motion) {
sync_background_light();

View File

@@ -125,18 +125,8 @@ __device_inline void kernel_write_light_passes(KernelGlobals *kg, __global float
kernel_write_pass_float3(buffer + kernel_data.film.pass_glossy_color, sample, L->color_glossy);
if(flag & PASS_TRANSMISSION_COLOR)
kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_color, sample, L->color_transmission);
if(flag & PASS_SHADOW) {
float4 shadow = L->shadow;
/* bit of an ugly hack to compensate for emitting triangles influencing
* amount of samples we get for this pass */
if(kernel_data.integrator.progressive && kernel_data.integrator.pdf_triangles != 0.0f)
shadow.w = 0.5f;
else
shadow.w = 1.0f;
kernel_write_pass_float4(buffer + kernel_data.film.pass_shadow, sample, shadow);
}
if(flag & PASS_SHADOW)
kernel_write_pass_float4(buffer + kernel_data.film.pass_shadow, sample, L->shadow);
#endif
}

View File

@@ -196,18 +196,7 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int
else if(components == 3) {
assert(pass.components == 4);
/* RGBA */
if(type == PASS_SHADOW) {
for(int i = 0; i < size; i++, in += pass_stride, pixels += 3) {
float4 f = make_float4(in[0], in[1], in[2], in[3]);
float invw = (f.w > 0.0f)? 1.0f/f.w: 1.0f;
pixels[0] = f.x*invw;
pixels[1] = f.y*invw;
pixels[2] = f.z*invw;
}
}
else if(pass.divide_type != PASS_NONE) {
if(pass.divide_type != PASS_NONE) {
/* RGB lighting passes that need to divide out color */
pass_offset = 0;
foreach(Pass& color_pass, params.passes) {

View File

@@ -366,10 +366,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
device_vector<float4>& tex_img = dscene->tex_float_image[slot];
if(tex_img.device_pointer) {
thread_scoped_lock device_lock(device_mutex);
if(tex_img.device_pointer)
device->tex_free(tex_img);
}
if(!file_load_float_image(img, tex_img)) {
/* on failure to load, we set a 1x1 pixels pink image */
@@ -386,10 +384,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
if(slot >= 10) name = string_printf("__tex_image_float_0%d", slot);
else name = string_printf("__tex_image_float_00%d", slot);
if(!pack_images) {
thread_scoped_lock device_lock(device_mutex);
if(!pack_images)
device->tex_alloc(name.c_str(), tex_img, true, true);
}
}
else {
string filename = path_filename(images[slot - tex_image_byte_start]->filename);
@@ -397,10 +393,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
device_vector<uchar4>& tex_img = dscene->tex_image[slot - tex_image_byte_start];
if(tex_img.device_pointer) {
thread_scoped_lock device_lock(device_mutex);
if(tex_img.device_pointer)
device->tex_free(tex_img);
}
if(!file_load_image(img, tex_img)) {
/* on failure to load, we set a 1x1 pixels pink image */
@@ -417,10 +411,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
if(slot >= 10) name = string_printf("__tex_image_0%d", slot);
else name = string_printf("__tex_image_00%d", slot);
if(!pack_images) {
thread_scoped_lock device_lock(device_mutex);
if(!pack_images)
device->tex_alloc(name.c_str(), tex_img, true, true);
}
}
img->need_load = false;
@@ -448,27 +440,15 @@ void ImageManager::device_free_image(Device *device, DeviceScene *dscene, int sl
#endif
}
else if(is_float) {
device_vector<float4>& tex_img = dscene->tex_float_image[slot];
if(tex_img.device_pointer) {
thread_scoped_lock device_lock(device_mutex);
device->tex_free(tex_img);
}
tex_img.clear();
device->tex_free(dscene->tex_float_image[slot]);
dscene->tex_float_image[slot].clear();
delete float_images[slot];
float_images[slot] = NULL;
}
else {
device_vector<uchar4>& tex_img = dscene->tex_image[slot - tex_image_byte_start];
if(tex_img.device_pointer) {
thread_scoped_lock device_lock(device_mutex);
device->tex_free(tex_img);
}
tex_img.clear();
device->tex_free(dscene->tex_image[slot - tex_image_byte_start]);
dscene->tex_image[slot - tex_image_byte_start].clear();
delete images[slot - tex_image_byte_start];
images[slot - tex_image_byte_start] = NULL;
@@ -480,7 +460,7 @@ void ImageManager::device_update(Device *device, DeviceScene *dscene, Progress&
{
if(!need_update)
return;
TaskPool pool;
for(size_t slot = 0; slot < images.size(); slot++) {
@@ -562,9 +542,9 @@ void ImageManager::device_free(Device *device, DeviceScene *dscene)
device_free_image(device, dscene, slot);
device->tex_free(dscene->tex_image_packed);
device->tex_free(dscene->tex_image_packed_info);
dscene->tex_image_packed.clear();
device->tex_free(dscene->tex_image_packed_info);
dscene->tex_image_packed_info.clear();
images.clear();

View File

@@ -22,7 +22,6 @@
#include "device_memory.h"
#include "util_string.h"
#include "util_thread.h"
#include "util_vector.h"
CCL_NAMESPACE_BEGIN
@@ -67,7 +66,6 @@ private:
int tex_num_images;
int tex_num_float_images;
int tex_image_byte_start;
thread_mutex device_mutex;
struct Image {
string filename;

View File

@@ -67,19 +67,13 @@ static void dump_background_pixels(Device *device, DeviceScene *dscene, int res,
main_task.shader_x = 0;
main_task.shader_w = width*height;
/* disabled splitting for now, there's an issue with multi-GPU mem_copy_from */
#if 0
list<DeviceTask> split_tasks;
main_task.split_max_size(split_tasks, 128*128);
main_task.split_max_size(split_tasks, 128*128);
foreach(DeviceTask& task, split_tasks) {
device->task_add(task);
device->task_wait();
}
#else
device->task_add(main_task);
device->task_wait();
#endif
device->mem_copy_from(d_output, 0, 1, d_output.size(), sizeof(float4));
device->mem_free(d_input);

View File

@@ -43,8 +43,6 @@ public:
tile_time = 0.0f;
status = "Initializing";
substatus = "";
sync_status = "";
sync_substatus = "";
update_cb = NULL;
cancel = false;
cancel_message = "";
@@ -166,42 +164,11 @@ public:
set_update();
}
void set_sync_status(const string& status_, const string& substatus_ = "")
{
{
thread_scoped_lock lock(progress_mutex);
sync_status = status_;
sync_substatus = substatus_;
total_time = time_dt() - start_time;
}
set_update();
}
void set_sync_substatus(const string& substatus_)
{
{
thread_scoped_lock lock(progress_mutex);
sync_substatus = substatus_;
total_time = time_dt() - start_time;
}
set_update();
}
void get_status(string& status_, string& substatus_)
{
thread_scoped_lock lock(progress_mutex);
if(sync_status != "") {
status_ = sync_status;
substatus_ = sync_substatus;
}
else {
status_ = status;
substatus_ = substatus;
}
status_ = status;
substatus_ = substatus;
}
/* callback */
@@ -235,9 +202,6 @@ protected:
string status;
string substatus;
string sync_status;
string sync_substatus;
volatile bool cancel;
string cancel_message;
};

View File

@@ -275,8 +275,7 @@ def enable(module_name, default_set=True, persistent=False):
try:
mod.register()
except:
print("Exception in module register(): %r" %
getattr(mod, "__file__", module_name))
print("Exception in module register(): %r" % getattr(mod, "__file__", module_name))
handle_error()
del sys.modules[module_name]
return None
@@ -318,8 +317,7 @@ def disable(module_name, default_set=True):
try:
mod.unregister()
except:
print("Exception in module unregister(): %r" %
getattr(mod, "__file__", module_name))
print("Exception in module unregister(): %r" % getattr(mod, "__file__", module_name))
import traceback
traceback.print_exc()
else:

View File

@@ -16,7 +16,7 @@
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>
# <pep8-80 compliant>
# Write out messages.txt from Blender.
# XXX: This script is meant to be used from inside Blender!
@@ -43,7 +43,6 @@ UNDOC_OPS_STR = settings.UNDOC_OPS_STR
NC_ALLOWED = settings.WARN_MSGID_NOT_CAPITALIZED_ALLOWED
def check(check_ctxt, messages, key, msgsrc):
if check_ctxt is None:
return
@@ -79,8 +78,7 @@ def dump_messages_rna(messages, check_ctxt):
import bpy
def classBlackList():
blacklist_rna_class = [
# core classes
blacklist_rna_class = [# core classes
"Context", "Event", "Function", "UILayout",
"BlendData",
# registerable classes

View File

@@ -162,9 +162,9 @@ def main():
" {} specific context{} present:\n {}\n"
"".format(glob_stats["nbr"], glob_stats["lvl"] / glob_stats["nbr"],
glob_stats["lvl_ttips"] / glob_stats["nbr"],
glob_stats["lvl_trans_ttips"] / glob_stats["nbr"],
glob_stats["lvl_ttips_in_trans"] / glob_stats["nbr"],
glob_stats["lvl_comm"] / glob_stats["nbr"], glob_stats["nbr_signs"],
glob_stats["lvl_trans_ttips"]/glob_stats["nbr"],
glob_stats["lvl_ttips_in_trans"]/glob_stats["nbr"],
glob_stats["lvl_comm"]/glob_stats["nbr"], glob_stats["nbr_signs"],
glob_stats["nbr_trans_signs"], nbr_contexts, _ctx_txt,
"\n ".join(glob_stats["contexts"]-{""})))

View File

@@ -95,6 +95,7 @@ def parse_messages(fname):
msgctxt_lines = []
comment_lines = []
def finalize_message():
nonlocal reading_msgid, reading_msgstr, reading_msgctxt, \
reading_comment, is_fuzzy, is_translated, is_commented, \
@@ -224,6 +225,7 @@ def parse_messages(fname):
if reading_msgstr:
finalize_message()
return (messages,
{"trans_msg": translated_messages,
"fuzzy_msg": fuzzy_messages,

View File

@@ -59,7 +59,6 @@ import addon_utils as _addon_utils
_script_module_dirs = "startup", "modules"
def _test_import(module_name, loaded_modules):
use_time = _bpy.app.debug_python
@@ -616,15 +615,12 @@ def _blender_default_map():
# hooks for doc lookups
_manual_map = [_blender_default_map]
def register_manual_map(manual_hook):
_manual_map.append(manual_hook)
def unregister_manual_map(manual_hook):
_manual_map.remove(manual_hook)
def manual_map():
# reverse so default is called last
for cb in reversed(_manual_map):
@@ -637,3 +633,4 @@ def manual_map():
continue
yield prefix, url_manual_mapping

View File

@@ -304,7 +304,7 @@ def copy_as_script(context):
for line in sc.scrollback:
text = line.body
type = line.type
if type == 'INFO': # ignore autocomp.
continue
if type == 'INPUT':

View File

@@ -259,7 +259,7 @@ def xml2rna(root_xml,
except ValueError:
try:
value_xml_coerce = [float(v) for v in value_xml_split]
except ValueError: # bool vector property
except ValueError: # bool vector property
value_xml_coerce = [{'TRUE': True, 'FALSE': False}[v] for v in value_xml_split]
del value_xml_split
tp_name = 'ARRAY'

View File

@@ -7,6 +7,7 @@ bpy.context.user_preferences.view.use_zoom_to_mouse = False
bpy.context.user_preferences.view.use_rotate_around_active = False
bpy.context.user_preferences.edit.use_drag_immediately = False
bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
bpy.context.user_preferences.edit.floating_controls = 'BOTTOM'
bpy.context.user_preferences.inputs.select_mouse = 'RIGHT'
bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
bpy.context.user_preferences.inputs.view_zoom_axis = 'VERTICAL'

View File

@@ -3,6 +3,7 @@ import bpy
bpy.context.user_preferences.edit.use_drag_immediately = True
bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
bpy.context.user_preferences.edit.floating_controls = 'BOTTOM'
bpy.context.user_preferences.inputs.select_mouse = 'LEFT'
bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
bpy.context.user_preferences.inputs.view_zoom_axis = 'HORIZONTAL'

View File

@@ -9,7 +9,6 @@
handle_auto="#909000"
handle_sel_auto="#f0ff40"
bone_pose="#50c8ff"
bone_pose_active="#8cffff"
bone_solid="#c8c8c8"
bundle_solid="#c8c8c8"
camera="#000000"

View File

@@ -9,7 +9,6 @@
handle_auto="#909000"
handle_sel_auto="#f0ff40"
bone_pose="#50c8ff"
bone_pose_active="#8cffff"
bone_solid="#c8c8c8"
bundle_solid="#c8c8c8"
camera="#000000"

View File

@@ -9,7 +9,6 @@
handle_auto="#909000"
handle_sel_auto="#f0ff40"
bone_pose="#50c8ff"
bone_pose_active="#8cffff"
bone_solid="#c8c8c8"
bundle_solid="#c8c8c8"
camera="#000000"

View File

@@ -9,7 +9,6 @@
handle_auto="#909000"
handle_sel_auto="#f0ff40"
bone_pose="#50c8ff"
bone_pose_active="#8cffff"
bone_solid="#c8c8c8"
bundle_solid="#c8c8c8"
camera="#000000"

View File

@@ -9,7 +9,6 @@
handle_auto="#909000"
handle_sel_auto="#f0ff40"
bone_pose="#50c8ff"
bone_pose_active="#8cffff"
bone_solid="#c8c8c8"
bundle_solid="#c8c8c8"
camera="#000000"

View File

@@ -14,4 +14,4 @@ settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
settings.default_correlation_min = 0.6
settings.default_correlation_min = 0.6

View File

@@ -14,4 +14,4 @@ settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
settings.default_correlation_min = 0.75
settings.default_correlation_min = 0.75

View File

@@ -14,4 +14,4 @@ settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
settings.default_correlation_min = 0.6
settings.default_correlation_min = 0.6

View File

@@ -14,4 +14,4 @@ settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
settings.default_correlation_min = 0.75
settings.default_correlation_min = 0.75

View File

@@ -22,16 +22,12 @@ import bpy
from bpy.types import Operator
from bpy.props import EnumProperty
# XXX These node item lists should actually be generated by a callback at
# operator execution time (see node_type_items below),
# using the active node tree from the context.
# Due to a difficult bug in bpy this is not possible
# (item list memory gets freed too early),
# XXX These node item lists should actually be generated by a callback at operator execution time (see node_type_items below),
# using the active node tree from the context. Due to a difficult bug in bpy this is not possible (item list memory gets freed too early),
# so for now just copy the static item lists to these global variables.
#
# In the custom_nodes branch, the static per-tree-type node items are replaced
# by a single independent type list anyway (with a poll function to limit node
# types to the respective trees). So this workaround is only temporary.
# In the custom_nodes branch, the static per-tree-type node items are replaced by a single independent type list anyway (with a poll function
# to limit node types to the respective trees). So this workaround is only temporary.
# lazy init
node_type_items_dict = {}
@@ -43,21 +39,18 @@ node_group_prefix = 'GROUP_'
# Generate a list of enum items for a given node class
# Copy existing type enum, adding a prefix to distinguish from node groups
# Skip the base node group type,
# node groups will be added below for all existing group trees
# Skip the base node group type, node groups will be added below for all existing group trees
def node_type_items(node_class):
return [(node_type_prefix + item.identifier, item.name, item.description)
for item in node_class.bl_rna.properties['type'].enum_items
if item.identifier != 'GROUP']
for item in node_class.bl_rna.properties['type'].enum_items if item.identifier != 'GROUP']
# Generate items for node group types
# Filter by the given tree_type
# Node group trees don't have a description property yet
# (could add this as a custom property though)
# Node group trees don't have a description property yet (could add this as a custom property though)
def node_group_items(tree_type):
return [(node_group_prefix + group.name, group.name, '')
for group in bpy.data.node_groups if group.type == tree_type]
for group in bpy.data.node_groups if group.type == tree_type]
# Returns the enum item list for the edited tree in the context
@@ -78,11 +71,7 @@ def node_type_items_cb(self, context):
})
# XXX Does not work correctly, see comment above
'''
return [(item.identifier, item.name, item.description, item.value)
for item in
tree.nodes.bl_rna.functions['new'].parameters['type'].enum_items]
'''
#return [(item.identifier, item.name, item.description, item.value) for item in tree.nodes.bl_rna.functions['new'].parameters['type'].enum_items]
if tree.type in node_type_items_dict:
return node_type_items_dict[tree.type] + node_group_items(tree.type)
@@ -96,8 +85,7 @@ class NODE_OT_add_search(Operator):
bl_label = "Search and Add Node"
bl_options = {'REGISTER', 'UNDO'}
# XXX this should be called 'node_type' but the operator search
# property is hardcoded to 'type' by a hack in bpy_operator_wrap.c ...
# XXX this should be called 'node_type' but the operator search property is hardcoded to 'type' by a hack in bpy_operator_wrap.c ...
type = EnumProperty(
name="Node Type",
description="Node type",
@@ -110,17 +98,14 @@ class NODE_OT_add_search(Operator):
space = context.space_data
tree = space.edit_tree
# Enum item identifier has an additional prefix to
# distinguish base node types from node groups
# Enum item identifier has an additional prefix to distinguish base node types from node groups
item = self.type
if item.startswith(node_type_prefix):
# item means base node type
node = tree.nodes.new(type=item[len(node_type_prefix):])
elif item.startswith(node_group_prefix):
# item means node group type
node = tree.nodes.new(
type='GROUP',
group=bpy.data.node_groups[item[len(node_group_prefix):]])
node = tree.nodes.new(type='GROUP', group=bpy.data.node_groups[item[len(node_group_prefix):]])
else:
return None
@@ -148,8 +133,7 @@ class NODE_OT_add_search(Operator):
v2d = context.region.view2d
# convert mouse position to the View2D for later node placement
space.cursor_location = v2d.region_to_view(event.mouse_region_x,
event.mouse_region_y)
space.cursor_location = v2d.region_to_view(event.mouse_region_x, event.mouse_region_y)
context.window_manager.invoke_search_popup(self)
return {'CANCELLED'}

View File

@@ -216,7 +216,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def DISPLACE(self, layout, ob, md):
has_texture = (md.texture is not None)
split = layout.split()
col = split.column()

View File

@@ -185,7 +185,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
split = col.box().split()
col = split.column()
col.prop(group, "layers", text="Dupli Visibility")
col.prop(group, "layers", text="Dupli")
col = split.column()
col.prop(group, "dupli_offset", text="")

View File

@@ -70,26 +70,27 @@ class UnifiedPaintPanel():
# Used in both the View3D toolbar and texture properties
def sculpt_brush_texture_settings(layout, brush):
def brush_texture_settings(layout, brush, sculpt):
tex_slot = brush.texture_slot
layout.label(text="Brush Mapping:")
# map_mode
layout.row().prop(tex_slot, "map_mode", text="")
layout.separator()
if sculpt:
layout.row().prop(tex_slot, "map_mode", text="")
layout.separator()
# angle and texture_angle_source
col = layout.column()
col.active = brush.sculpt_capabilities.has_texture_angle_source
col.active = brush.paint_capabilities.has_texture_angle_source
col.label(text="Angle:")
if brush.sculpt_capabilities.has_random_texture_angle:
if brush.paint_capabilities.has_random_texture_angle:
col.prop(brush, "texture_angle_source_random", text="")
else:
col.prop(brush, "texture_angle_source_no_random", text="")
col = layout.column()
col.active = brush.sculpt_capabilities.has_texture_angle
col.active = brush.paint_capabilities.has_texture_angle
col.prop(tex_slot, "angle", text="")
# scale and offset
@@ -101,3 +102,19 @@ def sculpt_brush_texture_settings(layout, brush):
col = layout.column(align=True)
col.label(text="Sample Bias:")
col.prop(brush, "texture_sample_bias", slider=True, text="")
def brush_mask_texture_settings(layout, brush):
mask_tex_slot = brush.mask_texture_slot
if(brush.mask_texture):
layout.label(text="Mask Mapping:")
col = layout.column()
col.active = brush.paint_capabilities.has_texture_angle
col.prop(mask_tex_slot, "angle", text="")
# scale and offset
split = layout.split()
split.prop(mask_tex_slot, "offset")
split.prop(mask_tex_slot, "scale")

View File

@@ -316,6 +316,7 @@ class RENDER_PT_shading(RenderButtonsPanel, Panel):
col = split.column()
col.prop(rd, "use_raytrace", text="Ray Tracing")
col.prop(rd, "use_color_unpremultiply")
col.prop(rd, "alpha_mode", text="Alpha")

View File

@@ -241,7 +241,6 @@ class SCENE_PT_color_management(Panel):
layout = self.layout
scene = context.scene
rd = scene.render
col = layout.column()
col.label(text="Display:")
@@ -251,7 +250,6 @@ class SCENE_PT_color_management(Panel):
col.separator()
col.label(text="Render:")
col.template_colormanaged_view_settings(scene, "view_settings")
col.prop(rd, "use_color_unpremultiply")
col = layout.column()
col.separator()

View File

@@ -30,7 +30,7 @@ from bpy.types import (Brush,
from rna_prop_ui import PropertyPanel
from bl_ui.properties_paint_common import sculpt_brush_texture_settings
from bl_ui.properties_paint_common import brush_texture_settings
class TEXTURE_MT_specials(Menu):
@@ -868,8 +868,8 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
split.prop(tex, "object", text="")
if isinstance(idblock, Brush):
if context.sculpt_object:
sculpt_brush_texture_settings(layout, idblock)
if context.sculpt_object or context.image_paint_object:
brush_texture_settings(layout, idblock, context.sculpt_object)
else:
if isinstance(idblock, Material):
split = layout.split(percentage=0.3)

View File

@@ -790,45 +790,42 @@ class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel):
sc = context.space_data
clip = sc.clip
col = layout.column()
col.active = clip.use_proxy
layout.active = clip.use_proxy
col.label(text="Build Original:")
layout.label(text="Build Original:")
row = col.row(align=True)
row = layout.row(align=True)
row.prop(clip.proxy, "build_25", toggle=True)
row.prop(clip.proxy, "build_50", toggle=True)
row.prop(clip.proxy, "build_75", toggle=True)
row.prop(clip.proxy, "build_100", toggle=True)
col.label(text="Build Undistorted:")
layout.label(text="Build Undistorted:")
row = col.row(align=True)
row = layout.row(align=True)
row.prop(clip.proxy, "build_undistorted_25", toggle=True)
row.prop(clip.proxy, "build_undistorted_50", toggle=True)
row.prop(clip.proxy, "build_undistorted_75", toggle=True)
row.prop(clip.proxy, "build_undistorted_100", toggle=True)
col.prop(clip.proxy, "quality")
layout.prop(clip.proxy, "quality")
col.prop(clip, "use_proxy_custom_directory")
layout.prop(clip, "use_proxy_custom_directory")
if clip.use_proxy_custom_directory:
col.prop(clip.proxy, "directory")
layout.prop(clip.proxy, "directory")
col.operator("clip.rebuild_proxy", text="Build Proxy")
layout.operator("clip.rebuild_proxy", text="Build Proxy")
if clip.source == 'MOVIE':
col2 = col.column()
col = layout.column()
col2.label(text="Use timecode index:")
col2.prop(clip.proxy, "timecode", text="")
col2 = col.column()
col2.label(text="Proxy render size:")
col.prop(sc.clip_user, "proxy_render_size", text="")
col.label(text="Use timecode index:")
col.prop(clip.proxy, "timecode", text="")
col = layout.column()
col.label(text="Proxy render size:")
col.prop(sc.clip_user, "proxy_render_size", text="")
col.prop(sc.clip_user, "use_render_undistorted")

View File

@@ -20,6 +20,8 @@
import bpy
from bpy.types import Header, Menu, Panel
from bl_ui.properties_paint_common import UnifiedPaintPanel
from bl_ui.properties_paint_common import brush_texture_settings
from bl_ui.properties_paint_common import brush_mask_texture_settings
class ImagePaintPanel(UnifiedPaintPanel):
@@ -686,6 +688,7 @@ class IMAGE_PT_paint(Panel, ImagePaintPanel):
col = layout.column()
col.template_color_wheel(brush, "color", value_slider=True)
col.prop(brush, "color", text="")
col.prop(toolsettings, "invert_color")
row = col.row(align=True)
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
@@ -721,6 +724,27 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
col.prop(brush, "use_fixed_texture")
class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel):
bl_label = "Texture Mask"
bl_options = {'DEFAULT_CLOSED'}
def draw_header(self, context):
brush = context.tool_settings.image_paint.brush
tex_slot_alpha = brush.mask_texture_slot
self.layout.prop(brush, 'use_mask', text="")
def draw(self, context):
layout = self.layout
brush = context.tool_settings.image_paint.brush
tex_slot_alpha = brush.mask_texture_slot
col = layout.column()
col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
brush_mask_texture_settings(col, brush)
class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel):
bl_label = "Tool"

View File

@@ -157,6 +157,10 @@ class INFO_MT_file_import(Menu):
def draw(self, context):
if hasattr(bpy.types, "WM_OT_collada_import"):
self.layout.operator("wm.collada_import", text="Collada (Default) (.dae)")
if hasattr(bpy.types, "WM_OT_assimp_import"):
self.layout.operator("wm.assimp_import", text="Open Asset Import Library (Default) (multiple)")
if hasattr(bpy.types, "WM_OT_fbx_import"):
self.layout.operator("wm.fbx_import", text="FBX (.fbx)")
class INFO_MT_file_export(Menu):
@@ -272,9 +276,7 @@ class INFO_MT_add(Menu):
# note, don't use 'EXEC_SCREEN' or operators wont get the 'v3d' context.
# Note: was EXEC_AREA, but this context does not have the 'rv3d', which prevents
# "align_view" to work on first call (see [#32719]).
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator_context = 'EXEC_AREA'
#layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')

View File

@@ -20,6 +20,7 @@
import bpy
from bpy.types import Header, Menu, Panel
import os
import addon_utils
def ui_items_general(col, context):
@@ -84,7 +85,7 @@ class USERPREF_HT_header(Header):
userpref = context.user_preferences
layout.operator_context = 'EXEC_AREA'
layout.operator("wm.save_homefile", text="Save As Default")
layout.operator("wm.save_preferences", text="Save As Default")
layout.operator_context = 'INVOKE_DEFAULT'
@@ -184,6 +185,8 @@ class USERPREF_PT_interface(Panel):
col.separator()
col.separator()
col.label(text="3D view floating controls:")
col.prop(view, "floating_controls")
col.prop(view, "show_mini_axis", text="Display Mini Axis")
sub = col.column()
sub.active = view.show_mini_axis
@@ -865,7 +868,7 @@ class USERPREF_MT_ndof_settings(Menu):
layout.separator()
layout.label(text="Orbit options")
layout.row().prop(input_prefs, "ndof_view_rotate_method", text="")
layout.prop(input_prefs, "ndof_turntable")
layout.prop(input_prefs, "ndof_roll_invert_axis")
layout.prop(input_prefs, "ndof_tilt_invert_axis")
layout.prop(input_prefs, "ndof_rotate_invert_axis")
@@ -952,8 +955,6 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
sub = col.column()
sub.label(text="NDOF Device:")
sub.prop(inputs, "ndof_sensitivity", text="NDOF Sensitivity")
sub.prop(inputs, "ndof_orbit_sensitivity", text="NDOF Orbit Sensitivity")
sub.row().prop(inputs, "ndof_view_rotate_method", expand=True)
row.separator()
@@ -1032,8 +1033,6 @@ class USERPREF_PT_addons(Panel):
box.label(l)
def draw(self, context):
import addon_utils
layout = self.layout
userpref = context.user_preferences

View File

@@ -2710,6 +2710,125 @@ class VIEW3D_PT_context_properties(Panel):
rna_prop_ui.draw(self.layout, context, member, object, False)
class VIEW3D_PT_floating_controls(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'WINDOW'
bl_label = "Floating Controls"
bl_options = {'HIDE_HEADER'}
def make_lastop(self, context, layout):
wm = context.window_manager
last_operator = wm.last_redo()
if last_operator != None:
lastop = layout.row()
lastop.alignment = 'RIGHT'
lastop_name = last_operator.name
for id, p in last_operator.properties.items():
if last_operator.properties.is_property_primary(id):
if str(p.__class__) == "<class 'IDPropertyArray'>":
lastop_name = lastop_name + " ("
for v in p:
if type(v) is float:
string_formatted = "%(pretty_number).3f" % { "pretty_number": v }
else:
string_formatted = str(v)
lastop_name = lastop_name + string_formatted + " "
lastop_name = lastop_name[:-1] # cut off the last space
lastop_name = lastop_name + ")"
else:
lastop_name = lastop_name + " (" + str(p) + ")"
lastop.operator("screen.redo_last", text=lastop_name, emboss=False)
def draw(self, context):
view = context.space_data
tools = context.tool_settings
wm = context.window_manager
floating_controls = context.user_preferences.view.floating_controls
if floating_controls in {'BOTTOM', 'TOP'}:
layout = self.layout
row = None
if floating_controls == 'BOTTOM':
layout.alignment = 'BOTTOM'
row = layout.row() # Create this first so it floats on the bottom
self.make_lastop(context, layout)
if floating_controls == 'TOP':
row = layout.row()
row = row.row(align=True)
row.alignment = 'CENTER'
row.scale_x = 1.5
row.scale_y = 1.5
row.prop(view, "use_manipulator_translate", text="", icon='MAN_TRANS', clearfield=True)
row.prop(view, "use_manipulator_rotate", text="", icon='MAN_ROT', clearfield=True)
row.prop(view, "use_manipulator_scale", text="", icon='MAN_SCALE', clearfield=True)
row.separator()
# When the user is in edit mode, these buttons are property controls so that they can remember state,
# toggle on and off, make use of shift, etc. However, when the user is in object mode they're drawn
# as operator controls so that they render off (popped, not toggled) and when the user clicks they
# invoke edit mode.
if context.object.mode == 'EDIT':
props = row.operator("object.mode_set", text="", icon='OBJECT_DATA')
props.mode='OBJECT'
row.prop(tools, "use_select_vertex", text="", clearfield=True)
row.prop(tools, "use_select_edge", text="", clearfield=True)
row.prop(tools, "use_select_face", text="", clearfield=True)
else:
row.prop(tools, "object_select_mode", text="")
props = row.operator("mesh.selection_mode_set", text="", icon='VERTEXSEL')
props.mode='VERTEX'
props = row.operator("mesh.selection_mode_set", text="", icon='EDGESEL')
props.mode='EDGE'
props = row.operator("mesh.selection_mode_set", text="", icon='FACESEL')
props.mode='FACE'
elif floating_controls in {'LEFT', 'RIGHT'}:
layout = self.layout
self.make_lastop(context, layout)
row = layout.row()
if floating_controls == 'RIGHT':
row.alignment = 'RIGHT'
column = row.column(align=True)
column.alignment = 'CENTER'
column.scale_x = 1.5
column.scale_y = 1.5
column.prop(view, "use_manipulator_translate", text="", icon='MAN_TRANS', clearfield=True)
column.prop(view, "use_manipulator_rotate", text="", icon='MAN_ROT', clearfield=True)
column.prop(view, "use_manipulator_scale", text="", icon='MAN_SCALE', clearfield=True)
column.separator()
if context.object.mode == 'EDIT':
props = row.operator("object.mode_set", text="", icon='OBJECT_DATA')
props.mode='OBJECT'
column.prop(tools, "use_select_vertex", text="", clearfield=True)
column.prop(tools, "use_select_edge", text="", clearfield=True)
column.prop(tools, "use_select_face", text="", clearfield=True)
else:
column.prop(tools, "object_select_mode", text="")
props = column.operator("mesh.selection_mode_set", text="", icon='VERTEXSEL')
props.mode='VERTEX'
props = column.operator("mesh.selection_mode_set", text="", icon='EDGESEL')
props.mode='EDGE'
props = column.operator("mesh.selection_mode_set", text="", icon='FACESEL')
props.mode='FACE'
def register():
bpy.utils.register_module(__name__)

View File

@@ -20,8 +20,8 @@
import bpy
from bpy.types import Menu, Panel
from bl_ui.properties_paint_common import UnifiedPaintPanel
from bl_ui.properties_paint_common import sculpt_brush_texture_settings
from bl_ui.properties_paint_common import brush_texture_settings
from bl_ui.properties_paint_common import brush_mask_texture_settings
class View3DPanel():
bl_space_type = 'VIEW_3D'
@@ -207,6 +207,8 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
col.label("Edge Select Mode:")
col.prop(tool_settings, "edge_path_mode", text="")
col.prop(tool_settings, "edge_path_live_unwrap")
col.prop(tool_settings, "correct_uv")
col.label("Double Threshold:")
col.prop(tool_settings, "double_threshold", text="")
@@ -511,7 +513,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
# Sculpt Mode #
elif context.sculpt_object and brush:
capabilities = brush.sculpt_capabilities
capabilities = brush.paint_capabilities
col = layout.column()
@@ -635,11 +637,16 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
col = layout.column()
col.template_color_wheel(brush, "color", value_slider=True)
col.prop(brush, "color", text="")
col.prop(settings, "invert_color")
row = col.row(align=True)
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
row.prop(brush, "random_size", slider=True)
row = col.row(align=True)
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
@@ -665,6 +672,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
row = col.row(align=True)
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
self.prop_unified_size(row, context, brush, "use_pressure_size")
@@ -685,6 +693,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
col.prop(brush, "color", text="")
row = col.row(align=True)
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
self.prop_unified_size(row, context, brush, "use_pressure_size")
@@ -707,8 +716,7 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
return (settings and settings.brush and (context.sculpt_object or
context.image_paint_object))
return (settings and settings.brush and (context.sculpt_object or context.image_paint_object))
def draw(self, context):
layout = self.layout
@@ -720,15 +728,13 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
col = layout.column()
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
if brush.use_paint_image:
col.prop(brush, "use_fixed_texture")
if context.sculpt_object:
sculpt_brush_texture_settings(col, brush)
if context.sculpt_object or context.image_paint_object:
brush_texture_settings(col, brush, context.sculpt_object)
# use_texture_overlay and texture_overlay_alpha
col = layout.column(align=True)
col.active = brush.sculpt_capabilities.has_overlay
col.active = brush.paint_capabilities.has_overlay
col.label(text="Overlay:")
row = col.row()
@@ -740,6 +746,34 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
sub.prop(brush, "texture_overlay_alpha", text="Alpha")
class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel):
bl_context = "imagepaint"
bl_label = "Texture Mask"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
brush = context.tool_settings.image_paint.brush
return (context.image_paint_object and brush and brush.image_tool != 'SOFTEN')
def draw_header(self, context):
brush = context.tool_settings.image_paint.brush
tex_slot_alpha = brush.mask_texture_slot
self.layout.prop(brush, 'use_mask', text="")
def draw(self, context):
layout = self.layout
brush = context.tool_settings.image_paint.brush
tex_slot_alpha = brush.mask_texture_slot
col = layout.column()
col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
brush_mask_texture_settings(col, brush)
class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
bl_label = "Stroke"
bl_options = {'DEFAULT_CLOSED'}
@@ -779,7 +813,7 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
row.active = brush.use_space
row.prop(brush, "spacing", text="Spacing")
if brush.sculpt_capabilities.has_smooth_stroke:
if brush.paint_capabilities.has_smooth_stroke:
col = layout.column()
col.separator()
@@ -790,7 +824,7 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
if brush.sculpt_capabilities.has_jitter:
if brush.paint_capabilities.has_jitter:
col.separator()
row = col.row(align=True)
@@ -817,7 +851,7 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
col.separator()
col = layout.column()
col.active = brush.sculpt_capabilities.has_spacing
col.active = brush.paint_capabilities.has_spacing
col.prop(brush, "use_space")
row = col.row()
@@ -931,7 +965,7 @@ class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
col = layout.column()
if context.sculpt_object and context.tool_settings.sculpt:
if brush.sculpt_capabilities.has_secondary_color:
if brush.paint_capabilities.has_secondary_color:
col.prop(brush, "cursor_color_add", text="Add Color")
col.prop(brush, "cursor_color_subtract", text="Subtract Color")
else:

View File

@@ -39,9 +39,10 @@ def add_object(self, context):
class OBJECT_OT_add_object(Operator, AddObjectHelper):
"""Create a new Mesh Object"""
"""Add a Mesh Object"""
bl_idname = "mesh.add_object"
bl_label = "Add Mesh Object"
bl_description = "Create a new Mesh Object"
bl_options = {'REGISTER', 'UNDO'}
scale = FloatVectorProperty(
@@ -81,7 +82,6 @@ def register():
bpy.utils.register_manual_map(add_object_manual_map)
bpy.types.INFO_MT_mesh_add.append(add_object_button)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_add_object)
bpy.utils.unregister_manual_map(add_object_manual_map)

View File

@@ -188,7 +188,7 @@ HRESULT __stdcall VF_OpenFileFunc_Blen(
SOCKET s_in;
char buf[256];
struct sockaddr_in addr;
FILE *fp;
FILE* fp;
p = lpFileName;
while (*p && *p != '.') p++;
@@ -229,7 +229,7 @@ HRESULT __stdcall VF_OpenFileFunc_Blen(
return VF_ERROR;
}
rval = (conndesc *) malloc(sizeof(conndesc));
rval = (conndesc*) malloc(sizeof(conndesc));
rval->addr = addr;
@@ -281,7 +281,7 @@ HRESULT __stdcall VF_OpenFileFunc_Blen(
HRESULT __stdcall VF_CloseFileFunc_Blen(
VF_FileHandle hFileHandle )
{
free((conndesc *) hFileHandle);
free((conndesc*) hFileHandle);
return VF_OK;
}
@@ -290,7 +290,7 @@ HRESULT __stdcall VF_GetFileInfoFunc_Blen(
VF_FileHandle hFileHandle,
LPVF_FileInfo lpFileInfo )
{
conndesc *c = (conndesc *) hFileHandle;
conndesc * c = (conndesc*) hFileHandle;
if (c == 0) {
return VF_ERROR;
}
@@ -385,10 +385,10 @@ HRESULT __stdcall VF_ReadDataFunc_Blen(
framebuf = (unsigned char*) v->lpData;
for (y = 0; y < height; y++) {
unsigned char *p = framebuf + v->lPitch * y;
unsigned char *e = p + width * 3;
unsigned char * p = framebuf + v->lPitch * y;
unsigned char * e = p + width * 3;
my_recv(s_in, (char *)p, width * 3);
my_recv(s_in, (char*) p, width * 3);
while (p != e) {
unsigned char tmp = p[2];
p[2] = p[0];

View File

@@ -135,3 +135,11 @@ endif()
if(WITH_OPENCOLLADA)
add_subdirectory(collada)
endif()
if(WITH_ASSIMP)
add_subdirectory(assimp)
endif()
if(WITH_FBX)
add_subdirectory(fbx)
endif()

View File

@@ -38,6 +38,12 @@ if env['WITH_BF_QUICKTIME']:
if env['WITH_BF_COLLADA']:
SConscript (['collada/SConscript'])
if env['WITH_BF_ASSIMP']:
SConscript (['assimp/SConscript'])
if env['WITH_BF_FBX']:
SConscript (['fbx/SConscript'])
if env['WITH_BF_COMPOSITOR']:
SConscript (['compositor/SConscript',
'opencl/SConscript'])

View File

@@ -203,7 +203,7 @@ void BKE_pose_ikparam_init(struct bPose *pose);
void BKE_pose_itasc_init(struct bItasc *itasc);
/* clears BONE_UNKEYED flags for frame changing */
// XXX to be deprecated for a more general solution in animsys...
// XXX to be depreceated for a more general solution in animsys...
void framechange_poses_clear_unkeyed(void);
/* Bone Groups API --------------------- */

View File

@@ -67,14 +67,15 @@ float BKE_brush_curve_strength_clamp(struct Brush *br, float p, const float len)
float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
/* sampling */
void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread);
void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread, float angle);
float BKE_brush_sample_masktex(const struct Scene *scene, struct Brush *brush, const float xy[2], const int thread, float angle);
void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
struct ImBuf **imbuf, int use_color_correction);
struct ImBuf **imbuf, float angle, int use_color_correction, short invert);
/* painting */
struct BrushPainter;
typedef struct BrushPainter BrushPainter;
typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, const float lastpos[2], const float pos[2]);
typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, const float lastpos[2], const float pos[2], float rotation);
BrushPainter *BKE_brush_painter_new(struct Scene *scene, struct Brush *brush);
void BKE_brush_painter_require_imbuf(BrushPainter *painter, short flt,
@@ -91,7 +92,8 @@ unsigned int *BKE_brush_gen_texture_cache(struct Brush *br, int half_side);
struct ImBuf *BKE_brush_gen_radial_control_imbuf(struct Brush *br);
/* unified strength and size */
void BKE_brush_randomize_size(struct Brush *brush);
int BKE_brush_size_randomized_get(const struct Scene *scene, struct Brush *brush);
int BKE_brush_size_get(const struct Scene *scene, struct Brush *brush);
void BKE_brush_size_set(struct Scene *scene, struct Brush *brush, int value);
@@ -99,8 +101,9 @@ float BKE_brush_unprojected_radius_get(const struct Scene *scene, struct Brush *
void BKE_brush_unprojected_radius_set(struct Scene *scene, struct Brush *brush, float value);
float BKE_brush_alpha_get(const struct Scene *scene, struct Brush *brush);
float BKE_brush_weight_get(const Scene *scene, struct Brush *brush);
void BKE_brush_weight_set(const Scene *scene, struct Brush *brush, float value);
void BKE_brush_alpha_set(struct Scene *scene, struct Brush *brush, float alpha);
float BKE_brush_weight_get(const struct Scene *scene, struct Brush *brush);
void BKE_brush_weight_set(const struct Scene *scene, struct Brush *brush, float value);
int BKE_brush_use_locked_size(const struct Scene *scene, struct Brush *brush);
int BKE_brush_use_alpha_pressure(const struct Scene *scene, struct Brush *brush);

View File

@@ -102,6 +102,12 @@ typedef struct Global {
/* save the allowed windowstate of blender when using -W or -w */
int windowstate;
double last_tooltip_close;
// Fields to enable dragging a list of toggle buttons to turn them all on or off
void* drag_button_func; // It's a func pointer, but we only need the value to compare and we won't call the function, so I use void* to avoid a dependency on uiButHandleFunc
int drag_button_state; // Turn them on or off as we drag?
} Global;
/* **************** GLOBAL ********************* */
@@ -166,6 +172,8 @@ enum {
#define G_FILE_RELATIVE_REMAP (1 << 24)
#define G_FILE_HISTORY (1 << 25)
#define G_FILE_MESH_COMPAT (1 << 26) /* BMesh option to save as older mesh format */
#define G_FILE_PREFERENCES (1 << 27)
#define G_FILE_NO_DATA (1 << 28)
/* G.windowstate */
#define G_WINDOWSTATE_USERDEF 0

View File

@@ -68,7 +68,7 @@ typedef struct Main {
ListBase latt;
ListBase lamp;
ListBase camera;
ListBase ipo; // XXX deprecated
ListBase ipo; // XXX depreceated
ListBase key;
ListBase world;
ListBase screen;

View File

@@ -83,7 +83,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, short totcol);
short find_material_index(struct Object *ob, struct Material *ma);
int object_add_material_slot(struct Object *ob);
int object_remove_material_slot(struct Object *ob);
int object_remove_material_slot(struct Object *ob, int slot);
/* rna api */
void material_append_id(struct ID *id, struct Material *ma);

View File

@@ -0,0 +1,42 @@
/*
* ***** 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) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BKE_MIRROR_H__
#define __BKE_MIRROR_H__
/** \file BKE_mirror.h
* \ingroup bke
*/
struct DerivedMesh;
struct MirrorModifierData;
struct Object;
DerivedMesh *mirror_make_derived_from_derived(MirrorModifierData *mmd,
Object *ob, DerivedMesh *dm, int orig);
#endif

View File

@@ -475,8 +475,6 @@ struct bNodeSocket *node_group_add_extern_socket(struct bNodeTree *ntree, ListBa
void register_node_type_frame(struct bNodeTreeType *ttype);
void register_node_type_reroute(struct bNodeTreeType *ttype);
void BKE_node_tree_unlink_id_cb(void *calldata, struct ID *owner_id, struct bNodeTree *ntree);
/* ************** SHADER NODES *************** */
struct ShadeInput;

View File

@@ -54,7 +54,7 @@ void BKE_object_workob_clear(struct Object *workob);
void BKE_object_workob_calc_parent(struct Scene *scene, struct Object *ob, struct Object *workob);
void BKE_object_transform_copy(struct Object *ob_tar, const struct Object *ob_src);
struct SoftBody *copy_softbody(struct SoftBody *sb, int copy_caches);
struct SoftBody *copy_softbody(struct SoftBody *sb);
struct BulletSoftBody *copy_bulletsoftbody(struct BulletSoftBody *sb);
void BKE_object_copy_particlesystems(struct Object *obn, struct Object *ob);
void BKE_object_copy_softbody(struct Object *obn, struct Object *ob);
@@ -82,7 +82,6 @@ struct Object *BKE_object_add(struct Scene *scene, int type);
void *BKE_object_obdata_add_from_type(int type);
struct Object *BKE_object_copy(struct Object *ob);
struct Object *BKE_object_copy_with_caches(struct Object *ob);
void BKE_object_make_local(struct Object *ob);
int BKE_object_is_libdata(struct Object *ob);
int BKE_object_obdata_is_libdata(struct Object *ob);

View File

@@ -45,6 +45,7 @@ struct Paint;
struct PBVH;
struct Scene;
struct StrokeCache;
struct UnifiedPaintSettings;
extern const char PAINT_CURSOR_SCULPT[3];
extern const char PAINT_CURSOR_VERTEX_PAINT[3];
@@ -76,6 +77,8 @@ int paint_is_grid_face_hidden(const unsigned int *grid_hidden,
float paint_grid_paint_mask(const struct GridPaintMask *gpm, unsigned level,
unsigned x, unsigned y);
void paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups, const float mouse_pos[]);
/* Session data (mode-specific) */
typedef struct SculptSession {

View File

@@ -303,7 +303,7 @@ struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
void BKE_ptcache_free_mem(struct ListBase *mem_cache);
void BKE_ptcache_free(struct PointCache *cache);
void BKE_ptcache_free_list(struct ListBase *ptcaches);
struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old, int copy_data);
struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old);
/********************** Baking *********************/

View File

@@ -109,7 +109,6 @@ float get_render_aosss_error(struct RenderData *r, float error);
int BKE_scene_use_new_shading_nodes(struct Scene *scene);
void BKE_scene_disable_color_management(struct Scene *scene);
int BKE_scene_check_color_management_enabled(const struct Scene *scene);
#ifdef __cplusplus
}

View File

@@ -155,6 +155,8 @@ typedef struct ARegionType {
short do_lock, lock;
/* call cursor function on each move event */
short event_cursor;
/* If it's enabled, don't clear the region before drawing panels (ED_region_panels) */
char dont_clear;
} ARegionType;
/* panel types */

View File

@@ -109,6 +109,7 @@ set(SRC
intern/mball.c
intern/mesh.c
intern/mesh_validate.c
intern/mirror.c
intern/modifier.c
intern/modifiers_bmesh.c
intern/movieclip.c
@@ -199,6 +200,7 @@ set(SRC
BKE_material.h
BKE_mball.h
BKE_mesh.h
BKE_mirror.h
BKE_modifier.h
BKE_movieclip.h
BKE_multires.h

View File

@@ -578,13 +578,6 @@ void DM_set_only_copy(DerivedMesh *dm, CustomDataMask mask)
CustomData_set_only_copy(&dm->vertData, mask);
CustomData_set_only_copy(&dm->edgeData, mask);
CustomData_set_only_copy(&dm->faceData, mask);
/* this wasn't in 2.63 and is disabled for 2.64 because it gives problems with
* weight paint mode when there are modifiers applied, needs further investigation,
* see replies to r50969, Campbell */
#if 0
CustomData_set_only_copy(&dm->loopData, mask);
CustomData_set_only_copy(&dm->polyData, mask);
#endif
}
void DM_add_vert_layer(DerivedMesh *dm, int type, int alloctype, void *layer)

View File

@@ -639,7 +639,7 @@ static void fcurves_path_rename_fix(ID *owner_id, const char *prefix, const char
if (fcu->rna_path != old_path) {
bActionGroup *agrp = fcu->grp;
if ((agrp) && strcmp(oldName, agrp->name) == 0) {
if ((agrp) && strcmp(oldName, agrp->name)==0) {
BLI_strncpy(agrp->name, newName, sizeof(agrp->name));
}
}

View File

@@ -150,6 +150,8 @@ void initglobals(void)
#else
G.f &= ~G_SCRIPT_AUTOEXEC;
#endif
G.drag_button_func = 0;
}
/***/
@@ -249,11 +251,13 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
sound_init_main(G.main);
if (bfd->user) {
/* only here free userdef themes... */
BKE_userdef_free();
U = *bfd->user;
if (G.fileflags & G_FILE_PREFERENCES) {
/* only here free userdef themes... */
BKE_userdef_free();
U = *bfd->user;
}
MEM_freeN(bfd->user);
}
@@ -275,7 +279,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
}
/* this can happen when active scene was lib-linked, and doesn't exist anymore */
if (CTX_data_scene(C) == NULL) {
if (CTX_data_scene(C) == NULL && CTX_wm_screen(C) && bfd->main->scene.first) {
CTX_data_scene_set(C, bfd->main->scene.first);
CTX_wm_screen(C)->scene = CTX_data_scene(C);
curscene = CTX_data_scene(C);
@@ -321,7 +325,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
BLI_strncpy(G.main->name, filepath, FILE_MAX);
/* baseflags, groups, make depsgraph, etc */
BKE_scene_set_background(G.main, CTX_data_scene(C));
if (CTX_data_scene(C))
BKE_scene_set_background(G.main, CTX_data_scene(C));
if (mode != 'u') {
IMB_colormanagement_check_file_config(G.main);
@@ -392,7 +397,7 @@ int BKE_read_file(bContext *C, const char *filepath, ReportList *reports)
BlendFileData *bfd;
int retval = BKE_READ_FILE_OK;
if (strstr(filepath, BLENDER_STARTUP_FILE) == NULL) /* don't print user-pref loading */
if (strstr(filepath, BLENDER_STARTUP_FILE) == NULL && strstr(filepath, BLENDER_PREFERENCES_FILE) == NULL) /* don't print user-pref loading */
printf("read blend: %s\n", filepath);
bfd = BLO_read_from_file(filepath, reports);

View File

@@ -96,7 +96,7 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
ysize = (bytes + (ibuf->x - 1)) / ibuf->x;
if (ysize < ibuf->y) {
/* we're first going to copy all data into a linear buffer.
/* we're first going to copy all data into a liniar buffer.
* step can be 4 or 1 bytes, and the data is not sequential because
* the bitmap was flipped vertically. */

View File

@@ -29,27 +29,16 @@
* \ingroup bke
*/
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_brush_types.h"
#include "DNA_color_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_windowmanager_types.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "BLI_bpath.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "BKE_brush.h"
#include "BKE_colortools.h"
@@ -102,9 +91,11 @@ static void brush_defaults(Brush *brush)
brush->rate = 0.1f; /* time delay between dots of paint or sculpting when doing airbrush mode */
brush->jitter = 0.0f;
brush->random_size = 0.0;
brush->random_factor_cache = 1.0;
/* BRUSH TEXTURE SETTINGS */
default_mtex(&brush->mtex);
default_mtex(&brush->mask_mtex);
brush->texture_sample_bias = 0; /* value to added to texture samples */
brush->texture_overlay_alpha = 33;
@@ -150,6 +141,9 @@ Brush *BKE_brush_copy(Brush *brush)
if (brush->mtex.tex)
id_us_plus((ID *)brush->mtex.tex);
if (brush->mask_mtex.tex)
id_us_plus((ID *)brush->mask_mtex.tex);
if (brush->icon_imbuf)
brushn->icon_imbuf = IMB_dupImBuf(brush->icon_imbuf);
@@ -172,6 +166,9 @@ void BKE_brush_free(Brush *brush)
if (brush->mtex.tex)
brush->mtex.tex->id.us--;
if (brush->mask_mtex.tex)
brush->mask_mtex.tex->id.us--;
if (brush->icon_imbuf)
IMB_freeImBuf(brush->icon_imbuf);
@@ -183,6 +180,7 @@ void BKE_brush_free(Brush *brush)
static void extern_local_brush(Brush *brush)
{
id_lib_extern((ID *)brush->mtex.tex);
id_lib_extern((ID *)brush->mask_mtex.tex);
id_lib_extern((ID *)brush->clone.image);
}
@@ -296,6 +294,8 @@ void BKE_brush_debug_print_state(Brush *br)
BR_TEST_FLAG(BRUSH_CUSTOM_ICON);
BR_TEST(jitter, f);
BR_TEST(random_size, f);
BR_TEST(random_factor_cache, f);
BR_TEST(spacing, d);
BR_TEST(smooth_stroke_radius, d);
BR_TEST(smooth_stroke_factor, f);
@@ -485,20 +485,40 @@ int BKE_brush_clone_image_delete(Brush *brush)
return 0;
}
/* reset the random size cache to a random value, proportional to the size of the brush.
* due to the many places BKE_brush_size_get is called it is not safe to generate a random
* number for every call. Instead we will generate a random number before each stroke */
void BKE_brush_randomize_size(Brush *brush)
{
brush->random_factor_cache = (1.0 - brush->random_size / 2.0) + brush->random_size * BLI_frand();
}
/* Brush Sampling */
void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], const int thread)
void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], const int thread, float angle)
{
MTex *mtex = &brush->mtex;
if (mtex && mtex->tex) {
float co_angle, length;
float co[3], tin, tr, tg, tb, ta;
int hasrgb;
const int radius = BKE_brush_size_get(scene, brush);
const int radius = BKE_brush_size_randomized_get(scene, brush);
co[0] = xy[0] / radius;
co[1] = xy[1] / radius;
co[2] = 0.0f;
if (fabsf(angle) > 0.0001f) {
length = normalize_v2(co);
co_angle = acos(co[0]);
co_angle = (co[1] > 0)? co_angle : - co_angle;
co_angle -= angle;
co[0] = cos(co_angle)*length;
co[1] = sin(co_angle)*length;
}
hasrgb = externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, thread);
if (hasrgb) {
@@ -519,17 +539,56 @@ void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], f
}
}
/* Brush Mask Sampling */
float BKE_brush_sample_masktex(const Scene *scene, Brush *brush, const float xy[2], const int thread, float angle)
{
MTex *mtex = &brush->mask_mtex;
if (mtex && mtex->tex) {
float co_angle, length;
float co[3], tin, rgb[3], ta;
int hasrgb;
const int radius = BKE_brush_size_randomized_get(scene, brush);
co[0] = xy[0] / radius;
co[1] = xy[1] / radius;
co[2] = 0.0f;
if (fabsf(angle) > 0.0001f) {
length = normalize_v2(co);
co_angle = acos(co[0]);
co_angle = (co[1] > 0) ? co_angle : -co_angle;
co_angle -= angle;
co[0] = cos(co_angle)*length;
co[1] = sin(co_angle)*length;
}
hasrgb = externtex(mtex, co, &tin, rgb, rgb+1, rgb+2, &ta, thread);
if (hasrgb) {
return rgb_to_grayscale(rgb);
}
else {
return tin;
}
}
else {
return 1.0f;
}
}
/* TODO, use define for 'texfall' arg */
void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction)
void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, float angle, int use_color_correction, short invert)
{
ImBuf *ibuf;
float xy[2], rgba[4], *dstf;
int x, y, rowbytes, xoff, yoff, imbflag;
const int radius = BKE_brush_size_get(scene, brush);
const int radius = BKE_brush_size_randomized_get(scene, brush);
unsigned char *dst, crgb[3];
const float alpha = BKE_brush_alpha_get(scene, brush);
float brush_rgb[3];
imbflag = (flt) ? IB_rectfloat : IB_rect;
xoff = -bufsize / 2.0f + 0.5f;
yoff = -bufsize / 2.0f + 0.5f;
@@ -553,17 +612,22 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
xy[0] = x + xoff;
xy[1] = y + yoff;
/* texfall = 0, 1 seem unused from a quick search */
if (texfall == 0) {
copy_v3_v3(dstf, brush_rgb);
dstf[3] = alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
if (invert) rgb_invert(dstf);
}
else if (texfall == 1) {
BKE_brush_sample_tex(scene, brush, xy, dstf, 0);
BKE_brush_sample_tex(scene, brush, xy, dstf, 0, angle);
if (invert) rgb_invert(dstf);
}
else {
BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
BKE_brush_sample_tex(scene, brush, xy, rgba, 0, angle);
mul_v3_v3v3(dstf, rgba, brush_rgb);
dstf[3] = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
if (invert) rgb_invert(dstf);
dstf[3] = rgba[3] *alpha *BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius)
*BKE_brush_sample_masktex(scene, brush, xy, 0, angle);
}
}
}
@@ -588,26 +652,31 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
dst[3] = FTOCHAR(alpha_f);
}
else if (texfall == 1) {
BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
BKE_brush_sample_tex(scene, brush, xy, rgba, 0, angle);
rgba_float_to_uchar(dst, rgba);
if (invert) rgb_invert_uchar(dst);
}
else if (texfall == 2) {
BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
BKE_brush_sample_tex(scene, brush, xy, rgba, 0, angle);
mul_v3_v3(rgba, brush->rgb);
alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
alpha_f = rgba[3] *alpha *BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius)
*BKE_brush_sample_masktex(scene, brush, xy, 0, angle);
rgb_float_to_uchar(dst, rgba);
if (invert) rgb_invert_uchar(dst);
dst[3] = FTOCHAR(alpha_f);
}
else {
BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
BKE_brush_sample_tex(scene, brush, xy, rgba, 0, angle);
alpha_f = rgba[3] *alpha *BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius)
*BKE_brush_sample_masktex(scene, brush, xy, 0, angle);
dst[0] = crgb[0];
dst[1] = crgb[1];
dst[2] = crgb[2];
dst[3] = FTOCHAR(alpha_f);
if (invert) rgb_invert_uchar(dst);
}
}
}
@@ -648,6 +717,13 @@ int BKE_brush_size_get(const Scene *scene, Brush *brush)
return (ups->flag & UNIFIED_PAINT_SIZE) ? ups->size : brush->size;
}
int BKE_brush_size_randomized_get(const Scene *scene, Brush *brush)
{
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
return (ups->flag & UNIFIED_PAINT_SIZE) ? brush->random_factor_cache * ups->size : brush->random_factor_cache * brush->size;
}
int BKE_brush_use_locked_size(const Scene *scene, Brush *brush)
{
const short us_flag = scene->toolsettings->unified_paint_settings.flag;
@@ -694,7 +770,7 @@ float BKE_brush_unprojected_radius_get(const Scene *scene, Brush *brush)
brush->unprojected_radius;
}
static void brush_alpha_set(Scene *scene, Brush *brush, float alpha)
void BKE_brush_alpha_set(Scene *scene, Brush *brush, float alpha)
{
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
@@ -752,315 +828,6 @@ void BKE_brush_scale_size(int *BKE_brush_size_get,
(*BKE_brush_size_get) = (int)((float)(*BKE_brush_size_get) * scale);
}
/* Brush Painting */
typedef struct BrushPainterCache {
short enabled;
int size; /* size override, if 0 uses 2*BKE_brush_size_get(brush) */
short flt; /* need float imbuf? */
short texonly; /* no alpha, color or fallof, only texture in imbuf */
int lastsize;
float lastalpha;
float lastjitter;
ImBuf *ibuf;
ImBuf *texibuf;
ImBuf *maskibuf;
} BrushPainterCache;
struct BrushPainter {
Scene *scene;
Brush *brush;
float lastmousepos[2]; /* mouse position of last paint call */
float accumdistance; /* accumulated distance of brush since last paint op */
float lastpaintpos[2]; /* position of last paint op */
float startpaintpos[2]; /* position of first paint */
double accumtime; /* accumulated time since last paint op (airbrush) */
double lasttime; /* time of last update */
float lastpressure;
short firsttouch; /* first paint op */
float startsize;
float startalpha;
float startjitter;
float startspacing;
BrushPainterCache cache;
};
BrushPainter *BKE_brush_painter_new(Scene *scene, Brush *brush)
{
BrushPainter *painter = MEM_callocN(sizeof(BrushPainter), "BrushPainter");
painter->brush = brush;
painter->scene = scene;
painter->firsttouch = 1;
painter->cache.lastsize = -1; /* force ibuf create in refresh */
painter->startsize = BKE_brush_size_get(scene, brush);
painter->startalpha = BKE_brush_alpha_get(scene, brush);
painter->startjitter = brush->jitter;
painter->startspacing = brush->spacing;
return painter;
}
void BKE_brush_painter_require_imbuf(BrushPainter *painter, short flt, short texonly, int size)
{
if ((painter->cache.flt != flt) || (painter->cache.size != size) ||
((painter->cache.texonly != texonly) && texonly))
{
if (painter->cache.ibuf) IMB_freeImBuf(painter->cache.ibuf);
if (painter->cache.maskibuf) IMB_freeImBuf(painter->cache.maskibuf);
painter->cache.ibuf = painter->cache.maskibuf = NULL;
painter->cache.lastsize = -1; /* force ibuf create in refresh */
}
if (painter->cache.flt != flt) {
if (painter->cache.texibuf) IMB_freeImBuf(painter->cache.texibuf);
painter->cache.texibuf = NULL;
painter->cache.lastsize = -1; /* force ibuf create in refresh */
}
painter->cache.size = size;
painter->cache.flt = flt;
painter->cache.texonly = texonly;
painter->cache.enabled = 1;
}
void BKE_brush_painter_free(BrushPainter *painter)
{
Brush *brush = painter->brush;
BKE_brush_size_set(painter->scene, brush, painter->startsize);
brush_alpha_set(painter->scene, brush, painter->startalpha);
brush->jitter = painter->startjitter;
brush->spacing = painter->startspacing;
if (painter->cache.ibuf) IMB_freeImBuf(painter->cache.ibuf);
if (painter->cache.texibuf) IMB_freeImBuf(painter->cache.texibuf);
if (painter->cache.maskibuf) IMB_freeImBuf(painter->cache.maskibuf);
MEM_freeN(painter);
}
static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf,
int x, int y, int w, int h, int xt, int yt,
const float pos[2])
{
Scene *scene = painter->scene;
Brush *brush = painter->brush;
ImBuf *ibuf, *maskibuf, *texibuf;
float *bf, *mf, *tf, *otf = NULL, xoff, yoff, xy[2], rgba[4];
unsigned char *b, *m, *t, *ot = NULL;
int dotexold, origx = x, origy = y;
const int radius = BKE_brush_size_get(painter->scene, brush);
xoff = -radius + 0.5f;
yoff = -radius + 0.5f;
xoff += (int)pos[0] - (int)painter->startpaintpos[0];
yoff += (int)pos[1] - (int)painter->startpaintpos[1];
ibuf = painter->cache.ibuf;
texibuf = painter->cache.texibuf;
maskibuf = painter->cache.maskibuf;
dotexold = (oldtexibuf != NULL);
/* not sure if it's actually needed or it's a mistake in coords/sizes
* calculation in brush_painter_fixed_tex_partial_update(), but without this
* limitation memory gets corrupted at fast strokes with quite big spacing (sergey) */
w = MIN2(w, ibuf->x);
h = MIN2(h, ibuf->y);
if (painter->cache.flt) {
for (; y < h; y++) {
bf = ibuf->rect_float + (y * ibuf->x + origx) * 4;
tf = texibuf->rect_float + (y * texibuf->x + origx) * 4;
mf = maskibuf->rect_float + (y * maskibuf->x + origx) * 4;
if (dotexold)
otf = oldtexibuf->rect_float + ((y - origy + yt) * oldtexibuf->x + xt) * 4;
for (x = origx; x < w; x++, bf += 4, mf += 4, tf += 4) {
if (dotexold) {
copy_v3_v3(tf, otf);
tf[3] = otf[3];
otf += 4;
}
else {
xy[0] = x + xoff;
xy[1] = y + yoff;
BKE_brush_sample_tex(scene, brush, xy, tf, 0);
}
bf[0] = tf[0] * mf[0];
bf[1] = tf[1] * mf[1];
bf[2] = tf[2] * mf[2];
bf[3] = tf[3] * mf[3];
}
}
}
else {
for (; y < h; y++) {
b = (unsigned char *)ibuf->rect + (y * ibuf->x + origx) * 4;
t = (unsigned char *)texibuf->rect + (y * texibuf->x + origx) * 4;
m = (unsigned char *)maskibuf->rect + (y * maskibuf->x + origx) * 4;
if (dotexold)
ot = (unsigned char *)oldtexibuf->rect + ((y - origy + yt) * oldtexibuf->x + xt) * 4;
for (x = origx; x < w; x++, b += 4, m += 4, t += 4) {
if (dotexold) {
t[0] = ot[0];
t[1] = ot[1];
t[2] = ot[2];
t[3] = ot[3];
ot += 4;
}
else {
xy[0] = x + xoff;
xy[1] = y + yoff;
BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
rgba_float_to_uchar(t, rgba);
}
b[0] = t[0] * m[0] / 255;
b[1] = t[1] * m[1] / 255;
b[2] = t[2] * m[2] / 255;
b[3] = t[3] * m[3] / 255;
}
}
}
}
static void brush_painter_fixed_tex_partial_update(BrushPainter *painter, const float pos[2])
{
const Scene *scene = painter->scene;
Brush *brush = painter->brush;
BrushPainterCache *cache = &painter->cache;
ImBuf *oldtexibuf, *ibuf;
int imbflag, destx, desty, srcx, srcy, w, h, x1, y1, x2, y2;
const int diameter = 2 * BKE_brush_size_get(scene, brush);
imbflag = (cache->flt) ? IB_rectfloat : IB_rect;
if (!cache->ibuf)
cache->ibuf = IMB_allocImBuf(diameter, diameter, 32, imbflag);
ibuf = cache->ibuf;
oldtexibuf = cache->texibuf;
cache->texibuf = IMB_allocImBuf(diameter, diameter, 32, imbflag);
if (oldtexibuf) {
srcx = srcy = 0;
destx = (int)painter->lastpaintpos[0] - (int)pos[0];
desty = (int)painter->lastpaintpos[1] - (int)pos[1];
w = oldtexibuf->x;
h = oldtexibuf->y;
IMB_rectclip(cache->texibuf, oldtexibuf, &destx, &desty, &srcx, &srcy, &w, &h);
}
else {
srcx = srcy = 0;
destx = desty = 0;
w = h = 0;
}
x1 = destx;
y1 = desty;
x2 = destx + w;
y2 = desty + h;
/* blend existing texture in new position */
if ((x1 < x2) && (y1 < y2))
brush_painter_do_partial(painter, oldtexibuf, x1, y1, x2, y2, srcx, srcy, pos);
if (oldtexibuf)
IMB_freeImBuf(oldtexibuf);
/* sample texture in new areas */
if ((0 < x1) && (0 < ibuf->y))
brush_painter_do_partial(painter, NULL, 0, 0, x1, ibuf->y, 0, 0, pos);
if ((x2 < ibuf->x) && (0 < ibuf->y))
brush_painter_do_partial(painter, NULL, x2, 0, ibuf->x, ibuf->y, 0, 0, pos);
if ((x1 < x2) && (0 < y1))
brush_painter_do_partial(painter, NULL, x1, 0, x2, y1, 0, 0, pos);
if ((x1 < x2) && (y2 < ibuf->y))
brush_painter_do_partial(painter, NULL, x1, y2, x2, ibuf->y, 0, 0, pos);
}
static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2], int use_color_correction)
{
const Scene *scene = painter->scene;
Brush *brush = painter->brush;
BrushPainterCache *cache = &painter->cache;
MTex *mtex = &brush->mtex;
int size;
short flt;
const int diameter = 2 * BKE_brush_size_get(scene, brush);
const float alpha = BKE_brush_alpha_get(scene, brush);
if (diameter != cache->lastsize ||
alpha != cache->lastalpha ||
brush->jitter != cache->lastjitter)
{
if (cache->ibuf) {
IMB_freeImBuf(cache->ibuf);
cache->ibuf = NULL;
}
if (cache->maskibuf) {
IMB_freeImBuf(cache->maskibuf);
cache->maskibuf = NULL;
}
flt = cache->flt;
size = (cache->size) ? cache->size : diameter;
if (brush->flag & BRUSH_FIXED_TEX) {
BKE_brush_imbuf_new(scene, brush, flt, 3, size, &cache->maskibuf, use_color_correction);
brush_painter_fixed_tex_partial_update(painter, pos);
}
else
BKE_brush_imbuf_new(scene, brush, flt, 2, size, &cache->ibuf, use_color_correction);
cache->lastsize = diameter;
cache->lastalpha = alpha;
cache->lastjitter = brush->jitter;
}
else if ((brush->flag & BRUSH_FIXED_TEX) && mtex && mtex->tex) {
int dx = (int)painter->lastpaintpos[0] - (int)pos[0];
int dy = (int)painter->lastpaintpos[1] - (int)pos[1];
if ((dx != 0) || (dy != 0))
brush_painter_fixed_tex_partial_update(painter, pos);
}
}
void BKE_brush_painter_break_stroke(BrushPainter *painter)
{
painter->firsttouch = 1;
}
static void brush_pressure_apply(BrushPainter *painter, Brush *brush, float pressure)
{
if (BKE_brush_use_alpha_pressure(painter->scene, brush))
brush_alpha_set(painter->scene, brush, maxf(0.0f, painter->startalpha * pressure));
if (BKE_brush_use_size_pressure(painter->scene, brush))
BKE_brush_size_set(painter->scene, brush, maxf(1.0f, painter->startsize * pressure));
if (brush->flag & BRUSH_JITTER_PRESSURE)
brush->jitter = maxf(0.0f, painter->startjitter * pressure);
if (brush->flag & BRUSH_SPACING_PRESSURE)
brush->spacing = maxf(1.0f, painter->startspacing * (1.5f - pressure));
}
void BKE_brush_jitter_pos(const Scene *scene, Brush *brush, const float pos[2], float jitterpos[2])
{
int use_jitter = brush->jitter != 0;
@@ -1088,164 +855,6 @@ void BKE_brush_jitter_pos(const Scene *scene, Brush *brush, const float pos[2],
}
}
int BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2], double time, float pressure,
void *user, int use_color_correction)
{
Scene *scene = painter->scene;
Brush *brush = painter->brush;
int totpaintops = 0;
if (pressure == 0.0f) {
if (painter->lastpressure) // XXX - hack, operator misses
pressure = painter->lastpressure;
else
pressure = 1.0f; /* zero pressure == not using tablet */
}
if (painter->firsttouch) {
/* paint exactly once on first touch */
painter->startpaintpos[0] = pos[0];
painter->startpaintpos[1] = pos[1];
brush_pressure_apply(painter, brush, pressure);
if (painter->cache.enabled)
brush_painter_refresh_cache(painter, pos, use_color_correction);
totpaintops += func(user, painter->cache.ibuf, pos, pos);
painter->lasttime = time;
painter->firsttouch = 0;
painter->lastpaintpos[0] = pos[0];
painter->lastpaintpos[1] = pos[1];
}
#if 0
else if (painter->brush->flag & BRUSH_AIRBRUSH) {
float spacing, step, paintpos[2], dmousepos[2], len;
double starttime, curtime = time;
/* compute brush spacing adapted to brush size */
spacing = brush->rate; //radius*brush->spacing*0.01f;
/* setup starting time, direction vector and accumulated time */
starttime = painter->accumtime;
sub_v2_v2v2(dmousepos, pos, painter->lastmousepos);
len = normalize_v2(dmousepos);
painter->accumtime += curtime - painter->lasttime;
/* do paint op over unpainted time distance */
while (painter->accumtime >= spacing) {
step = (spacing - starttime) * len;
paintpos[0] = painter->lastmousepos[0] + dmousepos[0] * step;
paintpos[1] = painter->lastmousepos[1] + dmousepos[1] * step;
if (painter->cache.enabled)
brush_painter_refresh_cache(painter);
totpaintops += func(user, painter->cache.ibuf,
painter->lastpaintpos, paintpos);
painter->lastpaintpos[0] = paintpos[0];
painter->lastpaintpos[1] = paintpos[1];
painter->accumtime -= spacing;
starttime -= spacing;
}
painter->lasttime = curtime;
}
#endif
else {
float startdistance, spacing, step, paintpos[2], dmousepos[2], finalpos[2];
float t, len, press;
const int radius = BKE_brush_size_get(scene, brush);
/* compute brush spacing adapted to brush radius, spacing may depend
* on pressure, so update it */
brush_pressure_apply(painter, brush, painter->lastpressure);
spacing = maxf(1.0f, radius) * brush->spacing * 0.01f;
/* setup starting distance, direction vector and accumulated distance */
startdistance = painter->accumdistance;
sub_v2_v2v2(dmousepos, pos, painter->lastmousepos);
len = normalize_v2(dmousepos);
painter->accumdistance += len;
if (brush->flag & BRUSH_SPACE) {
/* do paint op over unpainted distance */
while ((len > 0.0f) && (painter->accumdistance >= spacing)) {
step = spacing - startdistance;
paintpos[0] = painter->lastmousepos[0] + dmousepos[0] * step;
paintpos[1] = painter->lastmousepos[1] + dmousepos[1] * step;
t = step / len;
press = (1.0f - t) * painter->lastpressure + t * pressure;
brush_pressure_apply(painter, brush, press);
spacing = maxf(1.0f, radius) * brush->spacing * 0.01f;
BKE_brush_jitter_pos(scene, brush, paintpos, finalpos);
if (painter->cache.enabled)
brush_painter_refresh_cache(painter, finalpos, use_color_correction);
totpaintops +=
func(user, painter->cache.ibuf, painter->lastpaintpos, finalpos);
painter->lastpaintpos[0] = paintpos[0];
painter->lastpaintpos[1] = paintpos[1];
painter->accumdistance -= spacing;
startdistance -= spacing;
}
}
else {
BKE_brush_jitter_pos(scene, brush, pos, finalpos);
if (painter->cache.enabled)
brush_painter_refresh_cache(painter, finalpos, use_color_correction);
totpaintops += func(user, painter->cache.ibuf, pos, finalpos);
painter->lastpaintpos[0] = pos[0];
painter->lastpaintpos[1] = pos[1];
painter->accumdistance = 0;
}
/* do airbrush paint ops, based on the number of paint ops left over
* from regular painting. this is a temporary solution until we have
* accurate time stamps for mouse move events */
if (brush->flag & BRUSH_AIRBRUSH) {
double curtime = time;
double painttime = brush->rate * totpaintops;
painter->accumtime += curtime - painter->lasttime;
if (painter->accumtime <= painttime)
painter->accumtime = 0.0;
else
painter->accumtime -= painttime;
while (painter->accumtime >= (double)brush->rate) {
brush_pressure_apply(painter, brush, pressure);
BKE_brush_jitter_pos(scene, brush, pos, finalpos);
if (painter->cache.enabled)
brush_painter_refresh_cache(painter, finalpos, use_color_correction);
totpaintops +=
func(user, painter->cache.ibuf, painter->lastmousepos, finalpos);
painter->accumtime -= (double)brush->rate;
}
painter->lasttime = curtime;
}
}
painter->lastmousepos[0] = pos[0];
painter->lastmousepos[1] = pos[1];
painter->lastpressure = pressure;
brush_alpha_set(scene, brush, painter->startalpha);
BKE_brush_size_set(scene, brush, painter->startsize);
brush->jitter = painter->startjitter;
brush->spacing = painter->startspacing;
return totpaintops;
}
/* Uses the brush curve control to find a strength value between 0 and 1 */
float BKE_brush_curve_strength_clamp(Brush *br, float p, const float len)

View File

@@ -2768,7 +2768,7 @@ static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *n
if (skip_align) {
/* handles need to be updated during animation and applying stuff like hooks,
* but in such situations it's quite difficult to distinguish in which order
* but in such situatios it's quite difficult to distinguish in which order
* align handles should be aligned so skip them for now */
return;
}

View File

@@ -1999,7 +1999,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
}
/* if there are no more dest layers, we're done */
if (dest_i >= dest->totlayer) break;
if (dest_i >= dest->totlayer) return;
/* if we found a matching layer, copy the data */
if (dest->layers[dest_i].type == source->layers[src_i].type) {

View File

@@ -1944,7 +1944,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
{
/* Note: Current method only uses polygon edges to detect neighboring pixels.
* -> It doesn't always lead to the optimum pixel but is accurate enough
* and faster/simpler than including possible face tip point links)
* and faster/simplier than including possible face tip point links)
*/
int x, y;
@@ -2852,15 +2852,15 @@ static void mesh_faces_nearest_point_dp(void *userdata, int index, const float c
/***************************** Brush Painting Calls ******************************/
/**
* Mix color values to canvas point.
/*
* Mix color values to canvas point.
*
* \param surface canvas surface
* \param index surface point index
* \param paintFlags paint object flags
* \param paintColor,Alpha,Wetness to be mixed paint values
* \param timescale value used to adjust time dependent
* operations when using substeps
* surface : canvas surface
* index : surface point index
* paintFlags : paint object flags
* paintColor,Alpha,Wetness : to be mixed paint values
* timescale : value used to adjust time dependand
* operations when using substeps
*/
static void dynamicPaint_mixPaintColors(DynamicPaintSurface *surface, int index, int paintFlags,
const float paintColor[3], float *paintAlpha, float *paintWetness, float *timescale)
@@ -4161,7 +4161,7 @@ static int dynamicPaint_prepareEffectStep(DynamicPaintSurface *surface, Scene *s
pdEndEffectors(&effectors);
}
/* Get number of required steps using average point distance
/* Get number of required steps using averate point distance
* so that just a few ultra close pixels wont up substeps to max */
/* adjust number of required substep by fastest active effect */
@@ -4224,7 +4224,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
/* Only continue if surrounding point has higher wetness */
if (ePoint->wetness < pPoint->wetness || ePoint->wetness < MIN_WETNESS) continue;
w_factor = 1.0f / numOfNeighs * MIN2(ePoint->wetness, 1.0f) * speed_scale;
w_factor = 1.0f / numOfNeighs *MIN2(ePoint->wetness, 1.0f) * speed_scale;
CLAMP(w_factor, 0.0f, 1.0f);
/* mix new wetness and color */

View File

@@ -2607,7 +2607,8 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
/* invalidate color managed buffers if render result changed */
BLI_lock_thread(LOCK_COLORMANAGE);
if (ibuf->x != rres.rectx || ibuf->y != rres.recty || ibuf->rect_float != rectf) {
if (ibuf->x != rres.rectx || ibuf->y != rres.recty || ibuf->rect_float != rectf)
{
ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
}

View File

@@ -32,7 +32,7 @@
/* NOTE:
*
* This file is no longer used to provide tools for the deprecated IPO system. Instead, it
* This file is no longer used to provide tools for the depreceated IPO system. Instead, it
* is only used to house the conversion code to the new system.
*
* -- Joshua Leung, Jan 2009
@@ -1765,7 +1765,7 @@ void do_versions_ipos_to_animato(Main *main)
/* Any actuators set to ACT_IPO at this point are actually Action Actuators that
* need this converted IPO to finish converting the actuator. */
if (act->type == ACT_IPO) {
aa = (bActionActuator *)act->data;
aa = (bActionActuator*)act->data;
aa->act = ob->adt->action;
act->type = ACT_ACTION;
}

View File

@@ -133,7 +133,7 @@ Key *BKE_key_add(ID *id) /* common function */
key->uidgen = 1;
/* XXX the code here uses some defines which will soon be deprecated... */
/* XXX the code here uses some defines which will soon be depreceated... */
switch (GS(id->name)) {
case ID_ME:
el = key->elemstr;

View File

@@ -916,6 +916,19 @@ void BKE_mask_free_nolib(Mask *mask)
BKE_mask_layer_free_list(&mask->masklayers);
}
static void ntree_unlink_mask_cb(void *calldata, struct ID *UNUSED(owner_id), struct bNodeTree *ntree)
{
ID *id = (ID *)calldata;
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
if (node->id == id) {
node->id = NULL;
}
}
}
void BKE_mask_free(Main *bmain, Mask *mask)
{
bScreen *scr;
@@ -962,11 +975,21 @@ void BKE_mask_free(Main *bmain, Mask *mask)
}
SEQ_END
}
if (scene->nodetree) {
bNode *node;
for (node = scene->nodetree->nodes.first; node; node = node->next) {
if (node->id == &mask->id) {
node->id = NULL;
}
}
}
}
{
bNodeTreeType *treetype = ntreeGetType(NTREE_COMPOSIT);
treetype->foreach_nodetree(bmain, (void *)mask, &BKE_node_tree_unlink_id_cb);
treetype->foreach_nodetree(bmain, (void *)mask, &ntree_unlink_mask_cb);
}
/* free mask data */
@@ -1525,7 +1548,7 @@ void BKE_mask_parent_init(MaskParent *parent)
}
/* *** own animation/shapekey implementation ***
/* *** own animation/shapekey implimentation ***
* BKE_mask_layer_shape_XXX */
int BKE_mask_layer_shape_totvert(MaskLayer *masklay)

View File

@@ -1208,7 +1208,7 @@ static float maskrasterize_layer_isect(unsigned int *face, float (*cos)[3], cons
/* needs work */
#if 1
/* quad check fails for bow-tie, so keep using 2 tri checks */
/* quad check fails for bowtie, so keep using 2 tri checks */
//if (isect_point_quad_v2(xy, cos[face[0]], cos[face[1]], cos[face[2]], cos[face[3]]))
if (isect_point_tri_v2(xy, cos[face[0]], cos[face[1]], cos[face[2]]) ||
isect_point_tri_v2(xy, cos[face[0]], cos[face[2]], cos[face[3]]))
@@ -1216,7 +1216,7 @@ static float maskrasterize_layer_isect(unsigned int *face, float (*cos)[3], cons
return maskrasterize_layer_z_depth_quad(xy, cos[face[0]], cos[face[1]], cos[face[2]], cos[face[3]]);
}
#elif 1
/* don't use isect_point_tri_v2_cw because we could have bow-tie quads */
/* don't use isect_point_tri_v2_cw because we could have bowtie quads */
if (isect_point_tri_v2(xy, cos[face[0]], cos[face[1]], cos[face[2]])) {
return maskrasterize_layer_z_depth_tri(xy, cos[face[0]], cos[face[1]], cos[face[2]]);

View File

@@ -873,7 +873,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, short totcol)
int actcol_orig = ob->actcol;
short i;
while (object_remove_material_slot(ob)) {}
while (object_remove_material_slot(ob, -1)) {}
/* now we have the right number of slots */
for (i = 0; i < totcol; i++)
@@ -1194,7 +1194,7 @@ void automatname(Material *ma)
}
#endif
int object_remove_material_slot(Object *ob)
int object_remove_material_slot(Object *ob, int slot)
{
Material *mao, ***matarar;
Object *obt;
@@ -1205,9 +1205,12 @@ int object_remove_material_slot(Object *ob)
return FALSE;
}
if (slot < 0)
slot = ob->actcol;
/* this should never happen and used to crash */
if (ob->actcol <= 0) {
printf("%s: invalid material index %d, report a bug!\n", __func__, ob->actcol);
if (slot <= 0) {
printf("%s: invalid material index %d, report a bug!\n", __func__, slot);
BLI_assert(0);
return FALSE;
}
@@ -1224,10 +1227,10 @@ int object_remove_material_slot(Object *ob)
if (*matarar == NULL) return FALSE;
/* we delete the actcol */
mao = (*matarar)[ob->actcol - 1];
mao = (*matarar)[slot - 1];
if (mao) mao->id.us--;
for (a = ob->actcol; a < ob->totcol; a++)
for (a = slot; a < ob->totcol; a++)
(*matarar)[a - 1] = (*matarar)[a];
(*totcolp)--;
@@ -1236,7 +1239,7 @@ int object_remove_material_slot(Object *ob)
*matarar = NULL;
}
actcol = ob->actcol;
actcol = slot;
obt = G.main->object.first;
while (obt) {
@@ -1327,9 +1330,9 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
r_col[2] = facm * (r_col[2]) + fac * (r_col[2]) / col[2];
break;
case MA_RAMP_DIFF:
r_col[0] = facm * (r_col[0]) + fac * fabsf(r_col[0] - col[0]);
r_col[1] = facm * (r_col[1]) + fac * fabsf(r_col[1] - col[1]);
r_col[2] = facm * (r_col[2]) + fac * fabsf(r_col[2] - col[2]);
r_col[0] = facm * (r_col[0]) + fac *fabsf(r_col[0] - col[0]);
r_col[1] = facm * (r_col[1]) + fac *fabsf(r_col[1] - col[1]);
r_col[2] = facm * (r_col[2]) + fac *fabsf(r_col[2] - col[2]);
break;
case MA_RAMP_DARK:
tmp = col[0] + ((1 - col[0]) * facm);
@@ -1490,7 +1493,7 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
}
/**
* \brief copy/paste buffer, if we had a proper py api that would be better
* \brief copy/paste buffer, if we had a propper py api that would be better
* \note matcopybuf.nodetree does _NOT_ use ID's
* \todo matcopybuf.nodetree's node->id's are NOT validated, this will crash!
*/

View File

@@ -788,7 +788,7 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
nr--;
}
/* check corrupt cases, bow-tie geometry, cant handle these because edge data wont exist so just return 0 */
/* check corrupt cases, bowtie geometry, cant handle these because edge data wont exist so just return 0 */
if (nr == 3) {
if (
/* real edges */
@@ -2043,7 +2043,7 @@ static void bm_corners_to_loops_ex(ID *id, CustomData *fdata, CustomData *ldata,
int side, corners;
if (CustomData_external_test(fdata, CD_MDISPS)) {
if (id && fdata->external) {
if (id) {
CustomData_external_add(ldata, id, CD_MDISPS,
totloop, fdata->external->filename);
}

View File

@@ -0,0 +1,275 @@
/*
* ***** 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) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#include "DNA_object_types.h"
#include "BLI_math.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_modifier.h"
#include "BKE_deform.h"
#include "BKE_mirror.h"
#include "MEM_guardedalloc.h"
static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
Object *ob,
DerivedMesh *dm,
int axis, int skip_orig)
{
const float tolerance_sq = mmd->tolerance * mmd->tolerance;
const int do_vtargetmap = !(mmd->flag & MOD_MIR_NO_MERGE);
int is_vtargetmap = FALSE; /* true when it should be used */
DerivedMesh *result;
const int maxVerts = dm->getNumVerts(dm);
const int maxEdges = dm->getNumEdges(dm);
const int maxLoops = dm->getNumLoops(dm);
const int maxPolys = dm->getNumPolys(dm);
MVert *mv, *mv_prev;
MEdge *me;
MLoop *ml;
MPoly *mp;
float mtx[4][4];
int i, j;
int a, totshape;
int *orig_index;
int *vtargetmap = NULL, *vtmap_a = NULL, *vtmap_b = NULL;
/* mtx is the mirror transformation */
unit_m4(mtx);
mtx[axis][axis] = -1.0f;
if (mmd->mirror_ob) {
float tmp[4][4];
float itmp[4][4];
/* tmp is a transform from coords relative to the object's own origin,
* to coords relative to the mirror object origin */
invert_m4_m4(tmp, mmd->mirror_ob->obmat);
mult_m4_m4m4(tmp, tmp, ob->obmat);
/* itmp is the reverse transform back to origin-relative coordinates */
invert_m4_m4(itmp, tmp);
/* combine matrices to get a single matrix that translates coordinates into
* mirror-object-relative space, does the mirror, and translates back to
* origin-relative space */
mult_m4_m4m4(mtx, mtx, tmp);
mult_m4_m4m4(mtx, itmp, mtx);
}
result = CDDM_from_template(dm, maxVerts * 2, maxEdges * 2, 0, maxLoops * 2, maxPolys * 2);
/*copy customdata to original geometry*/
DM_copy_vert_data(dm, result, 0, 0, maxVerts);
DM_copy_edge_data(dm, result, 0, 0, maxEdges);
DM_copy_loop_data(dm, result, 0, 0, maxLoops);
DM_copy_poly_data(dm, result, 0, 0, maxPolys);
/* subsurf for eg wont have mesh data in the */
/* now add mvert/medge/mface layers */
if (!CustomData_has_layer(&dm->vertData, CD_MVERT)) {
dm->copyVertArray(dm, CDDM_get_verts(result));
}
if (!CustomData_has_layer(&dm->edgeData, CD_MEDGE)) {
dm->copyEdgeArray(dm, CDDM_get_edges(result));
}
if (!CustomData_has_layer(&dm->polyData, CD_MPOLY)) {
dm->copyLoopArray(dm, CDDM_get_loops(result));
dm->copyPolyArray(dm, CDDM_get_polys(result));
}
/* copy customdata to new geometry,
* copy from its self because this data may have been created in the checks above */
DM_copy_vert_data(result, result, 0, maxVerts, maxVerts);
DM_copy_edge_data(result, result, 0, maxEdges, maxEdges);
/* loops are copied later */
DM_copy_poly_data(result, result, 0, maxPolys, maxPolys);
if (do_vtargetmap) {
/* second half is filled with -1 */
vtargetmap = MEM_mallocN(sizeof(int) * maxVerts * 2, "MOD_mirror tarmap");
vtmap_a = vtargetmap;
vtmap_b = vtargetmap + maxVerts;
}
/* mirror vertex coordinates */
mv_prev = CDDM_get_verts(result);
mv = mv_prev + maxVerts;
orig_index = (int *)CustomData_get_layer(&result->vertData, CD_ORIGINDEX) + maxVerts;
for (i = 0; i < maxVerts; i++, mv++, mv_prev++, orig_index++) {
mul_m4_v3(mtx, mv->co);
if (skip_orig)
*orig_index = ORIGINDEX_NONE;
if (do_vtargetmap) {
/* compare location of the original and mirrored vertex, to see if they
* should be mapped for merging */
if (UNLIKELY(len_squared_v3v3(mv_prev->co, mv->co) < tolerance_sq)) {
*vtmap_a = maxVerts + i;
is_vtargetmap = TRUE;
if (skip_orig)
*orig_index = i;
}
else {
*vtmap_a = -1;
}
*vtmap_b = -1; /* fill here to avoid 2x loops */
vtmap_a++;
vtmap_b++;
}
}
/* handle shape keys */
totshape = CustomData_number_of_layers(&result->vertData, CD_SHAPEKEY);
for (a = 0; a < totshape; a++) {
float (*cos)[3] = CustomData_get_layer_n(&result->vertData, CD_SHAPEKEY, a);
for (i = maxVerts; i < result->numVertData; i++) {
mul_m4_v3(mtx, cos[i]);
}
}
/* adjust mirrored edge vertex indices */
me = CDDM_get_edges(result) + maxEdges;
for (i = 0; i < maxEdges; i++, me++) {
me->v1 += maxVerts;
me->v2 += maxVerts;
}
/* adjust mirrored poly loopstart indices, and reverse loop order (normals) */
mp = CDDM_get_polys(result) + maxPolys;
ml = CDDM_get_loops(result);
for (i = 0; i < maxPolys; i++, mp++) {
MLoop *ml2;
int e;
/* reverse the loop, but we keep the first vertex in the face the same,
* to ensure that quads are split the same way as on the other side */
DM_copy_loop_data(result, result, mp->loopstart, mp->loopstart + maxLoops, 1);
for (j = 1; j < mp->totloop; j++)
DM_copy_loop_data(result, result, mp->loopstart + j, mp->loopstart + maxLoops + mp->totloop - j, 1);
ml2 = ml + mp->loopstart + maxLoops;
e = ml2[0].e;
for (j = 0; j < mp->totloop - 1; j++) {
ml2[j].e = ml2[j + 1].e;
}
ml2[mp->totloop - 1].e = e;
mp->loopstart += maxLoops;
}
/* adjust mirrored loop vertex and edge indices */
ml = CDDM_get_loops(result) + maxLoops;
for (i = 0; i < maxLoops; i++, ml++) {
ml->v += maxVerts;
ml->e += maxEdges;
}
/* handle uvs,
* let tessface recalc handle updating the MTFace data */
if (mmd->flag & (MOD_MIR_MIRROR_U | MOD_MIR_MIRROR_V)) {
const int do_mirr_u = (mmd->flag & MOD_MIR_MIRROR_U) != 0;
const int do_mirr_v = (mmd->flag & MOD_MIR_MIRROR_V) != 0;
const int totuv = CustomData_number_of_layers(&result->loopData, CD_MLOOPUV);
for (a = 0; a < totuv; a++) {
MLoopUV *dmloopuv = CustomData_get_layer_n(&result->loopData, CD_MLOOPUV, a);
int j = maxLoops;
dmloopuv += j; /* second set of loops only */
for (; j-- > 0; dmloopuv++) {
if (do_mirr_u) dmloopuv->uv[0] = 1.0f - dmloopuv->uv[0];
if (do_mirr_v) dmloopuv->uv[1] = 1.0f - dmloopuv->uv[1];
}
}
}
/* handle vgroup stuff */
if ((mmd->flag & MOD_MIR_VGROUP) && CustomData_has_layer(&result->vertData, CD_MDEFORMVERT)) {
MDeformVert *dvert = (MDeformVert *) CustomData_get_layer(&result->vertData, CD_MDEFORMVERT) + maxVerts;
int *flip_map = NULL, flip_map_len = 0;
flip_map = defgroup_flip_map(ob, &flip_map_len, FALSE);
if (flip_map) {
for (i = 0; i < maxVerts; dvert++, i++) {
/* merged vertices get both groups, others get flipped */
if (do_vtargetmap && (vtargetmap[i] != -1))
defvert_flip_merged(dvert, flip_map, flip_map_len);
else
defvert_flip(dvert, flip_map, flip_map_len);
}
MEM_freeN(flip_map);
}
}
if (do_vtargetmap) {
/* slow - so only call if one or more merge verts are found,
* users may leave this on and not realize there is nothing to merge - campbell */
if (is_vtargetmap) {
result = CDDM_merge_verts(result, vtargetmap);
}
MEM_freeN(vtargetmap);
}
return result;
}
DerivedMesh *mirror_make_derived_from_derived(MirrorModifierData *mmd,
Object *ob, DerivedMesh *dm, int orig)
{
DerivedMesh *result = dm;
/* check which axes have been toggled and mirror accordingly */
if (mmd->flag & MOD_MIR_AXIS_X) {
result = doMirrorOnAxis(mmd, ob, result, 0, orig);
}
if (mmd->flag & MOD_MIR_AXIS_Y) {
DerivedMesh *tmp = result;
result = doMirrorOnAxis(mmd, ob, result, 1, orig);
if (tmp != dm) tmp->release(tmp); /* free intermediate results */
}
if (mmd->flag & MOD_MIR_AXIS_Z) {
DerivedMesh *tmp = result;
result = doMirrorOnAxis(mmd, ob, result, 2, orig);
if (tmp != dm) tmp->release(tmp); /* free intermediate results */
}
return result;
}

View File

@@ -49,7 +49,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
MLoop *mloop, *ml;
BMVert *v, **vtable, **verts = NULL;
BMEdge *e, **etable, **edges = NULL;
float (*face_normals)[3];
float has_face_normals;
BMFace *f;
BMIter liter;
BLI_array_declare(verts);
@@ -72,8 +72,8 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
BM_data_layer_add(bm, &bm->edata, CD_BWEIGHT);
BM_data_layer_add(bm, &bm->vdata, CD_BWEIGHT);
vtable = MEM_callocN(sizeof(void **) * totvert, __func__);
etable = MEM_callocN(sizeof(void **) * totedge, __func__);
vtable = MEM_callocN(sizeof(void **) * totvert, "vert table in BMDM_Copy");
etable = MEM_callocN(sizeof(void **) * totedge, "edge table in BMDM_Copy");
/*do verts*/
mv = mvert = dm->dupVertArray(dm);
@@ -110,7 +110,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
/*do faces*/
mp = dm->getPolyArray(dm);
mloop = dm->getLoopArray(dm);
face_normals = CustomData_get_layer(&dm->polyData, CD_NORMAL); /* can be NULL */
has_face_normals = CustomData_has_layer(&dm->polyData, CD_NORMAL);
for (i = 0; i < dm->numPolyData; i++, mp++) {
BMLoop *l;
@@ -129,9 +129,8 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
f = BM_face_create_ngon(bm, verts[0], verts[1], edges, mp->totloop, FALSE);
if (UNLIKELY(f == NULL)) {
if (!f)
continue;
}
f->head.hflag = BM_face_flag_from_mflag(mp->flag);
f->mat_nr = mp->mat_nr;
@@ -144,11 +143,11 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
CustomData_to_bmesh_block(&dm->polyData, &bm->pdata, i, &f->head.data);
if (face_normals) {
copy_v3_v3(f->no, face_normals[i]);
}
else {
BM_face_normal_update(f);
if (has_face_normals) {
float *fno;
fno = CustomData_bmesh_get(&bm->pdata, &f->head.data, CD_NORMAL);
copy_v3_v3(f->no, fno);
}
}

View File

@@ -52,7 +52,6 @@
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
@@ -72,7 +71,6 @@
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_movieclip.h"
#include "BKE_node.h"
#include "BKE_image.h" /* openanim */
#include "BKE_tracking.h"
@@ -626,22 +624,24 @@ static ImBuf *get_undistorted_ibuf(MovieClip *clip, struct MovieDistortion *dist
return undistibuf;
}
static int need_undistortion_postprocess(MovieClipUser *user)
static int need_undistortion_postprocess(MovieClipUser *user, int flag)
{
int result = 0;
/* only full undistorted render can be used as on-fly undistorting image */
result |= (user->render_size == MCLIP_PROXY_RENDER_SIZE_FULL) &&
(user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) != 0;
if (flag & MCLIP_USE_PROXY) {
result |= (user->render_size == MCLIP_PROXY_RENDER_SIZE_FULL) &&
(user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) != 0;
}
return result;
}
static int need_postprocessed_frame(MovieClipUser *user, int postprocess_flag)
static int need_postprocessed_frame(MovieClipUser *user, int flag, int postprocess_flag)
{
int result = postprocess_flag;
result |= need_undistortion_postprocess(user);
result |= need_undistortion_postprocess(user, flag);
return result;
}
@@ -688,7 +688,7 @@ static ImBuf *get_postprocessed_cached_frame(MovieClip *clip, MovieClipUser *use
if (cache->postprocessed.flag != postprocess_flag)
return NULL;
if (need_undistortion_postprocess(user)) {
if (need_undistortion_postprocess(user, flag)) {
if (!check_undistortion_cache_flags(clip))
return NULL;
}
@@ -719,7 +719,7 @@ static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *u
cache->postprocessed.render_flag = 0;
}
if (need_undistortion_postprocess(user)) {
if (need_undistortion_postprocess(user, flag)) {
copy_v2_v2(cache->postprocessed.principal, camera->principal);
copy_v3_v3(&cache->postprocessed.k1, &camera->k1);
cache->postprocessed.undistortion_used = TRUE;
@@ -763,7 +763,7 @@ static ImBuf *movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *u
BLI_lock_thread(LOCK_MOVIECLIP);
/* try to obtain cached postprocessed frame first */
if (need_postprocessed_frame(user, postprocess_flag)) {
if (need_postprocessed_frame(user, flag, postprocess_flag)) {
ibuf = get_postprocessed_cached_frame(clip, user, flag, postprocess_flag);
if (!ibuf)
@@ -1326,11 +1326,6 @@ void BKE_movieclip_unlink(Main *bmain, MovieClip *clip)
}
}
{
bNodeTreeType *treetype = ntreeGetType(NTREE_COMPOSIT);
treetype->foreach_nodetree(bmain, (void *)clip, &BKE_node_tree_unlink_id_cb);
}
clip->id.us = 0;
}

View File

@@ -666,9 +666,7 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl)
mdisp->totdisp = totdisp;
mdisp->level = lvl;
if (gpm) {
multires_grid_paint_mask_downsample(&gpm[g], lvl);
}
multires_grid_paint_mask_downsample(&gpm[g], lvl);
}
}
}
@@ -895,16 +893,15 @@ static void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl
CCGKey highGridKey, lowGridKey;
CCGSubSurf *ss;
int i, numGrids, highGridSize;
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
/* create subsurf DM from original mesh at high level */
cddm = CDDM_from_mesh(me, NULL);
DM_set_only_copy(cddm, CD_MASK_BAREMESH);
highdm = subsurf_dm_create_local(ob, cddm, totlvl, simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, has_mask);
highdm = subsurf_dm_create_local(ob, cddm, totlvl, simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, TRUE);
ss = ((CCGDerivedMesh *)highdm)->ss;
/* create multires DM from original mesh at low level */
lowdm = multires_dm_create_local(ob, cddm, lvl, lvl, simple, has_mask);
lowdm = multires_dm_create_local(ob, cddm, lvl, lvl, simple, TRUE);
cddm->release(cddm);
/* copy subsurf grids and replace them with low displaced grids */
@@ -1167,18 +1164,17 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm)
CCGKey highGridKey, lowGridKey;
CCGSubSurf *ss;
int i, j, numGrids, highGridSize, lowGridSize;
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
/* create subsurf DM from original mesh at high level */
if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
else cddm = CDDM_from_mesh(me, NULL);
DM_set_only_copy(cddm, CD_MASK_BAREMESH);
highdm = subsurf_dm_create_local(ob, cddm, totlvl, mmd->simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, has_mask);
highdm = subsurf_dm_create_local(ob, cddm, totlvl, mmd->simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, TRUE);
ss = ((CCGDerivedMesh *)highdm)->ss;
/* create multires DM from original mesh and displacements */
lowdm = multires_dm_create_local(ob, cddm, lvl, totlvl, mmd->simple, has_mask);
lowdm = multires_dm_create_local(ob, cddm, lvl, totlvl, mmd->simple, TRUE);
cddm->release(cddm);
/* gather grid data */
@@ -1230,13 +1226,12 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm)
}
else {
DerivedMesh *cddm, *subdm;
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
else cddm = CDDM_from_mesh(me, NULL);
DM_set_only_copy(cddm, CD_MASK_BAREMESH);
subdm = subsurf_dm_create_local(ob, cddm, mmd->totlvl, mmd->simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, has_mask);
subdm = subsurf_dm_create_local(ob, cddm, mmd->totlvl, mmd->simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, TRUE);
cddm->release(cddm);
multiresModifier_disp_run(dm, me, NULL, CALC_DISPLACEMENTS, subdm->getGridData(subdm), mmd->totlvl);
@@ -2112,7 +2107,7 @@ void multires_load_old(Object *ob, Mesh *me)
* reference subsurfed dm with this option, before calling multiresModifier_disp_run(),
* which implicitly expects both subsurfs from its first dm and oldGridData parameters to
* be of the same "format"! */
dm = multires_make_derived_from_derived(orig, mmd, ob, 0);
dm = multires_make_derived_from_derived(orig, mmd, ob, MULTIRES_ALLOC_PAINT_MASK);
multires_load_old_dm(dm, me, mmd->totlvl + 1);

View File

@@ -889,44 +889,23 @@ Object *BKE_object_add(struct Scene *scene, int type)
return ob;
}
SoftBody *copy_softbody(SoftBody *sb, int copy_caches)
SoftBody *copy_softbody(SoftBody *sb)
{
SoftBody *sbn;
if (sb == NULL) return(NULL);
sbn = MEM_dupallocN(sb);
if (copy_caches == FALSE) {
sbn->totspring = sbn->totpoint = 0;
sbn->bpoint = NULL;
sbn->bspring = NULL;
}
else {
sbn->totspring = sb->totspring;
sbn->totpoint = sb->totpoint;
if (sbn->bpoint) {
int i;
sbn->bpoint = MEM_dupallocN(sbn->bpoint);
for (i = 0; i < sbn->totpoint; i++) {
if (sbn->bpoint[i].springs)
sbn->bpoint[i].springs = MEM_dupallocN(sbn->bpoint[i].springs);
}
}
if (sb->bspring)
sbn->bspring = MEM_dupallocN(sb->bspring);
}
sbn->totspring = sbn->totpoint = 0;
sbn->bpoint = NULL;
sbn->bspring = NULL;
sbn->keys = NULL;
sbn->totkey = sbn->totpointkey = 0;
sbn->scratch = NULL;
sbn->pointcache = BKE_ptcache_copy_list(&sbn->ptcaches, &sb->ptcaches, copy_caches);
sbn->pointcache = BKE_ptcache_copy_list(&sbn->ptcaches, &sb->ptcaches);
if (sb->effector_weights)
sbn->effector_weights = MEM_dupallocN(sb->effector_weights);
@@ -999,7 +978,7 @@ static ParticleSystem *copy_particlesystem(ParticleSystem *psys)
psysn->childcachebufs.first = psysn->childcachebufs.last = NULL;
psysn->renderdata = NULL;
psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches, FALSE);
psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches);
/* XXX - from reading existing code this seems correct but intended usage of
* pointcache should /w cloth should be added in 'ParticleSystem' - campbell */
@@ -1060,7 +1039,7 @@ void BKE_object_copy_particlesystems(Object *obn, Object *ob)
void BKE_object_copy_softbody(Object *obn, Object *ob)
{
if (ob->soft)
obn->soft = copy_softbody(ob->soft, FALSE);
obn->soft = copy_softbody(ob->soft);
}
static void copy_object_pose(Object *obn, Object *ob)
@@ -1141,7 +1120,7 @@ void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
copy_v3_v3(ob_tar->size, ob_src->size);
}
static Object *object_copy_do(Object *ob, int copy_caches)
Object *BKE_object_copy(Object *ob)
{
Object *obn;
ModifierData *md;
@@ -1202,7 +1181,7 @@ static Object *object_copy_do(Object *ob, int copy_caches)
if (obn->pd->rng)
obn->pd->rng = MEM_dupallocN(ob->pd->rng);
}
obn->soft = copy_softbody(ob->soft, copy_caches);
obn->soft = copy_softbody(ob->soft);
obn->bsoft = copy_bulletsoftbody(ob->bsoft);
BKE_object_copy_particlesystems(obn, ob);
@@ -1218,18 +1197,6 @@ static Object *object_copy_do(Object *ob, int copy_caches)
return obn;
}
/* copy objects, will re-initialize cached simulation data */
Object *BKE_object_copy(Object *ob)
{
return object_copy_do(ob, FALSE);
}
/* copy objects, will duplicate cached simulation data */
Object *BKE_object_copy_with_caches(Object *ob)
{
return object_copy_do(ob, TRUE);
}
static void extern_local_object(Object *ob)
{
ParticleSystem *psys;

View File

@@ -39,6 +39,7 @@
#include "BLI_bitmap.h"
#include "BLI_utildefines.h"
#include "BLI_math_vector.h"
#include "BKE_brush.h"
#include "BKE_context.h"
@@ -190,7 +191,7 @@ void BKE_paint_free(Paint *paint)
}
/* called when copying scene settings, so even if 'src' and 'tar' are the same
* still do a id_us_plus(), rather then if we were copying between 2 existing
* still do a id_us_plus(), rather then if we were copying betweem 2 existing
* scenes where a matching value should decrease the existing user count as
* with paint_brush_set() */
void BKE_paint_copy(Paint *src, Paint *tar)
@@ -230,3 +231,21 @@ float paint_grid_paint_mask(const GridPaintMask *gpm, unsigned level,
return gpm->data[(y * factor) * gridsize + (x * factor)];
}
void paint_calculate_rake_rotation(UnifiedPaintSettings *ups, const float mouse_pos[2])
{
const float u = 0.5f;
const float r = RAKE_THRESHHOLD;
float dpos[2];
sub_v2_v2v2(dpos, ups->last_pos, mouse_pos);
if (len_squared_v2(dpos) >= r * r) {
ups->last_angle = atan2(dpos[0], dpos[1]);
interp_v2_v2v2(ups->last_pos, ups->last_pos,
mouse_pos, u);
copy_v2_v2(ups->last_pos, mouse_pos);
}
}

View File

@@ -116,7 +116,7 @@ int count_particles_mod(ParticleSystem *psys, int totgr, int cur)
}
return tot;
}
/* we allocate path cache memory in chunks instead of a big contiguous
/* we allocate path cache memory in chunks instead of a big continguous
* chunk, windows' memory allocater fails to find big blocks of memory often */
#define PATH_CACHE_BUF_SIZE 1024
@@ -3776,7 +3776,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
ptex->gravity = ptex->field = ptex->time = ptex->clump = ptex->kink =
ptex->effector = ptex->rough1 = ptex->rough2 = ptex->roughe = 1.f;
ptex->length = 1.0f - part->randlength * PSYS_FRAND(child_index + 26);
ptex->length = 1.0f - part->randlength *PSYS_FRAND(child_index + 26);
ptex->length *= part->clength_thres < PSYS_FRAND(child_index + 27) ? part->clength : 1.0f;
for (m = 0; m < MAX_MTEX; m++, mtexp++) {
@@ -3968,7 +3968,7 @@ float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float UNUSED
size *= part->childsize;
if (part->childrandsize != 0.0f)
size *= 1.0f - part->childrandsize * PSYS_FRAND(cpa - psys->child + 26);
size *= 1.0f - part->childrandsize *PSYS_FRAND(cpa - psys->child + 26);
return size;
}

View File

@@ -3777,7 +3777,7 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra))
/* Calculate the speed of the particle relative to the local scale of the
* simulation. This should be called once per particle during a simulation
* step, after the velocity has been updated. element_size defines the scale of
* the simulation, and is typically the distance to neighboring particles. */
* the simulation, and is typically the distance to neighbourning particles. */
static void update_courant_num(ParticleSimulationData *sim, ParticleData *pa,
float dtime, SPHData *sphdata)
{

View File

@@ -2663,59 +2663,32 @@ void BKE_ptcache_free_list(ListBase *ptcaches)
}
}
static PointCache *ptcache_copy(PointCache *cache, int copy_data)
static PointCache *ptcache_copy(PointCache *cache)
{
PointCache *ncache;
ncache= MEM_dupallocN(cache);
/* hmm, should these be copied over instead? */
ncache->mem_cache.first = NULL;
ncache->mem_cache.last = NULL;
if (copy_data == FALSE) {
ncache->mem_cache.first = NULL;
ncache->mem_cache.last = NULL;
ncache->cached_frames = NULL;
ncache->flag= 0;
ncache->simframe= 0;
}
else {
PTCacheMem *pm;
for (pm = cache->mem_cache.first; pm; pm = pm->next) {
PTCacheMem *pmn = MEM_dupallocN(pm);
int i;
for (i = 0; i < BPHYS_TOT_DATA; i++) {
if (pmn->data[i])
pmn->data[i] = MEM_dupallocN(pm->data[i]);
}
BKE_ptcache_mem_pointers_init(pm);
BLI_addtail(&ncache->mem_cache, pmn);
}
if (ncache->cached_frames)
ncache->cached_frames = MEM_dupallocN(cache->cached_frames);
}
/* hmm, should these be copied over instead? */
ncache->cached_frames = NULL;
ncache->edit = NULL;
ncache->flag= 0;
ncache->simframe= 0;
return ncache;
}
/* returns first point cache */
PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old, int copy_data)
PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old)
{
PointCache *cache = ptcaches_old->first;
ptcaches_new->first = ptcaches_new->last = NULL;
for (; cache; cache=cache->next)
BLI_addtail(ptcaches_new, ptcache_copy(cache, copy_data));
BLI_addtail(ptcaches_new, ptcache_copy(cache));
return ptcaches_new->first;
}

View File

@@ -383,7 +383,7 @@ Scene *BKE_scene_add(const char *name)
sce->r.edgeint = 10;
sce->r.ocres = 128;
/* OCIO_TODO: for forwards compatibility only, so if no tonecurve are used,
/* OCIO_TODO: for forwards compatibiliy only, so if no tonecurve are used,
* images would look in the same way as in current blender
*
* perhaps at some point should be completely deprecated?
@@ -1278,8 +1278,3 @@ void BKE_scene_disable_color_management(Scene *scene)
BLI_strncpy(view_settings->view_transform, view, sizeof(view_settings->view_transform));
}
}
int BKE_scene_check_color_management_enabled(const Scene *scene)
{
return strcmp(scene->display_settings.display_device, "None") != 0;
}

View File

@@ -151,7 +151,7 @@ typedef struct SB_thread_context {
#define SOFTGOALSNAP 0.999f
/* if bp-> goal is above make it a *forced follow original* and skip all ODE stuff for this bp
* removes *unnecessary* stiffness from ODE system
* removes *unnecessary* stiffnes from ODE system
*/
#define HEUNWARNLIMIT 1 /* 500 would be fine i think for detecting severe *stiff* stuff */
@@ -3925,7 +3925,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
sst=PIL_check_seconds_timer();
/* Integration back in time is possible in theory, but pretty useless here.
* So we refuse to do so. Since we do not know anything about 'outside' changes
* So we refuse to do so. Since we do not know anything about 'outside' canges
* especially colliders we refuse to go more than 10 frames.
*/
if (dtime < 0 || dtime > 10.5f) return;

View File

@@ -803,6 +803,10 @@ void BKE_texture_make_local(Tex *tex)
if (br->id.lib) is_lib = TRUE;
else is_local = TRUE;
}
if (br->mask_mtex.tex == tex) {
if (br->id.lib) is_lib = TRUE;
else is_local = TRUE;
}
br = br->id.next;
}
pa = bmain->particle.first;
@@ -876,6 +880,13 @@ void BKE_texture_make_local(Tex *tex)
tex->id.us--;
}
}
if (br->mask_mtex.tex == tex) {
if (br->id.lib == NULL) {
br->mask_mtex.tex = tex_new;
tex_new->id.us++;
tex->id.us--;
}
}
br = br->id.next;
}
pa = bmain->particle.first;

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