Commit Graph

81 Commits

Author SHA1 Message Date
Nicholas Bishop 8cafa0afa6 Code cleanup: give anomymous enum used for CustomData.type a name
Used this in GPU module to clarify what some "ints" really are.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:34:39 +01:00
Antony Riakiotakis 38eef8deee Refactor to Dyntopo node customdata commit.
Don't use a dedicated node layer but use temporary int layer instead.
Works like a charm as long as we are careful resetting the layer when
needed (after pbvh clearing and always after bmesh has been filled in
undo)

Tip by Campbell, thanks!
2014-04-17 19:03:08 +03:00
Antony Riakiotakis 556590fa3a Dyntopo:
Store PBVH node ID in CustomData. This avoids a number of hash deletions
and checks/insertions on big hashes.
2014-04-16 05:31:02 +03:00
Bastien Montagne 18e4224142 Split Normals I (1/5): basis for split normals (nearly nothing user-visible here):
* Add a new calcLoopNormals function to DerivedMesh struct, and implement it for CDDM and CCGDM (subsurf).
  EditDerivedBMesh (edit mode DM) only gets a dummy one in this commit.
* Add a tessellated version of CD_LOOPNORMAL layer (CD_TESSLOOPNORMAL), with relevant code to handle it
  (tessellation, rna access, etc.).
* Change auto_smooth options of Mesh (angle now in radian internaly, and toggle is now used to enable/disable
  split normals in DM creation process). Note BI render code is not touched here, hence its behavior regarding
  this option is now incoherent, will be addressed in a separate commit.

Reviewers: campbellbarton

CC: brecht

Differential Revision: https://developer.blender.org/D365
2014-04-13 12:19:00 +02:00
Campbell Barton 82628a6b0e Code cleanup: use struct type for mempool & style edits 2014-04-10 06:49:25 +10:00
Bastien Montagne 8952f58375 Add tangent space computation/access from RNA (i.e. python).
This simply mimics code used for loopnormals, to enable py scripts to generate and access (temporary)
a tangent 3D vector and bitangent sign for each loop. Together with the split normals, this allow
to recreate a complete tangent space for normal mapping (bitangent = bitangent_sign * cross(normal, tangent)).

Expects all faces to be tri or quads.

Reviewed By: Brecht, campbellbarton

Differential Revision: https://developer.blender.org/D185
2014-01-11 11:51:19 +01:00
Nathan Letwory 4e24e31f8b Change the enum for CustomDataMask bits back to #defines.
enum is an int, and values from CD_PREVIEW_MLOOPCOL (32) onwards
will not give what apparently was expected.

Found with help from Oscurart in #blendercoders while trying to figure
out compile error with CMake/msvc9. Occasionally it is good to heed
the warnings given by compilers!
2013-09-12 20:43:29 +00:00
Bastien Montagne 17a7c2425c Another DNA cleanup (enums instead of defines). 2013-09-10 13:13:04 +00:00
Brecht Van Lommel 2c662f8be8 Fix #35171: crash rendering cube with two subsurf modifier in some circumstances.
Problem was actually integer overflow in the requested data layers (1 << 31) does
not fit in an integer, it only goes up to (1 << 31) - 1.
2013-05-01 12:35:31 +00:00
Tamito Kajiyama 894c240f9d New implementation of Freestyle edge/face marks
The previous implementation of Freestyle edge/face marks was refactored
based on suggestions from the latest code review by Campbell.  The new
implementation relies on mesh CustomData to store edge/face marks, instead
of introducing extra flags in the core Mesh and BMesh data structures.
The CustomData-based implementation will allow further additions of new
edge/face attributes because of the independence from Mesh/BMesh.

