Commit Graph

172 Commits

Author SHA1 Message Date
c91cee2bb9 code cleanup: naming - BKE_mesh_* 2012-05-05 21:28:12 +00:00
6292fb4cbd code cleanup: BKE_libblock_find_name() now takes an ID constant rather then a string. 2012-05-05 17:00:11 +00:00
1dccd4c98a code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
2012-05-05 16:03:57 +00:00
34b18fcbc1 code cleanup: BKE_ naming, also make bpy.data.images.load() always load a new image. (not use existing one) 2012-05-05 14:52:04 +00:00
5da2135eef code cleanup: double promotion & some style cleanup 2012-05-03 21:35:04 +00:00
1d743d11dc bmesh - python api
- bm.*.layers.*.verify()
- bm.*.layers.*.is_singleton
- bm.*.layers.*.copy_from(other)


also added api functons
- BM_data_layer_copy(...)
- CustomData_layertype_is_singleton(type)
2012-04-30 18:54:14 +00:00
e57d258169 - fix memory leak in mesh_strip_loose_polysloops(), occurred during 3ds import.
- updating normals in py/api's mesh.transform() wasn't working and gave annoying print, disable this, script authors can call calc_normals explicitly if they need.
2012-04-22 00:27:38 +00:00
475ecbb0ce remove BM_ITER, BM_ITER_INDEX macros, use ELEM or MESH variants only (the maceros had unused args in both cases). 2012-04-19 13:47:58 +00:00
75b869e428 style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER 2012-04-19 11:44:12 +00:00
ddbb4db1d3 fix [#30995] Wavefront obj. file export/import issue with splited edge 2012-04-18 09:04:07 +00:00
20e2330434 added Mesh.calc_tessface(), needed to update mesh tessface after bmesh edits.
also add py api BMDeformVert.clear()
2012-03-29 13:44:30 +00:00
42076f0a1f skip using bmesh operators for converting to/from undo meshes (gives some speedup) 2012-03-29 01:41:56 +00:00
e8a226b38c Fix #30658: add new uv layer in object mode did not copy coordinates from
existing layer as it does in edit mode.
2012-03-27 18:35:49 +00:00
09f29c0b70 style/name cleanup: have EDBM_* functions match our style guide and also match BM_ function naming conventions 2012-03-27 04:46:52 +00:00
f83a93e454 bmesh todo, unlikly but possible - entering editmode with faces and no polys.
rather then printing a warning and failing - convert them to polys.
2012-03-27 01:28:25 +00:00
5c209c76a1 fix [#30658] existing uv mesh coordinates not copied to new created uv map 2012-03-26 05:28:00 +00:00
c9c66720c8 disallow adding tessfaces to a mesh with polygons (only allowed case is creating a new mesh with tessfaces and later converting to polygons, which wont work if polygons exist) 2012-03-26 04:32:04 +00:00
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