Commit Graph

155 Commits

Author SHA1 Message Date
48f0444760 style cleanup: editors/mesh - mostly whitespace around operators 2012-03-26 02:56:48 +00:00
44010fb659 fix [#30657] New UV layers created with Mesh.uv_textures.new reset previous ones.
adding UV's from python was resetting the active UV layer but not setting the new layer to active, resetting existing UV's.
2012-03-26 02:39:05 +00:00
6378606d64 fix for error adding vertex colors in editmode.
also correct delete_customdata_layer having invalid 'tot' in editmode, seems harmless for now but better assign correct value.
2012-03-24 11:02:28 +00:00
d7b9127e5f fix for crash removing vertex colors in editmode. 2012-03-24 10:41:42 +00:00
ab4a2aaf4a style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:38:07 +00:00
88d0918fe2 code cleanup: more consistent naming for mesh operator functions. 2012-03-23 21:25:07 +00:00
4c3bb77012 style cleanup: spaces aroudn operators for operator definitions. 2012-03-22 07:26:09 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
b40386a3e3 fixes for vertex color (found when brining X3D import back)
- tessface vertex color had the wrong sized array passing to rna_iterator_array_begin
- re-calculating tessface's would clear them if they were already created (own mistake)
- ED_mesh_color_add initialized tessface vertex colors from the loop color array

also made rna's mesh.tessface_vertex_colors.new() work like tessface_uv_textures.new()
where layers can be added as long as polygons are not present.
2012-03-15 05:40:33 +00:00
f6ddb79e20 fix [#30457] Smooth normals wrongly exported to wavefront
mesh.calc_normals() wasnt calculating vertex normals (only face normals),

now only calculate vertex normals.

added a define incase we want to have poly normals back again.
2012-03-05 11:49:24 +00:00
e583aa8e34 changes to ED_mesh_update() to work with OBJ import.
* calculate vertex normals (previously was calculating face normals only)
* clear tessfaces unless theres an argument to build them. since no tessfaces is the default state right now.
* if convert_mfaces_to_mpolys() runs, dont calculate edges, since it already does that.
2012-03-04 00:16:50 +00:00
a2c182e923 style cleanup - use aligned * prefixed blocks for descriptive comments (was already used a lot and part of proposed style guide). 2012-03-03 16:31:46 +00:00
63f5b96fe3 mesh.update() now has option to calculate tessellation faces. 2012-03-02 14:46:14 +00:00
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
6ca7d82932 code cleanup: white space, spelling & ';;' end of lines. 2012-02-25 16:04:03 +00:00
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
2d1a05874b svn merge ^/trunk/blender -r44024:44076 2012-02-13 04:14:35 +00:00
59d45d0ea6 * remove the MFace parts of join (we only need polygon data)
* other minor cleanups
2012-02-12 19:11:09 +00:00
6afa4da928 Fix #30152: Several drag and drop of image on mesh crashes
Issue was caused by making and loading editMesh in drop_named_image_invoke,
which lead to freeing/changing pointers used by CustomData layers. Some of
this pointers might be used by DerivedMesh, so we need to update DerivedMesh
after loading EditMesh.
2012-02-12 11:21:35 +00:00
b6dcdb065d code refactor, function renaming for bmesh.
These changes are to make the bmesh api more consistent and easier to learn, grouping similar functions which is convenient for autocomplete.
This uses similar convention to RNA. 

* use face/loop/edge/vert as a prefix for functions.
* use 'elem' as a prefix too for functions that can take any type with a BMHeader.
* changed from camel case to underscore separated (like RNA).
2012-02-12 10:51:45 +00:00
8b43813b69 rename BM_ flags for BMHeader->hflag to BM_ELEM_ to be more clear that these flags apply to bmesh elements. 2012-02-12 06:24:12 +00:00
1d21e2386e ensure tessface's are available while sculpting. 2012-02-05 07:12:46 +00:00
8926cbd0a7 svn merge ^/trunk/blender -r43819:43830 2012-02-02 00:04:47 +00:00
5adcf774ba Fix #30045: mesh.uv_textures.new() not returning correct layer when a layer with
the requested name already exists.
2012-02-01 18:25:13 +00:00
c8037fb56a svn merge ^/trunk/blender -r43530:43554 2012-01-20 12:34:00 +00:00
8817aaef3e - Fix for commit 43551 which caused a linking error in blenderplayer.
- Minor clean up for commit 43551.
2012-01-20 05:11:42 +00:00
62ac943e31 - Added functions to remove mesh vertices, edges and faces. These functions remove a specified number of elements from the end of their respective arrays. For example, removing two vertices removes the last two vertices of the mesh.
- Minor fixes to descriptions of add edge and add face functions.
2012-01-20 02:10:09 +00:00
bc745a32d3 argument to mesh_recalcTesselation to skip copying normals from polygons. 2012-01-19 17:51:52 +00:00
705f23064e svn merge ^/trunk/blender -r43294:43338 2012-01-13 01:39:57 +00:00
f66f33cefc rename RNA_property_is_set() --> RNA_struct_property_is_set() in preperation to add a second version of the function which takes the property rather then its name. 2012-01-11 16:32:12 +00:00
a7b0a11811 svn merge ^/trunk/blender -r43278:43294 2012-01-11 15:04:54 +00:00
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
2b2c1007f6 rename normal calc functions.
comparing bmesh to trunk, mesh_calc_normals() in bmesh is a much more comprehensive function, calculating mpoly,mface normals, where trunk only calculated vertex normals.

renamed:
* mesh_calc_normals() --> mesh_calc_normals_mapping_ex
* mesh_calc_tessface_normals --> mesh_calc_normals_tessface() - only calculates normals from tessface
* added mesh_calc_normals() - only calculates normals from poltys

this way we can have mesh_calc_normals() remain fast for parts of the code which only need vertex normals to be updated.

only refactor, no func changes- didnt replace mesh_calc_normals_mapping_ex() with mesh_calc_normals() anywhere yet.
2012-01-06 00:08:37 +00:00
c0eec8f379 svn merge ^/trunk/blender -r43062:43085 2012-01-03 02:16:52 +00:00
1e18da32fb replace:
CTX_data_pointer_get_type(C, "object", &RNA_Object).data
with api call:
  ED_object_context(C)

... since getting the context object is such a common operation.
2012-01-02 17:15:24 +00:00
26db98293f Quiet annoying warning:
Warning! Tesselation uvs or vcol data got out of sync, "had to reset!

This would happen on every editmode edit with UV's and wasn't too reassuring that blender was handling uvs/vcols correctly.

From looking into the problem I found that creating the undo mesh would act as if it was tessellating the existing mesh each time and complain that the data was out of sync, when infact the mesh was just created and being filled in.

Also, allocating uv and vcol customdata arrats for tessfaces isn't needed for undo mesh, so save some memory and dont allocate these in the first place.
2011-12-06 09:28:25 +00:00
f07df7287e manual sync with trunk - pulling in changes where the issues are not bmesh spesific
- some merges added lines in multiple times
- removed some NULL checks that were only in bmesh
- enable cycles by default (was disabled because it used not to work)
- make formatting match
2011-12-04 23:13:28 +00:00
22a1ad61f9 svn merge ^/trunk/blender -r42372:42416 2011-12-04 18:39:19 +00:00
937c5494c4 A (hopefully last) bunch of fixes and tweaks to UI label and messages (found while translating in french). 2011-12-04 17:36:13 +00:00
89e390f28f Dynamic paint vertex color output now works with bmesh.
3D view preview still doesn't work because the used CD_WEIGHT_MCOL data layer isn't yet generated properly during poly tessellation.
2011-11-30 20:41:13 +00:00
f28fd56f8f svn merge ^/trunk/blender -r42095:42116 2011-11-24 05:33:22 +00:00
2345efc6c5 Patch #29336: renaming UV (Texture) Layer to UV Map in the user interface,
by Gaia Clary.

Rationale: the name was confusing and not always used consistently, and this
map itself is not something that can be layered, rather the map can be used
as texture coordinates in some layered setup.

The original intent was to indicate this contained more than just UV's, but
the game engine settings have already been moved out, and apparently users
didn't really get this from the name anyway.
2011-11-23 17:25:25 +00:00
9089d72f06 Various typo cleanups, remove unnecessary code etc, found during recent work and separated to a cleanup change 2011-11-20 16:21:13 +00:00
1038c76c55 Add access to UVs from python, patch python unwrap scripts to work wtih ngons 2011-11-17 05:03:07 +00:00
e59ab6486f svn merge -r41751:41779 ^/trunk/blender 2011-11-15 02:05:32 +00:00
2266c7fc1c Add CD_POLYINDEX layer to reduce need for retesselations 2011-11-13 15:13:59 +00:00
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
c0934795cb bmesh compiles again after dynamic paint merge 2011-11-11 11:20:46 +00:00
92d35b74e7 svn merge -r41722:41723 ^/trunk/blender 2011-11-11 06:25:45 +00:00
685041d53a svn merge -r41650:41655 ^/trunk/blender --- cycles merge, this wont copile, still need to manually update some funcs 2011-11-10 03:05:11 +00:00