This revision is work in progress, mainly intended to address the review
comments and ask for further code review in view of the trunk merger in
the upcoming 2.67 release.
2013-03-13 06:44:43 +00:00
Campbell Barton 8f01b50e14 code cleanup: clarify comment about virtial-modifiers, also add comments to DNA headers when its not so obvious what their purpose is. 2013-03-02 07:27:19 +00:00
Campbell Barton 9a469b62ca replace strcpy with BLI_strncpy or memcpy when the size is known. 2012-12-16 08:43:05 +00:00
Campbell Barton 00acdb6292 remove CD_POLYINDEX customdata layer:
reported as [#29376] BMESH_TODO: remove tessface CD_ORIGINDEX layer

for a single mesh there could be 3 origindex mappings stored, one on the polygons and 2 on the tessfaces.
(CD_POLYINDEX and CD_ORIGINDEX).

as Andrew suggests, now tessfaces (which are really a cache of polygons), using origindex to point to polygons on
the same derived mesh, and polygons only store the original index values.
2012-10-30 19:20:17 +00:00
Campbell Barton f609d0f22e code cleanup: remove USE_BMESH_FORWARD_COMPAT - this was added to load bmesh in pre-bmesh blender version, remove MODSTACK_DEBUG, was never used. 2012-10-04 09:12:08 +00:00
Campbell Barton 3d1cdfbb38 remove sticky coords from blender and the internal render engine. 2012-09-21 11:37:51 +00:00
Nicholas Bishop 396a3d31cc Add MVertSkin DNA/RNA and customdata (CD_MVERT_SKIN).
The MVertSkin currently just stores local skin radii and skin
flags (MVertSkinFlag).

Skin modifier documentation:
http://wiki.blender.org/index.php/User:Nicholasbishop/SkinModifier

Reviewed by Campbell Barton.
2012-05-22 15:18:43 +00:00
Nicholas Bishop aa77bbd38d Add DNA and customdata entries for paint masks.
CD_PAINT_MASK is a layer of per-vertex floats for non-multires
meshes. Multires meshes use CD_GRID_PAINT_MASK, which is a layer of
per-loop GridPaintMask structures. GridPaintMask is similar to MDisp,
but contains an array of scalar floats.

Note: the GridPaintMask could be folded into MDisp, but this way
should be easier to add mask layers in the future (if we do fold
GridPaintMask into MDisp, the mask array should probably be an array
of arrays with a 'totmask' field so that mask layers can be easily
supported.)

Includes blenload read/write support for CD_PAINT_MASK and
CD_GRID_PAINT_MASK.
2012-05-10 20:33:24 +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 79d97ca509 style cleanup - spelling. 2012-03-08 04:12:11 +00:00
Campbell Barton 92c47145fd bmesh python api change in internal behavior.
* Only have 1 python object per bmesh, vertex, edge, loop, face.
* Store pointers back to the python data in a custom data layer so as not to use more memory for normal editing operations (when pythons not running).
* Currently this data is created and freed along with the BMesh PyObject.
* Incidentally - this fixes comparisons for bmesh elements which wasnt working before.
2012-02-22 16:08: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
Antony Riakiotakis d1833a2c99 Ported UvElementMap code to bmesh, still untested but at least compiling.
Next, uv sculpting will be ported.
Also fixed "initializer element is not computable at load time" compile error caused due to bit-shifting a constant past its precision length (1L should be 1LL for 32 positions left shift).
2012-02-06 19:25:12 +00:00
Campbell Barton 543fb27fd0 support for 'origspace' data layer - used for hair on subsurf mesh.
currently only works for 3/4 sided faces.
2012-02-05 11:30:26 +00:00
Campbell Barton 4966982a5a svn merge ^/trunk/blender -r43564:43609 2012-01-22 18:04:35 +00:00
Campbell Barton ae771e742b change filepath limit from 240 to 1024 2012-01-21 14:54:53 +00:00
Campbell Barton a7b0a11811 svn merge ^/trunk/blender -r43278:43294 2012-01-11 15:04:54 +00:00
Sergey Sharybin 51bada696f Longer names support for all ID and other object names
This commit extends limit of ID and objects to 64 (it means 63 meaning
characters and 1 for zero-terminator). CustomData layers names are also
extended.
Changed DNA structures and all places where length constants were hardcoded.

All names which are "generating" from ID block should be limited by MAX_ID_NAME-2,
all non-id names now has got own define called MAX_NAME which should be used all
over for non-id names to make further name migration stuff easier.

All name fields in DNA now have comment with constant which corresponds to
hardcoded numeric value which should make it easier to further update this
limits or even switch to non-hardcoded values in DNA.

Special thanks to Campbell who helped figuring out some issues and helped a lot
in finding all cases where hardcoded valued were still used in code.

Both of forwards and backwards compatibility is stored with blender versions newer
than January 5, 2011. Older versions had issue with placing null-terminator to
DNA strings on file load which will lead to some unpredictable behavior or even
crashes.
2012-01-11 08:51:06 +00:00
Campbell Barton ca629d5ccc minor dna header cleanup 2011-12-30 07:25:49 +00:00
Campbell Barton 07afa420f2 svn merge ^/trunk/blender -r42920:42927 2011-12-28 13:33:35 +00:00
Campbell Barton 312b080397 initial merge of bmesh customdata layer code into trunk, ifdef'd out for now with USE_BMESH_FORWARD_COMPAT. 2011-12-28 13:15:17 +00:00
Campbell Barton df9aafa8bc sync customdata layers up with trunk. existing bmesh files will crash on load but this is unavoidable. 2011-12-28 13:11:46 +00:00
Campbell Barton 337d397d09 merge in customdata changes from BMesh - biggest change is caching the layer index values in a typemap. 2011-12-28 09:11:11 +00:00
Campbell Barton 8de51d3736 reduce size of typemap, and minor changes to sync with trunk 2011-12-28 08:33:19 +00:00
Campbell Barton b459067dd2 minor changes from bmesh into trunk 2011-12-28 08:29:03 +00:00
Andrew Wiggin 2266c7fc1c Add CD_POLYINDEX layer to reduce need for retesselations 2011-11-13 15:13:59 +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 75b3936128 svn merge -r40075:40104 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-10 23:49:39 +00:00
Nick Samarin a918040902 synched with trunk at revision 36569 2011-05-16 20:30:59 +00:00
Campbell Barton 33bfcb26b8 manually copy more changes from trunk. 2011-05-12 09:02:39 +00:00
Joseph Eagar f01261d040 merge with/from trunk at r35190 2011-02-27 06:19:40 +00:00
Nathan Letwory 22dbae84e5 DNA header files are now grouped under the same module. No further documentation done. 2011-02-17 20:48:12 +00:00
Nathan Letwory f336b80d7f Starting work on doxygen cleanup. Many things still to be done. 2011-02-17 05:57:18 +00:00
Nick Samarin c5f6a01dd5 synched with trunk at revision 34793 2011-02-16 17:07:18 +00:00
Nathan Letwory 82209cdc86 Reorganisation of COLLADA import code. Classes have been split into their own files.
No functional changes.

Where necessary extern "C" {} blocks have been added.
2010-10-05 00:05:14 +00:00
Nick Samarin dbc8d4274f - moved navmesh conversion code to ED_Editors project (ED_navmesh_conversion.h and navmesh_conversion.cpp files)
- added new custom data layer CD_Recast
2010-07-30 13:02:32 +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
Joseph Eagar a37bcf93ef wip commit; DO NOT USE. almost done with phase 1 of this restructuring, basically just some things that needed to be done before trunk (and some things that needed to be started, but can be finished much later). 2010-07-14 22:06:10 +00:00
Brecht Van Lommel 1af9e1fb2b Fix #21885: constraint with copy location/rotation from vertex group crashes. 2010-04-05 11:11:15 +00:00