Commit Graph

112 Commits

Author SHA1 Message Date
790374d07d code cleanup: rename editmode functions so we have ED_object_editmode_load/enter/exit 2013-03-21 14:18:17 +00:00
885441e758 I18n users request: add the ability to use a translated name for newly added/created objects or other datablocks.
This simply adds a third "translation type" (in addition to iface and tip), "new data", with relevant user settings flag and helper funcs/macros (and py api).

Currently implemented name translation when adding new objects, as well as modifiers and constraints, will add the others (cd layers, scenes, perhaps nodes [though I think they do not need this], etc.) later.
2013-03-20 18:42:09 +00:00
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +00:00
dfa8540cdf use bool for rna funcs. 2013-03-07 02:44:55 +00:00
1f3e3b0d68 include cleanup 2012-12-19 04:49:32 +00:00
d5c2a1f8f4 remove context argument from EDBM_update_generic() 2012-12-12 15:22:54 +00:00
44b634bcb1 make EDBM_index_arrays's stay in memory, blender was allocating an array and filling it for verts/edges/faces on every redraw.
this may introduce bugs which I didn't catch, but they are very easy to identify in a debug build which has asserts to ensure the arrays are valid before use.

in my own test drawing ~98,304 quads - this gave an overall ~16% drawing speedup.
2012-12-12 06:53:39 +00:00
7c699a217a define the size of matrix args for both rows/cols. 2012-12-11 14:29:01 +00:00
22505c10f8 fix [#33442] Units
adding meshes were scaling the user input values so the distance on the button didnt relate to the scale of the object added.

Now use an invoke function that scales unset default values.
2012-12-09 10:48:18 +00:00
61da29996a fix own mistake with recent commit to skip calculating tessface. If you were already in editmode the tessfaces wouldn't get recalculated.
also minor edits to bmesh rst.
2012-12-03 02:26:13 +00:00
9653c929ed skip recalculating tessface when adding objects if 'EnterEdit-mode' is disabled. 2012-11-29 02:37:39 +00:00
8ecce451ab bmesh operator naming - use clearer names for args eg: (mat -> matrix, use_singleedge -> use_single_edge)
also remove duplicate docs for operator arg formatting.
2012-11-28 00:16:06 +00:00
0332698e02 Fix for add plane operator broken since recent code cleanup 2012-11-20 10:43:11 +00:00
dbdc76c9d0 code cleanup: make bmesh operator names more consistant since python has access to these as input arguments and return values.
all output values currently have ".out" suffix, this may go in the future, but for now it makes it clear in C code what are inputs and outputs.
2012-11-20 05:50:19 +00:00
7abee9614a Bugfix, IRC report:
The "Add Monkey" object name should be Suzanne - as it was until 2.50. :)
2012-11-13 15:47:22 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
a75f11d036 Fix #32219: Inconsistent influence of Units Scale on new objects
Made it so meshes, curves, surfaces and metaballs are scaling to a grid cell size,
which makes them behave consistently now.

There're still issues to be resolved still:

- Lattice is not scaled to grid cell size yet, it uses slightly different add
  function which makes scaling a bit tricky and hacky. Would prefer to do a
  bit bigger refactor here, so it's a TODO for now.

- Cameras, speakers and other helpers are not scaling. They don't have data
  on which scale could be applied and perhaps it should be some kind of draw
  scale. Also would consider it's a TODO for now.
2012-10-19 12:53:03 +00:00
00ce0c9aae Clean up in "add object" code:
* Get rid of ED_object_add_generic_invoke() and all invoke callbacks using it, it was doing nothing exec() callbacks would not do. In fact, its only action (setting part of common add ops properties, like loc, layers, etc.) was needed too by direct exec call, so it was done twice in case of using invoke()!
* Replace custom invoke code for metaballs by WM_menu_invoke helper (as already used by lamps).
* Add a new OBJECT_OT_empty_add op, to allow direct addition of empties of a given drawtype.
* And some general code cleanup (like trailing spaces, empty lines, ...).

Did quite a bunch of tests/verifications, but obviously could not tackle all possible scenarios... Anyway, if any, bugs should arize quite quickly (but I don’t expect any! :p ).
2012-10-05 12:59:09 +00:00
c574419049 fix for crashes caused by mixups when adding objects when incompatible object types were already in editmode. 2012-09-23 07:18:50 +00:00
2812dd92cf code cleanup: use BMEdit_FromObject() rather then me->edit_btmesh in more places. 2012-09-10 03:34:43 +00:00
c3a7db28d3 Fix #31657: adding mesh objects did not take units into account for the grid
scale that sets the default size.
2012-05-31 16:04:03 +00:00
54b64cfd61 code cleanup: use const float and define array size 2012-05-26 22:21:56 +00:00
5da2135eef code cleanup: double promotion & some style cleanup 2012-05-03 21:35:04 +00:00
5591d03f21 fix invalid *= on an un-initialized value when adding primitives. 2012-03-28 22:11:19 +00:00
1e7bcece44 Fix bug 30696, circular mesh objects had wrong orientation.
Behavior now matches 2.62, circle, cone, and cylinder get first vertex
at 0 degrees.

