Commit Graph

33 Commits

Author SHA1 Message Date
Bastien Montagne
5b83a89c81 Followup to r59434 : py UI scripts edits.
Notes:
* Made those edits by full checking of py files, so I should have spoted most needed edits, yet it remains quite probable I missed a few ones, we'll fix if/when someone notice it...
* Also made some cleanup "on the road"!
2013-08-23 20:41:21 +00:00
Campbell Barton
e8c272422a code cleanup: py ui 2013-04-04 17:01:51 +00:00
Sergej Reich
146a1545c3 Fix typo in recent i18n changes
Broke rigid body buttons in physics tab.
2013-03-31 17:41:22 +00:00
Bastien Montagne
5262fcd4d3 I18n: various fixing.
* Reflect changes stated in prev commit about contexts in py code.

* Add a "Plural" context, to handle cases where english does not mark plural at all (e.g. shorten labels of only one adjective). Not so happy with that, but can't see any other way to do it, for now.

* Abuse "ID_CURVE" context for all falloff curves (this should solve some confusion issues, e.g. "sharp"...).
2013-03-28 15:41:43 +00:00
Bastien Montagne
5c5b753779 Fix [#34300] Slider for list of particle systems (keyed particles) is not doing anything. Navigating a list of more than 5 elements requires keyboard.
Systematically adding some custom id to template_list using default UI_UL_list class, this one is commoly used more than once in an area, yielding collision issues if they do not have a custom id...
2013-02-18 13:30:40 +00:00
Bastien Montagne
43f4f807d9 Fix physics' name not translated in main physics panel (reported on bf-translations ML).
This also revealed another bug, as you could not explicitely set default context to text_ctxt UI func parameter (None is not accpeted by RNA string props), so I had to change default context from py POV to "*" instead of None.

Anyway, that physics UI translation remains weak, as the trick used here (helper func) prevents message extractor script to directly find them. Currently it works because specified labels are also defined elsewhere, but it would be nice to have some kind of "translation markers" in py code too (similar to our N_/CTX_N_ C macros, unfortunately python does not have preprocessing ;) )...
2013-02-13 11:52:01 +00:00
Campbell Barton
5d4df1a999 pep8 cleanup 2013-02-10 08:54:10 +00:00
Sergej Reich
90a97a4710 rigidbody: Fix constraint buttons only showing for mesh objects
Was silly indentation mistake.
2013-01-23 13:45:52 +00:00
Sergej Reich
47c96081d0 rigidbody: Add rigid body constraints
Constraints connect two rigid bodies.
Depending on which constraint is used different degrees of freedom
are limited, e.g. a hinge constraint only allows the objects to rotate
around a common axis.

Constraints are implemented as individual objects and bahave similar to
rigid bodies in terms of adding/removing/validating.

The position and orientation of the constraint object is the pivot point
of the constraint.

Constraints have their own group in the rigid body world.

To make connecting rigid bodies easier, there is a "Connect" operator that
creates an empty objects with a rigid body constraint connecting the selected
objects to active.

Currently the following constraints are implemented:
* Fixed
* Point
* Hinge
* Slider
* Piston
* Generic

Note: constraint limits aren't animatable yet).
2013-01-23 05:56:56 +00:00
Sergej Reich
2d8637946b rigidbody: Add rigid body simulation
Add operators to add/remove rigid body world and objects.
Add UI scripts.

The rigid body simulation works on scene level and overrides the
position/orientation of rigid bodies when active.
It does not deform meshes or generate data so there is no modifier.

Usage:
* Add rigid body world in the scene tab
* Create a group
* Add objects to the group
* Assign group to the rigid body world
* Play animation
For convenience the rigid body tools operators in the tools panel of the 3d view
will add a world, group and add objects to the group automatically so you only have
to press one button to add/remove rigid bodies to the simulation.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)
2013-01-23 05:56:44 +00:00
Campbell Barton
97d62f0183 style cleanup 2013-01-15 23:15:32 +00:00
Bastien Montagne
7504cf34b4 This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!

This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!

To make all this work, other changes were also necessary:

* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.

* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.

* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.

* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
  Note: not sure whether we should add that one to all UILayout's prop funcs?

Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
Ton Roosendaal
d273ddfd4f Bugfix 30974
- Disabled "Quick Cache" option. It was causing ridiculous updates
  on the entire animation system for start-end frame on every user
  event causing changes here (like during transform). Worst was that you
  couldn't transform animated objects for that reason either.

  Most of the code is still there, waiting for a moment to revise it...

