Commit Graph

63 Commits

Author SHA1 Message Date
3311164b24 Math lib: matrix multiplication order fix for two functions that were
inconsistent with similar functions & math notation:

mul_m4_m4m4(R, B, A) => mult_m4_m4m4(R, A, B)
mul_m3_m3m4(R, B, A) => mult_m3_m3m4(R, A, B)

For branch maintainers, it should be relatively simple to fix things manually,
it's also possible run this script after merging to do automatic replacement:
http://www.pasteall.org/27459/python
2011-12-16 19:53:12 +00:00
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
61389bba41 fix spelling mistakes in comments (and in some python error messages), nothing to effect translations. 2011-10-17 06:39:13 +00:00
ee32d36a59 fix [#28635] Mirror Modifier - Clipping still active when modifier is disabled 2011-09-13 05:00:54 +00:00
4bd0a2ba2d replace VECCOPY -> copy_v3_v3, added copy_v*_v*_short too for typesafe copying, some parts of the code are copying float -> short normals without scaling. fix coming next. 2011-09-12 04:14:12 +00:00
599cd56f53 minor edits / cleanup - no functional changes.
- use 'const float *' and array size in some function declarations.
- replace macros for BLI_math functions INPF, VECCOPY, VECADD etc.
- remove unused VertRen.clip struct member.
- remove static squared_dist() from 2 files, replace with BLI_math function len_squared_v3v3().
- use vertex arrays for drawing clipping background in the 3D viewport.
2011-09-11 02:50:01 +00:00
9eb9d9b7d2 Fix #28427: smooth faces flash momentarily when extruded using "extrude and move on normals" tool (E key)
Update normals just after extrude -- topology is changing when extruding
and normals for non-extruded faces should be recalculated after this.
2011-08-30 15:30:38 +00:00
3303b838c6 Fix for the fix, making hurried last minute changes is not a good idea :) 2011-04-04 17:28:31 +00:00
35c934af79 Fix mistake in recent commit to revert some normal changes. 2011-04-04 17:09:22 +00:00
25976b7b87 crash fix: screen context editable_bones & visible_bones were not checking for armature type object first. 2011-04-04 15:13:37 +00:00
709e4b309e Revert mesh recalculation change that gives different vertex normals based
on smooth/flat flag on faces. This does give better results for low poly
game models, but there's just too much functionality that depends on this
(modifiers, displacey, editmode tools, extrude, ...), that there's not
enough time to fix these before the release.
2011-04-04 13:02:12 +00:00
d40b0dfb75 Comments for mesh normals calculation from Mortem Mikkelsen (aka sparky).
We hope it'll help for further workers in this area!
2011-04-01 18:35:49 +00:00
ac1cb5ee05 - quiet new warnings with gcc 4.6
- use BLI math funcs for normal float/short conversion.
- correct some un-intentional float/double promotions.
2011-03-28 02:34:55 +00:00
63e40dbe0e Fix #26582, #26586, #26613: recent normal calculation changes didn't take
into account that some tools use normals for things other than display. Now
we properly initialize vertex normals at flat faces too.

Also fixed a normal refresh issue, and deduplicated CDDM/mesh normal
calculation code.
2011-03-26 08:28:24 +00:00
549b5e1222 Fix/change in normal computation, now the viewport uses the same angle
weighted normals as the render engine, and the render engine will copy
normals from the mesh rather than always recalculating them.

Subsurf/multires still use regular vertex normals, but they are expected
to be sufficiently high resolution to not need this.

This means that normal maps displayed in the viewport actually match the
render engine exactly and don't have artifacts due to this discrepancy.
It of course also avoids unexpected surprises where your render normals
look different than your viewport normals.

Subversion bumped to 4 for version patch to recalculate normals.

Patch by Morten Mikkelsen, with some small changes.
2011-03-20 13:35:35 +00:00
Nathan Letwory
95100afc12 doxygen: blender/editors tagged. 2011-02-27 20:29:51 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
8b7482892b made most variables which are only used in a single file and not defined in header static for blenlib, blenkernel and editors. 2011-02-14 17:55:27 +00:00
d2076e38f1 correct own bad spelling 2011-01-23 12:42:07 +00:00
8cf1184c04 bad spelling; 'indicies' --> 'indices' 2011-01-18 01:58:19 +00:00
1939ad3f94 Bugfix #25614
Reporter saw weird fgons and edge creases on spin-mesh.

Appeared that the edge-flag copying code happened after
freeing edges. Already since May 2007 or so... weird!

