Commit Graph

310 Commits

Author SHA1 Message Date
Tom Musgrove
1eed648aa9 allow darwin and windows users to use the view based image editing also, temporary hard coded workaround till it is setable via prefs 2010-03-07 02:08:43 +00:00
Campbell Barton
c052a5bc36 mplayer preset, plays back movies and image sequences.
added scene.render.is_movie_format
2010-03-07 02:04:30 +00:00
Campbell Barton
3838b80cf1 re-project + gimp integration, now its easy to edit the view in the gimp and apply the projection back without manually opening and saving files. 2010-03-06 21:47:16 +00:00
Campbell Barton
7c0d2ffb64 pep8 cleanup 2010-03-06 01:40:29 +00:00
Campbell Barton
d975351f51 parts of the Python API are unstable, big discalmer in API docs main page, API Docs title and interactive console banner. 2010-03-01 10:34:54 +00:00
Campbell Barton
fbb8672da4 replace operator options bl_undo and bl_register with bl_options
eg.
 bl_options = {'REGISTER', 'UNDO', 'BLOCKING', 'GRAB_POINTER'}

This didnt exist when operators were originally wrapped.
2010-03-01 00:03:51 +00:00
Campbell Barton
ed7f4f2e3c make BGL and BLF modile names lowercase 2010-02-28 14:57:26 +00:00
Campbell Barton
3dd3e7321e store vars in py operators in the instance rather then the operator classes. 2010-02-27 14:54:45 +00:00
Campbell Barton
bbf6dde277 rna/py api
rename image.save() --> image.save_render() because it uses render settings for saving.
added image.save() which is like pressing save in the image view, saving to the images path and removing the dirty flag.
2010-02-26 12:28:44 +00:00
Campbell Barton
0b33be5a7b select parent/child in object mode with [] keys, like pose mode.
also needed to extend the RNA api to allow C to set enums without meaningful values.
2010-02-25 15:41:46 +00:00
Campbell Barton
a9307a4dd3 [#21295] Escape key doesn't cancel python modal operators
also fix distance with lamps being negative for typed in values.
2010-02-24 15:56:27 +00:00
Campbell Barton
9e2e528c36 - finally a way to force removal of images (Shift+Click on the X)
- generic modal operator now works with int's
2010-02-23 15:34:02 +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
Daniel Salazar
f5cf555e6c Context for Object Align op = Object mode 2010-02-22 13:25:32 +00:00
Campbell Barton
4ef1fd1078 game engine support for recording animation back & some other minor changes. 2010-02-22 12:25:58 +00:00
Campbell Barton
bc3d96678d bugfix [#21233] Crash in pyapi, with new object.
pass the obdata as an argument rather then assigning later so as not to allow an invalid state.
2010-02-22 00:07:46 +00:00
Campbell Barton
0cc59b9bb7 generic modal operator to make adjusting almost any rna property with the mouse possible with a few lines.
Example which is similar to interactive lamp adjusting in 2.4x ...
  wm.context_modal_mouse(path_iter="selected_editable_objects", path_item="data.spot_size")

Added lamp Wkey menu back.
2010-02-21 14:05:02 +00:00
Campbell Barton
3085edf2af [#21219] Separate autocomplete text with command prompt in console
from Aurel W (aurel)
2010-02-18 17:11:12 +00:00
Campbell Barton
576b0d9777 join as UVs referenced older api function name 2010-02-17 16:31:37 +00:00
Daniel Salazar
961207e631 Align Object op: ignore objects other than Mesh type 2010-02-17 08:57:40 +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
Daniel Salazar
bd7bfff682 bug #21160, misspell in align objects operator 2010-02-15 10:06:27 +00:00
Campbell Barton
aaf5f5d470 rename euler_filter.py -> fcurve_euler_filter.py
check if the .Blog file exists rather then using an exception.
2010-02-15 08:17:57 +00:00
Daniel Salazar
d300c28e74 Align Object op: Introducing Align Modes Negative Sides / Centers /
Positive Sides. Not the most beautiful code ever but will beautify after everything is
implemented
2010-02-15 06:01:13 +00:00
Campbell Barton
3871cb78bc autocompete was matching import_foo as import keyword.
breaking autocomp. on import_scene_obj for eg.
2010-02-14 12:23:25 +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
Daniel Salazar
b02f78ed02 Using multiline descriptions like this:
"""                                                                                              
    Fixes the most common causes of gimbal lock in the fcurves of                                    
    the active bone.                                                                                 
    """
is causing bad glitches (boxy characters) on the tooltips..
2010-02-14 07:05:50 +00:00
Joseph Eagar
a81030a95e Added a euler filter script, to filter out discontineouities in euler curves (e.g. where curves randomly have -/+ multiples of 360 offsets in sections). To use, select a curve in the fcurve editor and do Channel->Discontinuity (Euler) Filter. Note, will only work on euler rotation curves, won't do anything on anything else. 2010-02-14 03:18:43 +00:00
Daniel Salazar
8f0b1acae2 Align Objects operator: Added align relative to Active object 2010-02-13 23:29:26 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Campbell Barton
912fdcacab button to save edited textures in texture paint 2010-02-12 11:34:25 +00:00
Daniel Salazar
bb4f77ffe3 Align Objects operator: added selection center as align center 2010-02-12 05:02:29 +00:00
Daniel Salazar
6b01ab5e23 Align Objects operator: adds option to align relative to 3D cursor as
well as Scene Origin
2010-02-12 01:03:22 +00:00
Daniel Salazar
f0e873cabe New Align Objects operator. Currently it has very little functionality but
already does alignment operations that are very hard to do manually
2010-02-11 23:27:34 +00:00
Daniel Salazar
bc5f81ee3c Clean up of tooltips in py operators and better operator name for
randomize transform
2010-02-11 23:13:47 +00:00
Campbell Barton
157a694607 - select active camera operator
- calling menu use exec rather then invoke
2010-02-11 21:17:05 +00:00
Daniel Salazar
526da4f686 Killing more dots! 2010-02-10 22:18:00 +00:00
Daniel Salazar
c2b8626856 Fix for bug [#21015] Render Panel Presets do not remember fields
setting. New presets will remember field settings but I didnt change
existing presets since I think this could be dangerous.
2010-02-10 16:43:43 +00:00
Campbell Barton
19b5cc3d16 make dupliface rotation was wrong. 2010-02-10 16:40:02 +00:00
Campbell Barton
358c956637 make dupliface operator (access from object menu)
scene.object.link() now returns the new ObjectBase
2010-02-10 16:10:47 +00:00
Daniel Salazar
6d833bced2 Better default resolutions for UV Sphere and Torus primitives (nice square
faces)
Torus is generated flat shaded like the rest of primitives for easier
tweaking of resolution and consistency with the rest of the primitives
2010-02-09 21:05:59 +00:00
Joerg Mueller
6c8e3e303d 2.5 Audio:
- Python script to crossfade two sound strips in the sequencer
- Fix for the libsamplerate code producing awful audio when resampling sequencer strips
- Changed default resampler to a linear one (as temporary workaround for a bug that seems to be in the samplerate code)
- Fix for the OpenAL device to return a more accurate playback position
2010-02-08 14:43:44 +00:00
Joshua Leung
f99d06bc83 Patch #21011: Tweaks to Sky/Atmosphere presets
Patch by Daniel Salazar - ZanQdo

- Do not change save the distance factor since this is not relevant as a preset, it should stay at what ever the user
set it to work with that particular scene
- fixed a tooltip
2010-02-07 22:26:37 +00:00
Campbell Barton
6d38010cc5 sunsky presets
* Mountain: low turbidity, well-defined sun, blue-ish (high sun energy)
* Desert: high turbidity (dust), big, diluted sun, red-ish
* Classic: average turbidity (water vapor), small, diluted sun.

also fixed a bug with saving string presets
2010-02-07 13:56:36 +00:00
Joshua Leung
3fb8939870 Patch/Bugfix #20997: Recent commit to object_randomize_transform.py by Cam added some garbage to a variable name making the script fail
Patch by Daniel Salazar (ZanQdo)
2010-02-07 11:53:00 +00:00
Campbell Barton
a1d2b84222 patch [#20910] Support for exporting UV layouts to EPS files
also improved this so visible UVs are exported unless 'All UVs' is enabled, taking into account local-view and mesh face selection.
2010-02-05 15:20:12 +00:00
Campbell Barton
2973ffbb49 add menus for vertex group and shape key panels, functionality wasnt communicated well with icons and getting cluttered.
also made 'transfer shape' script copy into the active object to match 'join as shape', which was quite confusing before.
2010-02-05 14:29:05 +00:00
Campbell Barton
02dc4e9748 shape key transfer
- use the shape key basis for applying relative vertex locations
2010-02-02 12:04:03 +00:00
Campbell Barton
039d087171 subtype support for properties in bpy.props. 2010-02-01 22:04:33 +00:00
Campbell Barton
7bd3d1213a shape key transfer fix.
workaround for the vert locations not being relyable, use the base shape key rather then the verts to calculate the offsets.
2010-02-01 15:09:35 +00:00
Campbell Barton
95069f2909 pep8 changes 2010-01-31 14:46:28 +00:00
Campbell Barton
27f715052a minor corrections to scripts 2010-01-29 15:20:25 +00:00
Campbell Barton
e85a023480 bugfix [#19681] adjusting the settings of the 'add torus' tool in edit mode 2010-01-29 15:19:19 +00:00
Campbell Barton
ccfd67a8d0 missed updating reload scripts 2010-01-28 17:50:50 +00:00
Matt Ebb
904665f15b [#20728] "Export UV Layout" overwrites existing files (without feedback)
The 'save over' popup was only appearing based on a string comparison of the operator name ("Save"). Changed this to use a hidden operator property: "check_existing". Python operators must 
have this property for the file selector confirmation too.

This property can also be set to false, to prevent checking for existing files, useful in the File->Save menu item to prevent the dangerously missable confirmation popup.
2010-01-27 02:20:24 +00:00
Campbell Barton
bffad18da8 [#20046] 2.5 "bridge faces" tool doesn't delete original selection
remove this script, its not good enough, remove grease pencil retopo also.
2010-01-26 14:39:01 +00:00
Campbell Barton
0a0f4c9d81 Mathutils refactor & include in sphinx generated docs, (TODO, include getset'ers in docs)
- Mathutils.MidpointVecs --> vector.lerp(other, fac)
 - Mathutils.AngleBetweenVecs --> vector.angle(other)
 - Mathutils.ProjectVecs --> vector.project(other)
 - Mathutils.DifferenceQuats --> quat.difference(other)
 - Mathutils.Slerp --> quat.slerp(other, fac)
 - Mathutils.Rand: removed, use pythons random module
 - Mathutils.RotationMatrix(angle, size, axis_flag, axis) --> Mathutils.RotationMatrix(angle, size, axis); merge axis & axis_flag args
 - Matrix.scalePart --> Matrix.scale_part
 - Matrix.translationPart --> Matrix.translation_part
 - Matrix.rotationPart --> Matrix.rotation_part
 - toMatrix --> to_matrix
 - toEuler --> to_euler
 - toQuat --> to_quat
 - Vector.toTrackQuat --> Vector.to_track_quat
2010-01-25 09:44:04 +00:00
Campbell Barton
f0d89a041f bugfix [#20774] ctrl+alt+f switches to Object mode if you are in local view 2010-01-22 21:57:41 +00:00
Campbell Barton
09424badda bugfix [#20726] "Export UV Layout" creates invalid SVG files
- use xml.sax.saxutils.escape() to give an XML compatible string.
- in some cases material indicies could be invalid. use the default material rather then throwing an error.
2010-01-20 11:08:50 +00:00
Campbell Barton
9396bb2da9 - AIX ifdef's so windows works, cant test but this seems the most used define. might need to add to buildsystem config.
- transform default scale was too hight, calls to random were inconsistant. (fault of own modif's)
- cmake openal include was added twice on recent commit.
2010-01-19 15:57:02 +00:00
Campbell Barton
c02b26e463 convert rotations into radians (not scale) 2010-01-19 09:51:09 +00:00
Campbell Barton
8ae76d7249 pep8 compliance for Randomize objects loc/rot/scale.
- scale min -1 to 1 rather then -100 to 100
- default precision for float props to 2.
2010-01-19 09:36:40 +00:00
Campbell Barton
98312235b0 own error from changes to this script.
need to call random.uniform() even if its not used to give pradictable randomization.
2010-01-19 09:24:39 +00:00
Campbell Barton
849024df83 patch [#20724] Randomize Loc Rot Size py operator for B2.5
written from scratch by Daniel Salazar (zanqdo). added own modifications.

New property type
 bpy.props.FloatVectorProperty(), only difference with float is it takes a 'size' argument and optional 'default' sequence of floats.

moved bpy.props.* functions out of bpy_rna.c into their own C file.
2010-01-19 00:59:36 +00:00
Campbell Barton
3ff987c46a bugfix [#20688] Mesh with no materials fails to export UV layout 2010-01-15 12:21:33 +00:00
Campbell Barton
aed721e01c [#20685] Fixed: cleaned up descriptions, removed unrelated comments in code
from Jaevixa McNomera (jaevixa)
2010-01-15 10:02:02 +00:00
Matt Ebb
085795e356 Fix [#20514] In sculpting mode is possible to use page down/up to exceed the actual multiresolution level 2010-01-15 05:00:02 +00:00
Campbell Barton
6f8ee9b0f9 patch [#20673] Fixed descriptions in Torus mesh controls, and added some requested controls
from Jaevixa McNomera (jaevixa)
2010-01-14 22:45:56 +00:00
Campbell Barton
dd9b6cbddd uv layout svg files were not importing into inkscape or firefox (gimp worked) 2010-01-14 14:33:05 +00:00
Campbell Barton
f8518a9b26 UV layout
- set the width of the line to be 1 pixel
- add the object name onto the blendfile name.
2010-01-14 14:26:39 +00:00
Campbell Barton
231d29ccce Join as UVs.... (copies matching UVs to another object with the same topology)
nice that it uses foreach_get/set for fast array copying from python.

note: this is getting out of hand, we beed some central panel/interface for copying mesh data about - shapes, UVs weights etc. at the moment they are accessed from all different places.
2010-01-14 14:06:27 +00:00
Campbell Barton
27dc5be730 - when the image is available export the SVG with the pixel width and height, saves typing into the gimp each time.
- option to only export selected faces.
- add in some metadata from the scene
2010-01-13 19:53:34 +00:00
Campbell Barton
ef5ab2b8e9 UV Layout export, writes an SVG, uses material colors. 2010-01-13 19:00:18 +00:00
Campbell Barton
58f13d469e UV mirror tool (copies UVs from one side of the mesh to the other)
WIP, suffers from editmode bug where editmode python tools cant have redo-options set. and needs options for precission.
2010-01-13 17:58:26 +00:00
Campbell Barton
c723251cc0 rename rig types not to have generic in the name (Cessens decission) 2010-01-10 18:59:32 +00:00
Campbell Barton
08c9ecb3b0 RNA/Py API
change how data is added. eg.
 bpy.data.add_mesh(name) --> bpy.data.meshes.new(name)
 bpy.data.remove_lamp(lamp) --> bpy.data.lamps.remove(lamp)


image and texture stil use add_* funcs
2010-01-09 23:44:01 +00:00
Campbell Barton
a868e8623c - RNA support for returning copied strings from functions, flagging strings as PROP_THICK_WRAP does this.
- scene.render_data.frame_path(frame=num), returns the output path for rending images of video.
- scene.render_data.file_extension, readonly attribute, gives the extension ".jpg", ".mov" etc
- player support was guessing names, use the above functions to get the actual names used, accounting for #'s replacing numbers.
2010-01-08 13:52:38 +00:00
Campbell Barton
e292b5badc fix for crash when setting a shapekeys name in rna, (probably other properties too).
When the shapekey was returned from the object it didnt use the data's ID which is expected elsewhere in RNA.

Transfer shape now also sets the name.
2010-01-06 12:19:46 +00:00
Campbell Barton
bb2c074822 missing check for shape key 2010-01-06 11:21:57 +00:00
Campbell Barton
de7ee99674 WM_OT_context_set_* - more compact and check for the relative option without exception handling. 2010-01-04 08:24:24 +00:00
Matt Ebb
3881bb5309 Fix for previous commit - broke WM_OT_context_set_* operators for non float/int types. 2010-01-04 01:39:37 +00:00
Matt Ebb
1cbe3c06d6 * Added new hotkeys [ and ] to decrease/increase brush size by 20 in all paint modes.
The actual value to increment/decrement by can be customised in key maps.
2010-01-04 00:18:08 +00:00
Campbell Barton
9bda43ed27 - WM_OT_context_cycle_int wasnt working (also wasnt used anywhere)
- remove console zoom operator, use WM_OT_context_cycle_int instead.
- use WM_OT_context_cycle_int for text editor zoom also (Ctrl +/- and Ctrl+MouseWheel)
2010-01-03 02:24:53 +00:00
Campbell Barton
8177f343a0 - object.add_shape_key(name="Key", from_mix=True)
- ensure new shape key names are unique
- Transfer ShapeKey now can have its settings changes (redo operator)
2009-12-28 18:03:04 +00:00
Campbell Barton
351f5d1837 - loading missing files didnt give any warning
- shape key transfer poll function
2009-12-27 23:29:34 +00:00
Campbell Barton
0767cdd4a0 Transfer Shape Key
Useful if you have 2 different characters with the same base mesh (matching indicies), and want to copy a facial expression for eg, from one to another.
Durian request to re-use shapes between characters. 

* Copies the active shape to other selected objects
* Different methods to apply the shape
* * OFFSET, simple translation offset
* * RELATIVE (EDGE/FACE), Use Barycentric transformation to copy the shape. This means the target mesh can be a different orientation and scale and the shape should still apply since the surrounding geometry is used as a basis for the offset.

bug: barycentric transform's depth was inverted.

Note:
* This isnt added into a menu yet,
* This cant be redone since adding a shape key messes up the redo stack. needs fixing for other scripts too.
2009-12-27 11:14:06 +00:00
Campbell Barton
944a4f2a3f pep8 edits, removed MakeCursor.py and rna_array.py, not important to make pep8 2009-12-26 09:36:50 +00:00
Campbell Barton
5afd084513 replace dynamic_menu.py with Menu classmethods much less complicated.
access append/prepend eg.

bpy.types.INFO_MT_file_import.append(lambda self, context: self.layout.operator("import_some.format"))
2009-12-25 22:16:19 +00:00
Campbell Barton
693d9fd771 sphinx rna api documentation generator to replace epydocs
- view docs menu item opens sphinx URL
- can be searched (even when local)
- uses rna_info module for introspection
- also documents python defined functions and decorator properties (defined in bpy_types.py)
- experemental python file:line references for python operators.
2009-12-25 15:50:53 +00:00
Campbell Barton
5f4e24d599 operator draw function working again. needed to add layout to the operator to give access to "self.layout" - like panels, headers and manu's have 2009-12-24 21:17:14 +00:00
Campbell Barton
bbe13e7823 * register operators like other classes
* operators now return sets (converted into flags)
* can't remove bpy_operator_wrap.c since macro's still use the custom register funcs
2009-12-24 19:50:43 +00:00
Campbell Barton
bb094b8655 key shortcits for sculpt back
- T was 'Flatten Brush', now Shift+T
- added an option to OBJECT_OT_subdivision_set to set the level relatively (so page up/down works), however RNA lets it set one level higher then the maximum, this seems displays OK in the 3D view so not sure whats going on here (as if there is always an extra hidden multires level).
2009-12-23 12:13:48 +00:00
Campbell Barton
22a892f402 - make ToolSettings.mesh_selection_mode into an array of 3 bools rather then an enum since multiple can be set at once.
- ToolSettings had its id.data set to NULL when taken directly from the context (causing a crash in cases)
- menu for changing vert/edge/face selection now a python menu, removed operator.
- wm.context_set_value(), would really prefer not to have this since it evaluates the value as a python expression however there are no ways to define arrays in PyOperators
2009-12-22 16:11:11 +00:00
Campbell Barton
5bdcb2dff2 py error fix and minor changes to rna info class 2009-12-21 23:14:16 +00:00
Campbell Barton
de7ffa1bac make subsurf keys - Ctrl+1,2,3,4, apply to all selected objects. not just the active ones 2009-12-18 23:17:23 +00:00
Campbell Barton
0c813b2a0e autorigging front end, access in pose mode armature panel (at the bottom)
demo: http://download.blender.org/durian/metarig_demo.ogv
sintel base rig also, would like to include more generic/simple rigs eventually
2009-12-17 19:48:30 +00:00
Campbell Barton
c3b978828c pep8 corrections and no need to use C's _OT_ syntax when accessing operator names from py 2009-12-17 01:21:55 +00:00
Campbell Barton
bcb5f8ea12 Update 2.4x script: UV Follow active quads initial port thanks to Michael Williamson, added operator option, reporting, menu, edge length option myself. 2009-12-16 21:27:07 +00:00
Brecht Van Lommel
7b70ec6b9d Fix #20356: ctrl+1/2/.. could set multires levels outside limits. 2009-12-14 14:08:04 +00:00
Thomas Dinges
b2de6b93a6 * Custom Player:
-Added Windows Path for Blender 2.4 Player. (Tested on Windows Vista).
2009-12-14 04:58:29 +00:00
Matt Ebb
602f372f66 Fix for playing back movie files 2009-12-14 04:03:18 +00:00
Matt Ebb
07e5337615 Small fix for 'custom' anim player preset 2009-12-14 03:48:23 +00:00
Campbell Barton
a674f1a2cc use Ellipsis rather then a class defined for an unset value. (since None is valid) 2009-12-14 01:58:08 +00:00
Matt Ebb
3f612b6ea5 Description and more presets for animation players (rv / framecycler).
Also put a bit more logic for guessing player paths based on my system. 
If anyone can make this a bit more clever/bulletproof, please feel free to 
get involved in it, it's all python!
2009-12-13 23:30:18 +00:00
Campbell Barton
9f965ba62b pep8 warnings, remove unused imports 2009-12-13 22:48:11 +00:00
Campbell Barton
7fc4ab2aab add pep8 headers so these scripts spit out errors when running pep8.
made some changes but mostly these scripts will give pep8 warnings.
2009-12-13 14:38:30 +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
Martin Poirier
ab18fe02c4 expand path for external player 2009-12-11 16:01:47 +00:00
Brecht Van Lommel
3a9dcf1fea Sculpt Branch:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r25245:25315
2009-12-11 14:38:02 +00:00
Matt Ebb
7e7e1018ac Added back rendered animation playback (in a sense), with a
customisable player.

You can choose a player in User Preferences -> File Paths. You can 
choose a plan custom command line, otherwise there are presets available
for the Blender 2.4 player or DJV (where it will give it the correct filename, 
fps, etc on the command line). So for example if you have a Blender 2.4 
version installed, you can enter the path to the blender 2.4 executable, 
and the playback will work just like before.

Any info on other frame players (FrameCycler? pdplayer?) and their 
command line settings could be useful for adding some more presets too, 
if anyone knows of them.

It's available in Render->Play Rendered Animation (Ctrl F11)
2009-12-11 08:05:05 +00:00
Campbell Barton
9358af05d0 rename operators TFM_OT_* --> TRANSFORM_OT_* 2009-12-10 10:36:32 +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
Brecht Van Lommel
a321e2b139 Sculpt Branch:
Subdivision set with Ctrl+1-5 now works for multires as well.
2009-12-07 19:56:59 +00:00
Campbell Barton
764c4c94fa use sets rather then tuples for enum/flags so you can use bitfield operators 2009-12-07 02:20:55 +00:00
Campbell Barton
750764f411 rna flag PROP_ENUM_FLAG which makes rna props a tuple of enums when converted into a PyObject
only used by wm.invoke_props_popup() currently
2009-12-07 00:16:57 +00:00
Campbell Barton
5ebe54f470 pep8 edits and fix some warnings 2009-12-05 22:03:07 +00:00
Guillermo S. Romero
648122b1a2 String fix and a bunch of PEP8 issues I had collected in the meanwhile. 2009-12-04 17:54:48 +00:00
Campbell Barton
6372c63ae9 select pattern for bones 2009-12-01 14:48:36 +00:00
Campbell Barton
dc1af66d8a - grease pencil drawing on the surface of objects (only when enable face snap & projection, a bit hidden I know)
- retopo operator to convert grease pencil drawn topology into geometry, not in the convert menu yet since its not quite finished, use the operator search menu for retopo. will test this week and see what needs fixing.
2009-11-30 01:13:46 +00:00
Campbell Barton
36cbf42e5d Draw function for operators (just like panels), used for the redo popup, file selector and redo tool panel.
Used for ply export & select pattern.
2009-11-29 01:49:22 +00:00
Campbell Barton
8b897879cd pep8 cleanup in ui and op dirs, added popup to select pattern 2009-11-28 23:37:56 +00:00
Campbell Barton
a2b370dd6f py/rna api
- object.modifiers.add()/remove()
- armature.edit_bones.active wasnt named correctly
2009-11-28 13:33:56 +00:00
Thomas Dinges
22f49ffe71 * Small Cleanup. 2009-11-27 18:55:59 +00:00
Martin Poirier
20a2100a36 Add missing snap properties to transform operator.
This is used to force snap on and off when needed.

Also, when transform is not run modal, it will use default values for PET and snap properties (False) instead of scene settings. No need to force them off when calling transform with Exec.
2009-11-27 16:15:34 +00:00
Campbell Barton
994776811f edge loop delete was using snap, making it not actually delete the edge loop 2009-11-27 15:15:03 +00:00
Campbell Barton
c3937c93d5 minor changes made before commit broke this script 2009-11-26 16:05:32 +00:00
Campbell Barton
64f552356a ctrl 1-5 for changing subsurf levels 2009-11-26 15:36:23 +00:00
Campbell Barton
8e09171d5b temp hack to make the popup show wider when running the edit description operator 2009-11-23 00:56:19 +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
247f9cfc04 - add cloth button wasnt working because it was set to execute the operator.
- for adding an operator, start with a blank name and dont write the default one. (still writes each name you type in, will need to fix this properly)
- move the AddPresetBase class into presets.py since all the presets are defined there.
2009-11-22 13:15:21 +00:00
Campbell Barton
8b84cc2ab6 use context member rather then modifier name in presets 2009-11-22 11:33:44 +00:00
Thomas Dinges
02e99b9a43 * Minor cleanups.
* Added Cloth Presets. Patch by nudelZ. Thanks!
2009-11-22 10:32:37 +00:00
Campbell Barton
adb14a2247 remove template uiTemplate_view3d_select_faceselmenu 2009-11-22 10:02:32 +00:00
Campbell Barton
9e2ed89105 SSS presets, Thomas and I added these at the same time, however I meant to make this a more general system.
this commit shows how to add a preset using the base preset class and menu with minimal effort.
2009-11-22 00:22:29 +00:00
Campbell Barton
6db600dddc moving this file back, sorry for the noise 2009-11-22 00:18:43 +00:00
Campbell Barton
d46e83e1c5 looks like we both added sss at once :) , removing since Im using the base class and a single presets file 2009-11-22 00:17:36 +00:00
Thomas Dinges
4f6b95480f * Added Subsurface Scattering Presets.
Note: Add doesn't work, it writes some text into the file, not the values. (Maybe because the values are arrays?!)
Campbell, please check :)
2009-11-22 00:03:42 +00:00
Campbell Barton
1dfbf3a9f6 - aspectx wasnt saved in the render preset
- define a preset base class
- cleanup some comments and whitespace
2009-11-21 23:55:14 +00:00
Thomas Dinges
2351d1c4d3 * Some cleanup for recent preset commit.
* Minor align fix for Frame Rate Buttons.
2009-11-21 22:54:02 +00:00
Campbell Barton
5e7debcecf render presets, select from a directory, button to add own presets 2009-11-21 21:39:20 +00:00
Campbell Barton
3119eaf284 - dir() now works for collection functions
- group.objects.link/unlink use exceptions rather then return values
- scene.add_object/remove_object --> scene.objects.link/unlink
2009-11-20 10:00:54 +00:00
Campbell Barton
e61c90e416 operators were copying the properties from the rna operator into the class instance.
however this meant the invoke function could not modify properties for exec to use (unless it called exec directly after)
since the popup for eg would re-instance the python class each time.

now use the operator properties directly through rna without an automatic copy.

now an operator attribute is accessed like this...
self.path --> self.properties.path
2009-11-19 17:12:08 +00:00
Campbell Barton
966b01665b use number keys to set the current brush in paint modes 2009-11-17 16:04:17 +00:00
Campbell Barton
51f2dcd08c - access console languages as modules rather then having the py operator call an operator
- workaround for __getattr__ existing for types that dont support it
2009-11-17 12:21:41 +00:00
Campbell Barton
7636d17af6 property editor for bone and object ID props, add/remove/edit
good example of how editing NON rna data results in very weired scripts :/
2009-11-16 22:53:28 +00:00
Campbell Barton
c2624e1a4f fix for skinning uneven loops, fixed to use even edge removal currently 2009-11-13 19:18:17 +00:00
Campbell Barton
5a322bd67c F8 reload works again, script errors are printed but dont stop loading every other script 2009-11-13 11:10:29 +00:00
Campbell Barton
0750a8dc5c simple fix, still worked on my PC somehow 2009-11-09 09:16:16 +00:00
Campbell Barton
af011f33a6 use the cwd for the shell prompt, use subprocess.getstatusoutput rather then popen() 2009-11-08 12:35:37 +00:00
Campbell Barton
fac2ca1c7c bpy/rna api class feature
- python defined classes will be used when available (otherwise automaically generated metaclasses are made as before)
- use properties rather then functions for python defined rna class's
- call the classes getattr AFTER doing an RNA lookup, avoids setting and clearing exceptions for most attribute lookups, tested UI scripts are ~25% faster.
- extending rna py classes this way is a nicer alternative to modifying the generated metaclasses in place.

Example class

--- snip
class Object(bpy.types.ID):

    def _get_children(self):
        return [child for child in bpy.data.objects if child.parent == self]

    children = property(_get_children)
--- snip

The C initialization function looks in bpy_types.py for classes matching RNA structure names, using them when available.
This means all objects in python will be instances of these classes.
Python properties/funcs defined in ID py class will also be available for subclasses for eg. (Group Mesh etc)
2009-11-08 01:13:19 +00:00
Campbell Barton
30c4c4599d pedantic enum string consistancy 2009-11-07 22:12:03 +00:00
Campbell Barton
ddeb9f8e24 - added console language type
- separated python console from the interactive console
- added shell console type (simple example)
- console types are autodetected and can be selected in the menu
2009-11-06 23:53:40 +00:00
Campbell Barton
44db0b0e27 view docs was broken for operators - was getting the nested class string. 2009-11-05 19:31:38 +00:00
Campbell Barton
be4ceb5fdf Select interior faces, access from the mesh select menu
new mesh functions, remove duplicates in uvproject and mesh_skin
- face.edge_keys()
- edge.key()
- mesh.edge_face_count()
- mesh.edge_face_count_dict()
2009-11-05 12:37:49 +00:00
Campbell Barton
48bc52ea1b fix for editing docs 2009-11-05 10:02:14 +00:00
Campbell Barton
e6ea68a31c - missing return values
- more detailed exceptions (always give file:line incase the python exception doesnt)
- fix some errors in the edit docs

editing docs still fails, need to figure out why.
2009-11-04 22:36:46 +00:00
Campbell Barton
08bbda5005 - Stopping jobs on undo wasnt fixing undo/redo while with render previews as it was supposed to: needed WM_jobs_stop_all rather then WM_jobs_stop because it ends the thread rather then just setting 'stop'.
- gpl header + warning fix
2009-11-04 20:50:09 +00:00
Campbell Barton
3fa8959bb5 - move WM operators out of bpy_ops.py into their own file
- fix operator template
2009-11-04 20:21:08 +00:00
Campbell Barton
4033aba579 new operator directory, move some scripts from io 2009-11-04 14:40:35 +00:00