Commit Graph

46 Commits

Author SHA1 Message Date
Campbell Barton
7a31417f50 apply UserPrefs and Theme rna naming changes. 2010-08-17 13:14:41 +00:00
Thomas Dinges
76e1773548 2.5 User Interface / UI Scripts
* Fixed some panel ordering after recent register changes.
* Placed "Custom Props" to the bottom again, where possible

This fixes [#23171] Material context is messed up.
2010-08-12 19:36:10 +00:00
Campbell Barton
a6f13f9d7b poll() as a python '@staticmethod' was too limiting and didnt allow useful base class poll functions in many cases.
now rna functions that dont have a 'self' are automatically assumed '@classmethods'.

de-duplicated poll functions and made some minor tweaks too.
2010-08-09 01:37:09 +00:00
Campbell Barton
acca04bf33 remove narrow ui feature
- re-arranged UI in a way that gave far too much vert scrolling.
- was added all over for simple things like making text="", layout engine should handle this.
- Ton and Brecht are ok with removing this now. Ton would like to work on the layout engine to make it better support these cases.
2010-08-06 15:17:44 +00:00
Campbell Barton
163f6055d2 bugfix [#23182] Using self.report() inside poll() gives crash
poll() function is now a static method in python, this is more correct, matching C where the operator is not created to run poll.


    def poll(self, context): ...

is now...

    @staticmethod
    def poll(context): ...

Pythons way of doing static methods is a bit odd but cant be helped :|

This does make subclassing poll functions with COMPAT_ENGINES break, so had to modify quite a few scripts for this.
2010-08-05 16:05:30 +00:00
Martin Poirier
5b345524ea RNA Types metaclass registration
See mailing list posts for details [1][2][3]

Addons still need to be fixed; Campbell said he'd do it today.

See any of the py files (outside netrender) in this commit for how to do it (it's rather simple).

[1] http://lists.blender.org/pipermail/bf-committers/2010-February/026328.html
[2] http://lists.blender.org/pipermail/bf-committers/2010-August/028311.html
[3] http://lists.blender.org/pipermail/bf-committers/2010-August/028321.html
2010-08-02 02:55:12 +00:00
Campbell Barton
bb07503d89 remove filename and directory from python operators that dont need them 2010-06-26 22:32:47 +00:00
Campbell Barton
c2f36a4d6a naming changes
path -> filepath (for rna and operators, as agreed on with elubie)
 path -> data_path (for windowmanager context functions, this was alredy used in many places)
2010-06-14 03:52:10 +00:00
Joshua Leung
6e66bfe110 Removed obsolete comment for previous commit 2010-05-16 11:43:48 +00:00
Thomas Dinges
e1bf9d30bc Properties Window:
*The narrowui value was hard coded in all ui scripts, made an user preferences option. Basically this value determines on which area width, it should switch between dual/single column layout. 

ToDo: The Changes only take effect when reloading scripts/restarting Blender (after saving as default). Will maybe add the "Reload Scripts" operator next to the button in the future. 

* Small fix for Fluid Add Button, when in single column mode. Didn't expand like the other "Add" Buttons.
2010-05-16 10:21:00 +00:00
Joshua Leung
f90f3d9c29 Animation fixup squad to the rescue!
R 27991 broke all script-based Keying Set support, including all the Built-In Keying Sets. This meant that it nearly impossible to still keyframe anything (there are other less convenient ways, but none work quite as well).
2010-04-04 22:13:57 +00:00
Campbell Barton
bc149e0fbe pep8 cleanup 2010-04-04 14:52:15 +00:00
Joshua Leung
c46a955ee0 Assorted animsys fixes/tweaks:
* Fixed all the dangerous code added in 27907. Using the code there, scripters could corrupt animation files in ways which would render them useless, with channels not appearing in any animation editors, and others not getting evaluated at all. 

* Partial fix of bug 21818, by disabling destructive replacement of keyframes. Will followup this commit with a more comprehensive commit which gets rid of the rest of the problems, by incorporating some requests from Durian team.

* Fixed problems with users being able to see+edit the name of the active Keying Set in the Scene buttons. There is still a bug though with the list widget given how the indices are now interpreted...
2010-04-01 06:26:41 +00:00
Joshua Leung
4ae515a4e5 Keying Sets: BuiltIn vs Absolute Tweaks
This commit clarifies the somewhat "murky" separation between "builtin" and "absolute" KeyingSets as a result of discussions with Cessen.

* "Builtin" Keying Sets are now just the Keying Sets which in the past have been known as PyKeyingSets or Relative KeyingSets. These are registered from Py Scripts at startup, and will use the context info to determine what data they should be keyframing. These are stored per Blender session, independent of files, since usually these will be coded specific to sets of rigs used at a studio.

* "Absolute" Keying Sets are the ones that you can create from the Scene buttons and/or KKEY or RMB over any property. They specify the exact set of properties which should always get keyframed together. These are stored in the scene. 

In relation to this, I've made it possible to now set one of the builtin Keying Set types as the active Keying Set. 
* For now, this can only be done via the box beside the insert/delete key operator buttons on the TimeLine header (now complete with an recycled icon - HINT TO ICON DESIGNERS, to make this a bit more obvious). Later on I'll commit an operator to set this via a hotkey.
* The "IKEY" menu will only show up when there is no active Keying Set. When there is one, keying will happen silently (with info notice at the top of the screen). Later on, I'll hook this menu up to a hotkey, so that that active Keying Set can be changed without inserting keyframes or clearing active Keying Set...
* By default, there isn't any default Keying Set enabled. IMO, this is probably a good default, though some might like to have LocRotScale instead.
* I'm not terribly impressed with the search menu for the items being SORTED (and of all things, alphabetically!) currently, since this does break muscle-memory with the menu (and jumbles up order of closely related vs not closely related).
* The Scene buttons for KeyingSets still need some changes to fully cope with users setting builtin KeyingSets as active sometimes. Controls which are useless or shouldn't be used when a builtin set is shown are being shown.

Builtin set registrations have been tweaked a bit:
* Renamed "bl_idname" to "bl_label" for consistency with rest of API. Note that this is the identifier used by Blender internally when searching for the KeyingSet, and is also what the user sees.
2010-03-23 11:59:34 +00:00
Joshua Leung
1cf95d2494 Keying Set Fixes:
* 'Export Keying Set' operator works again - a change in the previous commit broke the created code
* Relative Keying Sets don't get their paths shown 
* Keying Set paths show options for inserting keyframes too now

---

Another attempt at fixing compile troubles, and removed some commented out + obsolete stuff.
2010-03-16 10:18:19 +00:00
Campbell Barton
78bb45931c scene.render_data -> scene.render
bpy.types.SceneRenderData -> bpy.types.RenderSettings

better do these changes before there are too many scripts out.
2010-02-23 12:48:35 +00:00
Campbell Barton
97bdfe6f1b pep8 cleanup + correction for external player operator return value. 2010-02-22 23:32:58 +00:00
Campbell Barton
23efeff6a9 [#21177] Text editor
Running scripts directly didnt call the register function, even though this is not essential its good to be able to run a script directly and see changes in the UI.
2010-02-16 09:55:07 +00:00
Thomas Dinges
fece4fd610 Bugfix for the new script register functions, scene tab didn't show Panels due to missing classes. 2010-02-15 01:22:34 +00:00
Campbell Barton
39c04315e2 change python scripts so modules which register with blender have a register() function rather then making import automatically run the register functions (generally considered bad practice by python people) 2010-02-14 11:21:21 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Campbell Barton
f80617ab37 render simplify option to disable triangulation.
- triangulating non planer quads is needed to resolve some artifacts however this also ends up triangulating most faces in - Suzzane subsurf level 4 for eg.
this check could be tuned for better performance but for now skipping it is useful for test renders.
2010-02-02 15:51:44 +00:00
Campbell Barton
039d087171 subtype support for properties in bpy.props. 2010-02-01 22:04:33 +00:00
Joshua Leung
c3e96bf0fc Finished some todos for the Export KeyingSet operator:
- Keyframing and other KeyingSet-level settings are now included in the exported script too
- A table of lookups for ID-block shorthands is built and included to make running the exported script more efficient and less confusing
2010-02-01 04:07:43 +00:00
Joshua Leung
2a5d7f929d Keying Sets: Export to File
This commit adds an operator which saves the active Keying Set in a form which can be used to regenerate the Keying Set again in another file using the Keying Sets API.

This could be made smarter by caching the ID-blocks used, and writing aliases for those, but that can be done later.
2010-02-01 01:08:45 +00:00
Campbell Barton
95069f2909 pep8 changes 2010-01-31 14:46:28 +00:00
Brecht Van Lommel
cbb23d96bb Added simplification back for quicker preview renders with less subdivision
levels, child particles, and shadow/SSS/AO quality.. Now also works on what
is displayed in the 3d view instead of only rendering, see panel in the scene
properties.

Most file changes were to make scene available in the isDisabled modifier
callback function.
2010-01-25 11:39:56 +00:00
Matt Ebb
41499247db Add option to choose between radians or degrees for rotation units in the UI.
Setting is in Scene->unit settings with the others, degrees by default.
2010-01-25 10:05:17 +00:00
Campbell Barton
b8ca67ca33 custom properties panels for most ID types. use subclassing to keep panel UI definitions minimal 2010-01-08 08:54:41 +00:00
Campbell Barton
3449d3f9b3 use python3 syntax for defining a set. 2009-12-13 16:20:18 +00:00
Campbell Barton
a1656300ba script for automating pep8 checks.
On ubuntu/debian install these tools...

   sudo apt-get install pylint pyflakes python-setuptools python-pip
   sudo pip install pep8

then run from blenders source dir...
   python release/test/pep8.py

This searches for the comments "# <pep8 compliant>" and "# <pep8-80 compliant>", running the checking tools on these scripts only.

* some minor pep8 corrections too.
2009-12-13 13:59:16 +00:00
Campbell Barton
97abf6ad96 * rename 'rna_path' --> 'data_path', rna and dna are for internal use and are not descriptive.
* armature.pose_position: POSE_POSITION, REST_POSITION --> POSE, REST
* rigify now forces rest pose mode
* updated neck_flex to keep original bones unchanged
2009-12-10 22:23:09 +00:00
Joshua Leung
6b7544bfda Durian Request: Default F-Curve Auto-Colour Modes
Added option to KeyingSets+Keyframing Functions which makes newly added F-Curves for Transforms + Colours to use the colour mode which uses the array index to determine the colour of the F-Curve. 

The main implication of this is that when this option is enabled for a KeyingSet, all sets of XYZ F-Curves (i.e. location, rotation, scale) for transforms will be shown in Red/Green/Blue instead of some automatically determined "rainbow" colour. Useful for animators far too used to Maya's Graph Editor :P

This setting is named, "XYZ to RGB", though that doesn't make its purpose entirely clear.
2009-12-10 10:40:28 +00:00
Campbell Barton
b5740b0e77 remove ICON prefix from the enum, for python this is redundant eg.
layout.prop("setting", icon='ICON_BLAH_BLAH')

Also reverted previous commit, the cursor subtype just needed to be added to the switch statement.
2009-12-10 10:23:53 +00:00
Campbell Barton
caab05ec8c rna UI api rename...
note: this aims to follow pep8 however I chose to use 'prop/props' rather then 'property/properties' because it would make function names too long.

itemR() --> prop()
items_enumR() --> props_enum()
item_menu_enumR() --> prop_menu_enum()
item_pointerR() --> prop_pointer()
itemO() --> operator()
item_enumO() --> operator_enum()
items_enumO() --> operator_enums()
item_menu_enumO() --> operator_menu_enum()
item_booleanO() --> operator_boolean()
item_intO() --> operator_int()
item_floatO() --> operator_float()
item_stringO() --> operator_string()
itemL() --> label()
itemM() --> menu()
itemS() --> separator()

batch script used http://www.pasteall.org/9345
2009-11-23 00:27:30 +00:00
Campbell Barton
bdb8004165 use is rather then == when comparing with singletons (None/False/True), its faster and suggested by pep8 2009-11-22 17:41:35 +00:00
Thomas Dinges
2577bfddfd Renamed "col2" to "wide_ui" which is more meaningful. 2009-11-19 13:26:51 +00:00
Campbell Barton
d33291fcc4 used py error checking tools to fix some bugs & make pep8 corrections 2009-11-14 13:35:44 +00:00
Campbell Barton
aeca8f6a35 undefined py variable 2009-11-12 15:13:47 +00:00
William Reynish
bee2335aa0 Implemented suggestion be Matt to slightly tweak the code for single column UI 2009-11-12 13:05:12 +00:00
William Reynish
9596b369bd Added single column UI layouts
This changes the layout when the properties window gets too narrow to render the contents properly. 

Currently implemented for render, scene, world, object and materials, but the rest can be done easily.
Here's a video for demonstration:

http://www.reynish.com/files/blender25/properties_resize.mov

It automatically detects the window width and then skips the indicators that tells the layout to go to the next column. It requires very minimal changes to the UI scripts so we don't have to maintain two versions of the layouts.
2009-11-12 12:35:37 +00:00
Campbell Barton
cbc5a78576 whitespace commit, (was some tabs mixed with spaces too) 2009-11-03 07:23:02 +00:00
Martin Poirier
9ea292290b Correct GPL license header for all python scripts 2009-11-01 15:21:20 +00:00
Campbell Barton
d964808846 made scripts pass the pep8 test (though not fully pep8 yet)
added comment in header to know if a script has been converted or not.
2009-10-31 23:35:56 +00:00
Campbell Barton
41c0236aaa GPL2 header from firebird (without disclaimer), notice theres no copyright attributed and only the GPLv2 (without the v2 or later clause).
Contributors list isnt used much in our C code so probably its easier if people just use svn blame for this.

Can change if this isnt acceptable but I guessed people didnt care so much since most scripts had no header.
2009-10-31 20:16:59 +00:00
Campbell Barton
944a8d33fe renamed buttons ui files to properties to match UI name change, needed to update some imports too 2009-10-31 19:57:59 +00:00