Commit Graph

104 Commits

Author SHA1 Message Date
Thomas Dinges f372758257 Interface / Modifiers: Don't show cage placeholder in modifier header, if the current modifier does not support it or the cage is disabled (like Subsurf 0).
This way we save some space but still avoid the jumping around while changing settings in the header itself.

Thanks to Brecht for help on this. :)
2013-12-13 20:57:54 +01:00
Bastien Montagne b375388959 Fix [#37266] Skin modifier can't be copied.
Patch by Martin Felke, many thanks.

When copying that modifier across objects, we also have to ensure that a skin CDLayer is present in dest objects (just as when adding it).
2013-11-01 08:31:36 +00:00
Campbell Barton 9794c70f65 modifiers_isCorrectableDeformed now checks a modifier is enabled before returning true,
also check deformMatricesEM callback for modifier_isCorrectableDeformed() rather then checking modifier types.
2013-09-24 00:56:47 +00:00
Sergey Sharybin 35b61a7512 Move GCC attributes into a centraized defines
Instead of having ifdef __GNUC__ all over the headers
to use special compiler's hints use a special file where
all things like this are concentrated.

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

Thanks Campbell for review!
2013-09-01 15:01:15 +00:00
Sergey Sharybin beffaa293e Made modifiers_getVirtualModifierList safe for threading
Move static variables to context filling in by this fcuntion
and owned by a callee function. This ensures no conflicts
between threads happens because of static variables used in
this function.

Also moved modifier types and virtual modifiers data to a
function called from creator. This is needed to be sure all
the information is properly initialied to the time when
threads starts to use this data.

--
svn merge -r57899:57900 ^/branches/soc-2013-depsgraph_mt
2013-08-19 09:05:34 +00:00
Campbell Barton 418011907c remove nan copyrights from code added since blender become opensource (copy paste errors), also remove BKE_script.h 2013-07-02 10:14:59 +00:00
Campbell Barton d9ec2efe8f move modifier callback wrappers into modifier.c 2013-06-19 08:00:20 +00:00
Campbell Barton 532503e0cb fix for problem with creating weight-paint preview.
In the case where the modifier stack didnt need deform-verts to calculate,
they would not be available for the preview either.

This fixes a bug caused by r57206 which set mirror to preview so the mirrored
weights would be displayed, but it only worked when there was an armature after it, see [#35545].
2013-06-13 00:33:48 +00:00
Campbell Barton e648ca8862 use booleans for modifiers and api callbacks. 2013-06-02 03:59:19 +00:00
Brecht Van Lommel 4a4f091155 Fix #35174: dynamic paint displacement missing in render.
A previous bugfix disabled the dynamic paint modifier for orco texture
coordinate evaluation of the modifier stack. However the MOD_APPLY_USECACHE
flag is not a good way to check if the modifier is evaluated for orcos.

Instead I've added a MOD_APPLY_ORCO flag. Also removed a bunch of
applyModifierEM callbacks, none of them served a purpose except for the
subsurf modifier.
2013-05-02 14:42:05 +00:00
Miika Hamalainen 511e3466da Fix [#35110]: Dynamic Paint does not paint accurately in baked "Image Sequence" on Armature-Posed-Mesh
Dynamic Paint was also being calculated during "orco" mesh generation, causing image sequence baking to use orco derived mesh instead. This likely affected vertex type surfaces too in some cases.
2013-04-29 15:02:54 +00:00
Campbell Barton 11ffc7f5c2 remove modifiers_indexInObject(), just call BLI_findindex directly. 2012-12-15 05:46:41 +00:00
Campbell Barton d94b2efbb9 disable applying constructive modifiers when in sculpt mode with multi-res data, since this would crash.
also rename modifier_sameTopology -> modifier_isSameTopology(), modifier_nonGeometrical -> modifier_isNonGeometrical()
2012-11-13 14:21:55 +00:00
Joshua Leung 04f063de84 Parenting an object to a deformer (armature/curve/lattice) will now attempt to
check if the object is already parented to said deformer before trying to add a
new modifier

This should help reduce the number of cases where users inadvertantly end up
creating multiple deform modifiers pointing to the same object, which has been
known to be a cause of "double-transform" artifacts.

Note that this is only able to detect these cases by checking if the parent
object is selected, so this will only really work for the Ctrl-P shortcut where
you have to select both objects first. However, it shouldn't be a problem either
in the Outliner (drag and drop), as the object probably won't be a child of its
parent already if you're doing this.
2012-10-15 03:16:38 +00:00
Daniel Genrich 958cf139f6 Bugfix Smoke / DynamicPaint: Missing update call from depsgraph was missing when force fields were used. 2012-07-04 16:55:17 +00:00
Campbell Barton 9892736206 code cleanup: header cleanup and remove some duplicate defines. 2012-05-12 20:39:39 +00:00
Bastien Montagne 318b44fe5d Refactor of modifiers' apply function: now use a single bit-flag parameter to pass options, instead of having one parameter per boolean flag (i.e. replaces current useRenderParams and isFinalCalc by a single ModifierApplyFlag flag. ModifierApplyFlag is an enum defined in BKE_modifier.h). This way we won't anymore have to edit all modifier files when e.g. adding a new control flag!
Should have no effect over modifier behavior.
2012-05-09 15:00:26 +00:00
Nicholas Bishop 47cd3d4b8e Fix for truncation of 64-bit CustomDataMasks.
Can't use GET_INT_FROM_POINTER anymore with CD masks, as this
truncates to 32-bit.

Bug: http://projects.blender.org/tracker/index.php?func=detail&aid=30680&group_id=9&atid=498
CR: http://codereview.appspot.com/5905059/
2012-03-26 16:25:21 +00:00
Bastien Montagne 9751653410 Renaming CD_WEIGHT_MCOL/MLOOPCOL and their masks from WEIGHT to PREVIEW, as this layer is now also used for various preview tasks in Object mode.
“Cleanup” commit, no functional changes.
2012-03-22 08:41:50 +00:00
Campbell Barton 95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
Campbell Barton a368e6771a - remove some unused editmesh functions.
- copy & rename EditMesh stricts for use with scanfill (remove unused members)
2012-02-19 22:17:30 +00:00
Campbell Barton 48006292d8 svn merge ^/trunk/blender -r44189:44204 2012-02-17 20:56:25 +00:00
Campbell Barton 2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Bastien Montagne 6eb0ca9385 Merged with trunk (-r43609:43611): updated modifier preview.
Noted preview code for DynamicPaint is currently disabled, will see if I can re-enable it…
2012-01-22 20:05:26 +00:00
Bastien Montagne 1a93d88343 Add weight preview to WeightVG modifiers, and first, simple/basic refactor of how modifiers can generate preview.
User side:
* Preview for DynamicPaint should keep the same behavior (for now). Weight preview should be somawhat quicker, though.
* Preview for WeightVG modifiers is only active in WeightPaint mode, and if the affected vgroup is the active one.
* Last active preview modifier in stack wins!

Note: that modifier preview topic is yet to be further refined, quite raw/incomplete for now.

Dev side:
* In draw code, renamed DRAW_DYNAMIC_PAINT_PREVIEW flag to DRAW_MODIFIERS_PREVIEW
* Removed use of MOD_DPAINT_PREVIEW_READY in DynamicPaint code (seems unecessary, and if it was, should be of more general scope).
* Added eModifierTypeFlag_UsesPreview to ModifierTypeFlag, for modifiers that can generate some preview data.
* Added three new modifier funcs, to handle preview modifiers in draw code / mod stack.
* For weights preview: added the generic DM_update_weight_mcol func, which can update WEIGHT_MCOL layer with either a given array of weights (currently used by DynamicPaint only), or from current active vgroup(s).

So now, draw code is fully generic (i.e. no more modifier-type checking in it). Mod stack code is generic to some extent, but will need more work.
2012-01-22 17:54:23 +00:00
Campbell Barton 1fef05084e svn merge ^/trunk/blender -r42761:42776 2011-12-20 22:08:24 +00:00
Bastien Montagne 738fdc7b6f New modifier type: eModifierTypeType_NonGeometrical, for modifiers affecting CustomData layers only (e.g. UVProject and WeightVG ones).
Also, allow applying to obdata those modifiers, even with shapekeys, but do not allow applying them *as* shapekey (as shapekeys do not have CD layers).

Fix [#29636] Vertex Weight Mix modifier "apply" button don't work.

Note: applying whit shape keys currently always uses base shape, not current one (for apply to obdata as well as apply to shapekey), but this is another topic...
2011-12-20 14:15:59 +00:00
Campbell Barton 8eb41f0fdb svn merge ^/trunk/blender -r41998:42009 2011-11-20 16:05:51 +00:00
Campbell Barton f1eb66aa68 share code for fluidsim, ocean & dynamic paint file paths.
- use BLI_join_dirfile for joining all paths (no need to ensure slash is appended).
- paths from linked library files now supported.
2011-11-20 14:38:11 +00:00
Campbell Barton 15e6d6cd75 svn merge ^/trunk/blender -r41226:41227 . 2011-10-24 12:43:08 +00:00
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton 55a560c0c4 svn merge -r39286:39385 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-08-16 06:30:14 +00:00
Brecht Van Lommel c265a686d8 Modifiers: add callback to loop over each texture assigned to a modifier. 2011-08-12 18:11:22 +00:00
Joseph Eagar c98148a963 =bmesh= merge from trunk at r36153 2011-04-15 01:19:13 +00:00
Campbell Barton 2e5eb41522 pedantic warning cleanup, also remove texspace_edit() since its been added using a different method. 2011-02-27 08:31:10 +00:00
Joseph Eagar f01261d040 merge with/from trunk at r35190 2011-02-27 06:19:40 +00:00
Nathan Letwory 22638e22ea doxygen: blenkernel under core as module. 2011-02-18 13:05:18 +00:00
Sergey Sharybin 329e2d8037 Todo issue: sculpting on deformed mesh
Used a crazyspace approach (like in edit mode), but only modifiers with
deformMatricies are allowed atm (currently shapekeys and armature modifiers only).
All the rest modifiers had an warning message that they aren't applied because
of sculpt mode. Deformation of multires is also unsupported.

With all this restictions users will always see the actual "layer" (or maybe
mesh state would be more correct word) they are sculpting on.

Internal changes:
- All modifiers could have deformMatricies callback (the same as deformMatriciesEM but
  for non-edit mode usage)
- Added function to build crazyspace for sculpting (sculpt_get_deform_matrices), but it
  could be generalized for usage in other painting modes (particle edit mode, i.e)

Todo:
- Implement crazyspace correction to support all kinds of deformation modifiers
- Maybe deformation of multires isn't so difficult?
- And maybe we could avoid extra bad-level-stub for ED_sculpt_modifiers_changed
  without code duplicating?
2011-01-31 20:02:51 +00:00
Campbell Barton 0271ad6322 Give functions that use printf style formatting GCC format attributes so if incorrect formatting is used the compiler will warn of this.
found & fixed 2x incorrect formatting args.
2010-12-04 11:44:56 +00:00
Campbell Barton 263830f000 Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,.
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
2010-12-03 17:05:21 +00:00
Campbell Barton fbf208d63f add UNUSED() to modifiers, also removed some unused args. 2010-10-14 06:29:17 +00:00
Campbell Barton 81b6d308a7 [#23673] Modifier construction gives correct result in viewport but incorrect in render.
When there are 2+ consecutive deform modifiers, the second modifier was getting incorrect normals, this only showed up for the displace modifier since its the only deform modifier that uses vertex normals.

It would have been easy to fix this by always calculating normals on deform modifiers, but slow.

To fix this I added a function to check if a deform modifier needs normals, so the normal calculation function only runs if there are 2 modifiers in a row and the second uses normals.
2010-09-30 10:51:36 +00:00
Nicholas Bishop 4eaa10aa02 == Multires ==
Fixed bug #23657, "Modifiers dosen't work when you select diffrent mesh for object"

Multires modifier now adds empty mdisps if they're missing, rather than displaying a warning
Switching an object's mesh will now check for a multires modifier; if found the modifier's total number of levels are reset to match the mesh's mdisps
Switching the mesh also forces a multires update so that sculpted changes aren't lost
2010-09-09 00:14:51 +00:00
Joseph Eagar c11c196efa part 1 of merge from trunk at r30358; it compiles, but doesn't link quite yet :) 2010-07-19 04:44:37 +00:00
Brecht Van Lommel 08775e8f14 Mesh Deform Modifier: compress static binding weights better, threshold
is still set very low so in many cases it could be even smaller, but being
a bit conservative here to try to avoid breaking rigs.

This is not forward-compatible, i.e. loading new files in older blender
versions will loose the binding.
2010-04-23 11:19:06 +00:00
Matt Ebb 5c94896490 Fix [#22078] Cannot apply modifier in python (context error)
Previously all modifier operators relied on the buttons layout data context pointer to 
decide which modifier to work on. This meant that these operators would only work 
from from the properties panel, and not from scripting/macros or for operator redo.

This commit makes all modifier operators take the modifier name as an operator 
property, so the operators can be re-done or executed outside of the modifier panel. 
When invoking the operators from the modifier panel, they automatically fill in the 
operator property from context.

This isn't a perfect API design, but it does bring these operators in line with the design 
of being able to access all UI functionality via other means like scripts.
2010-04-22 01:55:10 +00:00
Campbell Barton 1e9bf0cfdb spaces -> tabs, (4 spaces == 1 tab, only for white space preceding text) 2010-03-22 09:30:00 +00:00
Joseph Eagar 71003b9bcc merge with trunk at r27259 and commit of a patch by anthony jones to fix msvc (though further work may be needed because changes made by the merge 2010-03-09 04:32:40 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Brecht Van Lommel cbb23d96bb Added simplification back for quicker preview renders with less subdivision
levels, child particles, and shadow/SSS/AO quality.. Now also works on what
is displayed in the 3d view instead of only rendering, see panel in the scene
properties.

Most file changes were to make scene available in the isDisabled modifier
callback function.
2010-01-25 11:39:56 +00:00