Commit Graph

348 Commits

Author SHA1 Message Date
2cca73eeb1 Fix [#36759] UV Project - Specified UV Map doesnt work properly
In fact, the issue was that names of mloopuv/mtespoly layers could very easily get out of sync (a simple rename was enough), while most tools (such as the UVProject modifier) expect matching layers to have the same name!

Now matching names are check on load, and renaming of a layer through RNA is guaranted to be synchronized with its counterparts.

Thanks to Brecht & Campbell for reviews.
2013-09-20 11:14:08 +00:00
6317f1eafd fix [#36291] Applying subsurf to mesh or setting subdivisions to zero crashes Blender
issue was mesh somehow had a mismatch of UV/texpoly layers. we may want to allow this in the future but for now sync on load just in case.
2013-09-16 06:00:25 +00:00
4a2f6447ef Core code for split normals computation. Many thanks to ideasman for is optimization guiding and code reviews!
Note the API is not yet committed, as it may need a few more checks & tweaks. ;)
2013-09-10 12:48:08 +00:00
00bd7da674 correct error in recent changes for building with openmp.
rename DM_OMP_LIMIT to BKE_MESH_OMP_LIMIT and set to 0 when in debug mode, same for BM_OMP_LIMIT.
2013-09-09 05:42:26 +00:00
2646bbdccb move mesh evaluation functions (normal, mapping, smooth group... etc, calculations) into mesh_evaluate.c.
mesh.c was over 4k lines and complex functions mixed in with general library management.
2013-09-09 02:11:44 +00:00
38075c7b3c fix for building on msvc 2013-09-04 06:50:15 +00:00
f3af9de618 debug option for modifier stack calculation USE_MODIFIER_VALIDATE,
checks that every modifier gives a valid mesh (very slow) - so off by default even in debug mode.
2013-09-04 01:29:34 +00:00
37bad42b9d Ack... Followup to r59743: in fact, bitflags groups are not always wanted/needed, thanks to Campell for notifying me about this!
So now, their generation is controlled by a flag, else previous "simple values" group ids are generated (one per poly region, no need here to reduce the number of used IDs!).

Will update obj exporter too.
2013-09-02 18:33:06 +00:00
017392d603 fix/workaround [#36519] Origin to Center of Mass" failes when faces have an area of zero 2013-08-20 09:42:18 +00:00
503b7d5b9a add materials.clear() method, matching other python list method. 2013-08-14 11:29:58 +00:00
abe84a4f43 Fix #36139: cycles not taking texture spacing settings into account for
generated coordinates on text objects.
2013-07-15 11:11:36 +00:00
6d9de6a72b fix [#35975] "Select Linked" = "Select All" in Weight Paint mode?
looks like this was broken since bmesh merge.
2013-07-03 09:53:06 +00:00
b70c844c5f fixed a compiler warning message in vs 2008 2013-06-29 08:41:20 +00:00
a7858767f4 fix [#35858] Weight Paint: Hiding faces isnt flushing the flag to the vertices. 2013-06-26 02:47:56 +00:00
a8beff3c5e added basic utility functions for working with mselect (selected mesh elements) 2013-06-15 09:42:58 +00:00
05ad8c2dc9 expose smooth group calculation to python as Mesh.calc_smooth_groups() 2013-06-14 09:59:09 +00:00
1fe21f29ec utility function for calculating smooth groups from sharp edges: BKE_mesh_calc_smoothgroups 2013-06-14 08:28:27 +00:00
cd33e7f1b4 utility function BKE_mesh_edge_poly_map_create(), currently unused. 2013-06-14 07:15:38 +00:00
f7a06295b9 code cleanup: reduce pointer indirection for mesh-map creation functions. 2013-06-14 06:34:37 +00:00
0435560b24 code cleanup: make_edges_mdata() reduce some sign conversion, pointer indirection. 2013-06-14 06:15:30 +00:00
31e667c10e solidify: dont add poly-normal layer to the derived mesh, since this is no longer a convention. 2013-06-12 09:35:02 +00:00
ef4db04da8 code cleanup: lots of calls to BKE_mesh_calc_normals_mapping were not using the mapping functionality.
replace ED_mesh_calc_normals with BKE_mesh_calc_normals().
2013-05-28 14:23:07 +00:00
76b1e8bc09 code clenup: rename BKE_mesh_poly_calc_angles -> BKE_mesh_calc_poly_angles 2013-05-08 12:56:51 +00:00
319036f2d5 fix [#35026] Curve build modifier 2013-04-22 12:00:37 +00:00
64d161de87 style cleanup:
also rename mesh_getVertexCos() --> BKE_mesh_vertexCos_get() to match curve function.
2013-03-26 07:29:01 +00:00
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +00:00
3dababa7ec code cleanup: name mesh functions more consistently, also use bools for mesh args. 2013-03-17 19:55:10 +00:00
a0351fd97e object converting curve/mball to a mesh would give invalid selection state (edges selected but nothing else).
add arg to BKE_mesh_calc_edges() so selecting newly created edges is optional.
2013-03-16 01:19:03 +00:00
0807c976f4 code cleanup: rename BKE_mesh_to_curve_ex --> BKE_mesh_to_curve_nurblist,
also correct odd indentation.
2013-03-15 10:48:48 +00:00
7626101dc9 split up BKE_mesh_to_curve() into 2 functions, adding BKE_mesh_to_curve_ex() which doesn't do object type conversion. 2013-03-14 18:44:32 +00:00
a0dbd88311 converting a mesh to a curve was unnecessarily using tessface's.
use mpolys instead and simplify checks for wire edges.

Also rename BKE_mesh_from_curve() --> BKE_mesh_to_curve() since this function converts a mesh into a curve.
2013-03-14 18:35:21 +00:00
fdfa5910b5 Fix #34040: Moving Normal Node with enabled Cycles Material Preview crashes
Issue was caused by couple of circumstances:

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

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

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

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

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

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

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

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

Thanks to Brecht for review!
2013-02-05 12:46:15 +00:00
296f91c4cc add 'deform - integrate' option to mesh-cache,
This means the deformation on the input to the modifier can be re-applied ontop of the mesh cache.

In practice this is most useful for using corrective shape-keys with mesh-cache.
2013-01-24 04:02:30 +00:00
b39090bb5a Fix #33752: UV Orco coordinates were wrong for Cycles (and other external
render engines). Replaced generating orco_index by filling the UV loop data
directly which is easier and all that needed to be done anyway.
2013-01-10 17:37:17 +00:00
ceb9701507 don't store bevel weights or edge crease customdata layers in editmode unless they are needed.
configurable in 'Geometry Data' panel, will be added when running crease edges transform for example.
2013-01-10 04:43:31 +00:00
7730ddb3d6 code cleanup:
- free_dverts -> BKE_defvert_array_free
- copy_dverts -> BKE_defvert_array_copy

also move the functions from BKE_mesh into BKE_deform
2012-12-28 09:06:48 +00:00
4c5093ad48 flush selection from vertex paint and weight paint modes when exiting, this isnt fool-proof, will need more work. 2012-12-22 14:20:27 +00:00
634be5992d flush selection when switching weight paint vertex/face selection modes. 2012-12-22 13:42:06 +00:00
2abb727ced function for flushing polygon -> vert,edge selection (in object mode), currently unused. 2012-12-22 08:13:44 +00:00
2a5cabb039 code cleanup and minor changes
- use DummyRNA_NULL_items to replace empty enums.
- replace calloc with malloc in copy_dverts since its copied over after.
- add wmGesture->userdata, so operators that use gestures have somewhere to store their own data (not used yet).
2012-12-22 01:08:42 +00:00
99433a3466 minor bmesh improvements
- use 2 omp sections for vert -> (edge, face) selection flushing.
- dont use face-loop iterator for cddm_from_bmesh_ex conversion to give some speedup (some modifiers use this).
- use float(*)[3] for functions that return coords.
2012-12-21 07:28:14 +00:00
738c482101 uv edge based stitch. Useful to disambiguate betwen islands
when uvs are shared by more than two islands. Uv edges
 usually belong to only two islands, making for much cleaner
 stitches. To change between stitch modes, press TAB.
 Initial mode depends on the selection mode of the image
 editor. Documentation can also be found on the release wiki
2012-12-17 20:14:07 +00:00
2bb174cfa4 style cleanup: indentation 2012-11-09 09:33:28 +00:00
0a590aadf5 Add option to set object origin to the center of mass
This uses the weighted average of polygon centroids based on area
It work well in most cases but will be slightly wrong when polygons have 
many vertices.
2012-10-20 16:48:54 +00:00
da9394f596 code cleanup: define sizes of vectors for function args and use C style comments 2012-10-15 09:11:17 +00:00
9d0875828e small improvement to previous commit, use pre-calculated ngon normal to avoid calculating twice when dupli-scale is enabled. 2012-09-25 00:25:17 +00:00
b0bf816ece fix [#32646] Duplifaces can have wrong orientation with ngons
concave ngons could flip the dupliface, now use the faces normal when calculating the dupli-face.
2012-09-25 00:20:42 +00:00
c42d0189e5 resolve glitch in the image space where mask editing and UVs would conflict.
now UV editing overrides mask.
2012-07-31 14:16:27 +00:00
8f6197bd08 support for curve orco uv's as UV's in cycles.
ideally these would be used as generated coordinates, but this is tricly because cycles calculates its own orco's and doesnt know about curve settings.
2012-07-31 13:43:26 +00:00
8a9d1c0a79 Fix #31021: Render settings are not taken into account for curves
Refactored code a bit to make naming a bit more clear and added a
function to create mesh from given display list rather than from
object's displist.

Tested using plain curves (which doesn't imply using derived meshes)
and curves with constructive modifiers (which are using derived meshed).
2012-07-14 17:30:49 +00:00