Also in this commit a couple of simple cleanups.
2011-01-13 19:01:27 +00:00
89c9aaaa25 remove references to BKE_utildefines where its not needed.
- move GS() define into DNA_ID.h
- add BLI_utildefines as an automatic include with makesrna generated files.
2011-01-07 19:18:31 +00:00
8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
b0f87a1746 rename addlisttolist() to BLI_movelisttolist()
name was misleading because the list items were removed from the source list.
(no functional changes)
2010-12-21 14:49:34 +00:00
4474782aa3 bugfix [#25260] Solidify function UV mapping problems 2010-12-17 06:02:52 +00:00
342e79461b bugfix [#24398] Select Nth
- use first selected if non active (clears confusion since this isn't at all clear)
- dont take unselected into account when calculating connectivity, would mess up in many cases.
2010-11-02 11:14:04 +00:00
8268a4be71 most unused arg warnings corrected.
- removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating).
- mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later.
2010-10-16 14:32:17 +00:00
d058a9c8c3 bugfix [#23150] Creating Vertex with CTRL-LMB not snapping
- Added EM_project_snap_verts so other functions can re-use this, similar to old retopo_do_all().
- Changed how the normal for selected geometry is calculated, was accumulating half selected edge's into normals which was OK with even surrounding geometry but could skew too easily if the surroundings were not so even. Now use the 2D screen space selected edge vector to calculate the normals in relation to the target mouse position.
- Option to rotate initial selection, gives better results in some cases. (Ctrl+Shift+Click to disable)
http://wiki.blender.org/index.php/File:ClickExtrudeFix.png
2010-10-13 07:43:39 +00:00
f6c323aa42 - move more active properties into their collections:
scene.active_keying_set --> scene.keying_sets.active
  ...same for active_uv_texture. active_vertex_color, active_keyconfig, 

- move mesh.add_uv_layer() and mesh.add_vertex_color() into their collections
  also have them return the newly created layer and dont set the layer active.

  uvtex = mesh.uv_layers.new(name)
  vcol = mesh.vertex_colors.new(name)
2010-08-23 22:16:45 +00:00
39c0e690d3 sub_v3_v3v3 --> sub_v3_v3 (where possible) 2010-04-23 23:57:00 +00:00
fba7ebcbea replace add_v3_v3v3() --> add_v3_v3() where possible 2010-04-21 12:27:48 +00:00
8c3ab1c2a4 - use more inline math funcitons where possible
- swapped in less verbose math functons
- modifier include cleanup
2010-04-12 00:36:50 +00:00
f743b583bf more lint includes
Only source/blender/editors/ dir, should not give errors on different platforms
Only removing:  UI_*.h, ED_*.h, WM_*.h, DNA_*.h, IMB_*.h, RNA_*.h, PIL_*.h
2010-03-23 14:09:09 +00:00
1e9bf0cfdb spaces -> tabs, (4 spaces == 1 tab, only for white space preceding text) 2010-03-22 09:30:00 +00:00
42ac4a3e7d Fix syntax for ID keyword. 2010-03-21 01:14:04 +00:00
52db706abc [#19918] edit mode with mesh only having edges without faces+face select mode
Make select all operator select mode sensitive (it won't select elements that aren't selectable)

Patch by Sergey Sharybin (nazgul) (slightly modified)
2010-02-28 17:47:49 +00:00
5d9fcfb3ec Copy vertex normals on extrude (Normal orientation is wrong otherwise when not extruding faces). 2010-02-13 20:06:56 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
29377db3f1 [#19872] Mesh edit missing undo push for mode changing
copy the editmesh select mode back to the scene on undo.
2010-01-30 16:09:56 +00:00
38aacb92f3 Cleaned up some printfs in editors/ - converted some to reports, hid others behind G_DEBUG. 2010-01-22 06:48:29 +00:00
b0f87935a8 spelling errors, no real changes to code. 2010-01-14 10:59:42 +00:00
d74bbcdd85 select nth (face/edge/vertex) - depending on which was last selected, useful for colapsing every other edge for eg. 2009-12-22 19:01:51 +00:00
54c9557b85 Solidify modifier for Durian (allow cloth sim on single layer and make solid after)
Mostly the same as the recently added editmode tool with some extras.

* Options to disable filling in the rim between inner and outer surface, since its faster not to detect this in cases where its not needed.
* Option to disable high quality normal calculation, mostly noticable when operating on building walls, not needed for cloth or more organic shapes.
* Option to disable 'even thickness', again, not needed in some cases.

Also options for creasing inner/outer and rim edges, need this for makign Sintels cloths solid since zero crease looks far too soft.

note:
* UVs and VCols etc are copied to the new skin however rim faces dont get the UVs or vcols set from the faces they are created from yet.
* Normals are assumed to be pointing outwards
* used patch from Uncle Entity as a template since it added the DNA and RNA entries but the actual modifier from the patch wasnt used.
2009-12-21 01:02:08 +00:00
0095b89a67 Solidify was faiing in cases with flat aras because normal calculation assumed some angle between faces. 2009-12-15 23:35:26 +00:00
7fc799d4a9 utility functions for getting the corner angles of a quad or tri: angle_quad_v3 & angle_tri_v3 2009-12-15 09:39:46 +00:00
ded4cbb553 solidify would only work as expecyed if all faces were selected, added an override to extrude that means it runs without removing selected faces first, even on a partial selection 2009-12-15 00:53:34 +00:00
9fe37d9970 improve solidify results by weighting the faces influence on a vertex by the corner angle of each face before displacing 2009-12-15 00:24:30 +00:00
9633d198fb solidify from 2.4x (ported from python to C)
- shell_angle_to_dist() was using degrees
2009-12-14 23:35:13 +00:00
37e4a311b0 Math Lib
* Convert all code to use new functions.
* Branch maintainers may want to skip this commit, and run this
  conversion script instead, if they use a lot of math functions
  in new code:
  http://www.pasteall.org/9052/python
2009-11-10 20:43:45 +00:00