- Constraint "Follow Track" (marker) wasn't using inverse matrix code
  in transform, making it wacko to use (wrong pivot, crazyspace)
2012-10-23 14:07:32 +00:00
Daniel Genrich
cb634b9100 Google Summer of Code project: "Smoke Simulator Improvements & Fire".
Documentation & Test blend files:
------------------
http://wiki.blender.org/index.php/User:MiikaH/GSoC-2012-Smoke-Simulator-Improvements

Credits:
------------------
Miika Hamalainen (MiikaH): Student / Main programmer

Daniel Genrich (Genscher): Mentor / Programmer of merged patches from Smoke2 branch
Google: For Google Summer of Code 2012
2012-10-10 13:18:07 +00:00
Campbell Barton
9fa36b12cc style cleanup: pep8 2012-10-08 08:28:05 +00:00
Thomas Dinges
ab38e1d379 User Interface Scripts:
* Code cleanup, removed unneeded code.
* Style cleanup, don't break lines to early 
(unless marked as pep8-80 or pep8-120 compliant) 
* Keep 1 line after layout declaration empty.
2012-07-29 10:03:46 +00:00
Brecht Van Lommel
2c592b0d96 Point Cache: allow baking external smoke caches. This needs to be cleaned up
a bit, I couldn't fully understand how the External setting is supposed to
work to make further changes, but this should make it work at least.
2012-04-28 09:00:11 +00:00
Miika Hamalainen
d4541fd891 Merge with trunk r41197 2011-10-22 16:43:23 +00:00
Campbell Barton
fda2045150 correct spelling errors in comments 2011-10-17 06:58:07 +00:00
Miika Hamalainen
e8bb972f3c Merge with trunk r40782 2011-10-04 11:42:44 +00:00
Campbell Barton
f4c56a879d remove use of gettext: _("...") style translation now its handled by rna. 2011-09-21 15:18:38 +00:00
Campbell Barton
8f5112f191 pep8 update & some minor cmake edits. 2011-09-20 18:29:19 +00:00
Miika Hamalainen
15cb47bf91 Merge with trunk r40409 2011-09-20 17:51:04 +00:00
Xiao Xiangquan
981f7fcd0d merge with trunk r39834 2011-09-01 15:08:32 +00:00
Miika Hamalainen
c5106fd097 Merge with trunk r39589 2011-08-21 19:37:19 +00:00
Xiao Xiangquan
ed158eeeb9 update property strings cover. 461 new items 2011-08-18 15:53:30 +00:00
Campbell Barton
b374ab919a import common classes from bpy.types, saves ~1000 python getattrs on startup. 2011-08-12 06:57:00 +00:00
Xiao Xiangquan
79656a65e0 finish handle for properties_XXX scripts 2011-08-02 16:51:50 +00:00
Miika Hamalainen
3de22dec26 Dynamic Paint:
Committed changes from previous weeks, biggest changes are:
* Canvas can now have multiple "surfaces" that each can have specific format, type and settings.
* Renewed UI to support this new system.
* Aside from old "image sequence" output format, Dynamic Paint can now work on vertex level as well. Currently vertex paint and displace are supported.
* Integrated vertex level painting with Point Cache.
* Added viewport preview for Point Cache surfaces.

Due to massive amount of changes, old Dynamic Paint saves are no longer supported. Also some features are temporarily missing or may not work properly.
2011-06-16 10:41:00 +00:00
Miika Hamalainen
3b41ab432b Applied Dynamic Paint 1.18f patch as a codebase for GSoC. 2011-05-24 07:08:58 +00:00
Campbell Barton
9699592628 py api: bpy.data.is_dirty wasn't working like image is dirty, instead is would return if the file was saved or not.
- rename to 'is_saved' (and negated).
- add 'is_dirty' which is true when the files edits are not saved to disk.
2011-04-11 15:31:05 +00:00
Campbell Barton
265cdf29fb fix [#26754] Live Edit and Editing UI scripts don't work 2011-04-04 10:13:04 +00:00
Campbell Barton
2e6a02438e move script directories for internal blender scripts.
ui/ --> startup/bl_ui
op/ --> startup/bl_operators

scripts/startup/ is now the only auto-loading script dir which gives some speedup for blender loading too.

~/.blender/2.56/scripts/startup works for auto-loading scripts too.
2011-03-21 12:35:49 +00:00