Also fixed range for vertex property of add-cone and add-cylinder
operators, changed minumum from two to three.
2012-03-27 10:28:06 +00:00
05abdf344b minor code/style cleanup 2012-03-27 05:03:23 +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
ca05219f3e fix [#30651] bpy.ops.object.mode_set(...) editmode removes faces.
problem was that BMesh had tessellation call when undo pushes were called.

if python called an operator with no undo push, tessfaces would not be created.

fix this by making it the responsibility of each editmesh operator to re-tessellate, as it is with notifiers and depsgraph.
added EDBM_update_generic() function to add notifier, tag for depsgraph update and optionally re-tessellate.
2012-03-27 00:01:35 +00:00
48f0444760 style cleanup: editors/mesh - mostly whitespace around operators 2012-03-26 02:56:48 +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
2f348d8b5d style cleanup: mainly for mesh code, also some WM function use. 2012-03-24 02:51:46 +00:00
4c3bb77012 style cleanup: spaces aroudn operators for operator definitions. 2012-03-22 07:26:09 +00:00
b3a0a33791 "Fix" [#30431] UI string spelling & similar fixes.
All suggested changes looked good to me, thx to Michael Färber for this list of changes!
2012-03-02 21:14:37 +00:00
edc1dde20d Segments and rings for UV Sphere were swapped. 2012-02-23 12:06:49 +00:00
c8b53d2aaf code style cleanup, no functional changes. 2012-02-23 02:23:42 +00:00
1953f042e6 added boolean type for bmesh operators, will make python wrapping clearer and also makes existing calls more obvious.
also corrected some error reports.
2012-02-20 01:52:35 +00:00
fd89fa15c5 sync some changes with trunk and rename bmeshutils.c 2012-02-19 17:11:40 +00:00
eee22fe2f6 rebane files to match trunk. 2012-02-19 16:54:53 +00:00
20fac2eca7 The Death Of Editmesh - Part 1
I've removed editmesh altogether (other then scanfill, which is
seperate code that happens to reuse the editmesh structures).
The compatibility layer I had written for old editmesh tools
was more trouble then it was worth, though it did help in the 
early stages of this project.

There's a fair amount of breakage, and there's bunches of tools
(mostly minor ones) I need to port over still.  Biggest ones are
join triangles and loop to region, and spin/screw.

This probably isn't really testable, I'll hopefully have more
work done on this soon, but might not be before next week.
2010-01-28 00:45:30 +00:00
219b472920 merge with trunk/2.5 at r25907 2010-01-13 07:26:11 +00:00
8f7c106e64 Fix #20604: Make Normals Consistent (Ctrl N) doesn't respect selection. 2010-01-08 14:41:32 +00:00
67ff197cb1 Merge with trunk/2.5 at r25563
Most likely will not compile for others, I'd appreciate any build errors
and missing files reports (I can never seem to get everything committed
and all the build systems working without help).

Porting over the sculpt/multires tools was a breeze,
thanks goes to brecht for a design that didn't exclude
ngons and was easy to port.

Note that I've not tested externally-backed multires
file support yet.  Also, I still need to write version
patch code for some cases.

Some notes:

* Like trunk, topological changes don't update multires right,
  so e.g. subdivide will duplicate multires data on the new faces,
  instead of subdividing it.
* If you set the debug value (ctrl-alt-d) to 1 it'll turn on
  my experiments in speeding up sculpting on higher-res multires
  meshes (but note it makes partial redraw not completely accurate).
* There's a bug where you have to go through editmode to get out
  of sculpt mode, not sure if I inherited or created this myself.
2010-01-05 22:33:41 +00:00
dbf295b904 Added location and rotation operator properties for adding objects. The Align to View boolean
is now just used to set the rotation property value during invoke.

This removes some reliance on 3d view info for non-interactive use, and also lets you specify
new object's locations/rotations explicitly when calling from Python.
2009-12-28 04:09: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
0e165c55bb did math lib conversion, equivilent to merge with trunk/2.5 at r24464 2009-11-23 14:41:22 +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
2ead17843c merge with trunk/2.5 at r24378 2009-11-07 23:10:18 +00:00
b1ac71b3a0 enter editmode when adding objects even if the object is not in an active layer,
useful for python but in rare cases this also happens for users.

Active layer getting out of sync is an old bug but hard find when it happens.
This at least fixes segfaulting on adding objects.
2009-11-05 14:25:08 +00:00
1d9f90ed42 - all add object operators now take view_align as an argument, and enter_editmode where its used. Makes running the operator from python pradictable without having to know the user prefs.
- missing return in function
- python error in view3d (assumed active object exists)
2009-11-02 16:07:49 +00:00
2d0d4e7de4 commit before doing some hefty shapekey change, will break compilation 2009-11-01 00:06:53 +00:00