Commit Graph

47 Commits

Author SHA1 Message Date
Campbell Barton
2be3a334e2 fix [#26257] Colored UV-Map on export
- EPS now exports material colors and face fill doesn't overwrite edges (draw in 2 passes).
- added opacity option for EPS/SVG/PNG
2011-03-01 17:22:27 +00:00
Campbell Barton
fc0c016940 replace import *'s with named imports (using * is convenient for some scripts but considered bad practice by python devs) 2011-02-27 15:25:24 +00:00
Campbell Barton
4612034cf4 patch [#25809] Auto-Registration as utility function.
This removes auto-registration, committed by Martin r30961.
Realize this is a contentious topic but Brecht and myself both would rather opt-in registration.

TODO:
- addons need updating.
- class list will be modified to use weakrefs (should have been done for existing system too).
- will move bpy.types.(un)register functions into bpy.utils.(un)register_class, currently including these functions in a type list is internally ugly, scripts which loop over types also need to check for these.
2011-02-10 23:48:22 +00:00
Campbell Barton
7f3fe8a2df pep8 cleanup 2011-01-01 07:20:34 +00:00
Campbell Barton
1622385445 pedantic word ordering change.
- wm.add_modal_handler -> modal_handler_add
- wm.add_fileselect -> fileselect_add
- ob.add_shape_key -> shape_key_add
- VIEW3D_OT_add_background_image -> VIEW3D_OT_background_image_add (same for remove)

Also made 2 internal cmake vars hidden.
2010-12-08 11:42:11 +00:00
Campbell Barton
2692dc5561 bugfix [#25082] minor bug. RGB to Intensity doesn't works for Lamps
- This is working correctly but confusing, made more confusing by UI problems, corrected these and updated tooltop for 'tex.use_rgb_to_intensity'
- bad RNA arguments used for lamps (left over from RNA renaming).
- use isinstance(...), rather then comparing type() directly, this failed with lamp type checks.
- removed redundant argument to internal texture UI function factor_but().
- the texture color was drawn inactive when it was used in some cases.

Note. AFAIK its not possible to do a general check to see if a texture is colored or not, eg: its possible a plugin texture returns color in some cases and greyscale in others.
so for now always have color button active.
2010-12-08 05:51:16 +00:00
Campbell Barton
6b4e7e8def bugfix "Export UV Layout" stalls when saving file in 2.55b
remove duplicate UVs on export to avoid long ztransp filling times - common on faces which have no assigned UV coords.
2010-11-28 13:39:39 +00:00
Campbell Barton
cf3d6d63ee bugfix [#24462] UV Layouts saved as PNG results in two files (rename bug)
renaming failed in some cases, now we can just render to a file.
2010-11-16 14:45:27 +00:00
Campbell Barton
92ee3658d3 UV Layout Export was missing UV Layer check. 2010-11-16 12:54:44 +00:00
Campbell Barton
f4415ce84a - CMake now only uses SOURCE_GROUP with MSVC lib configuration, saves recursive header search when not using msvc.
- uv layout export wasn't setting the default filename.
2010-10-23 04:18:53 +00:00
Campbell Barton
e41ef09563 change to Nathan's fix which also works with empty material slots. 2010-10-22 12:35:31 +00:00
Nathan Letwory
7b573e0f26 Export UV Layout to PNG would fail if original mesh didn't have materials assigned.
Reported in #blender.fi by Mats Holmberg
2010-10-22 11:51:10 +00:00
Campbell Barton
9f81104b29 patch [#24251] Add missing tooltips for image operatios
from Sergej Reich (sergof), with minor edits.
2010-10-15 08:41:58 +00:00
Campbell Barton
5452f335d7 New optional operator function, check(), it takes the same arguments as execute().
This runs after changing a property and allows correcting incompatible options.
 Returning True will redraw the UI.

Currently this is used for setting the write extension when saving files, so changing the image format also corrects the extension.
The same is accessible from python where its used when saving SVG/EPS/PNG files.

This fixes: [#23828] obj export problems, [#23760] Exporting OBJ and filetype ending
also fixed document submission operator.


Now the filename in the file selector is the one used for writing this means we remove the "Save Over" popup which could be overlooked too easily.
Instead display the filename field with red tint, and a note in the tooltip.
2010-09-17 09:27:31 +00:00
Campbell Barton
38669bd5fd - added PNG image export option to UV layout (was only SVG and EPS which was annotying for some users)
- support for non utf8 paths when exporting UV layout.
2010-09-11 10:31:50 +00:00
Campbell Barton
111965478a replace self.properties.foo --> self.foo 2010-09-09 18:03:57 +00:00
Campbell Barton
115b256738 ran through pep8 checker 2010-09-07 15:17:42 +00:00
Campbell Barton
ddbfb05c84 rna context rename
* context.main & bpy.types.Main --> context.blend_data & bpy.types.BlendData
* context.manager --> context.window_manager
2010-09-02 04:53:05 +00:00
Campbell Barton
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
Campbell Barton
3bd039eff9 apply rna rename most of the show_*, names. 2010-08-17 17:03:52 +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
30d180ff0d bugfix [#23194] export UVs miss the extension file
also made all other exporters do this.

Made some internal changes.
- moved path functions from bpy.utils to bpy.path (similar to os.path)
- added functions...
  bpy.path.ensure_ext(path, ".ext", case_sensitive=False) # simple function to ensure the extension is set.
  bpy.path.resolve_ncase(path) # useful for importing scenes made on windows where the path case doesnt match the files.
2010-08-06 01:40:54 +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
02da5ecfed Apply first pass of edits to rna values from rna_booleans.txt.
These are not animated and are best not change names like this too late in the release.

ActionGroup.selected -> select:    boolean    Action Group is selected
BezierSplinePoint.hidden -> hide:    boolean    Visibility status
BezierSplinePoint.selected_control_point -> select_control_point:    boolean    Control point selection status
BezierSplinePoint.selected_handle1 -> select_left_handle:    boolean    Handle 1 selection status
BezierSplinePoint.selected_handle2 -> select_right_handle:    boolean    Handle 2 selection status
Bone.restrict_select -> hide_select:    boolean    Bone is able to be selected
Bone.selected -> select:    boolean
CurveMapPoint.selected -> select:    boolean    Selection state of the curve point
EditBone.restrict_select -> hide_select:    boolean    Bone is able to be selected
EditBone.selected -> select:    boolean
EditBone.selected_head -> select_head:    boolean
EditBone.selected_tail -> select_tail:    boolean
EditBone.locked -> lock:    boolean    Bone is not able to be transformed when in Edit Mode
EditBone.hidden -> hide:    boolean    Bone is not visible when in Edit Mode
NEGATE * FCurve.disabled -> enabled:    boolean    F-Curve could not be evaluated in past, so should be skipped when evaluating
FCurve.locked -> lock:    boolean    F-Curve's settings cannot be edited
FCurve.muted -> mute:    boolean    F-Curve is not evaluated
FCurve.selected -> select:    boolean    F-Curve is selected for editing
NEGATE * FCurve.visible -> hide:    boolean    F-Curve and its keyframes are shown in the Graph Editor graphs
FCurveSample.selected -> select:    boolean    Selection status
GPencilFrame.selected -> select:    boolean    Frame is selected for editing in the DopeSheet
GPencilLayer.locked -> lock:    boolean    Protect layer from further editing and/or frame changes
GPencilLayer.selected -> select:    boolean    Layer is selected for editing in the DopeSheet
Keyframe.selected -> select:    boolean    Control point selection status
Keyframe.selected_handle1 -> select_left_handle:    boolean    Handle 1 selection status
Keyframe.selected_handle2 -> select_right_handle:    boolean    Handle 2 selection status
MeshEdge.selected -> select:    boolean
MeshEdge.hidden -> hide:    boolean
MeshFace.hidden -> hide:    boolean
MeshFace.selected -> select:    boolean
MeshVertex.hidden -> hide:    boolean
MeshVertex.selected -> select:    boolean
MotionPathVert.selected -> select:    boolean    Path point is selected for editing
NlaStrip.selected -> select:    boolean    NLA Strip is selected
NlaTrack.locked -> lock:    boolean    NLA Track is locked
NlaTrack.muted -> mute:    boolean    NLA Track is not evaluated
NlaTrack.selected -> select:    boolean    NLA Track is selected
Object.restrict_render -> hide_render:    boolean    Restrict renderability
Object.restrict_select -> hide_select:    boolean    Restrict selection in the viewport
Object.restrict_view -> hide:    boolean    Restrict visibility in the viewport
Object.selected -> select:    boolean    Object selection state
ObjectBase.selected -> select:    boolean    Object base selection state
PoseBone.selected -> select:    boolean
Sequence.right_handle_selected -> select_right_handle:    boolean
Sequence.selected -> select:    boolean
SplinePoint.selected -> select_control_point:    boolean    Selection status
TimelineMarker.selected -> select:    boolean    Marker selection state
Sequence.left_handle_selected -> select_left_handle:    boolean
ActionGroup.locked -> lock:    boolean    Action Group is locked
Bone.hidden -> hide:    boolean    Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)
SplinePoint.hidden -> hide:    boolean    Visibility status
FModifier.muted -> mute:    boolean    F-Curve Modifier will not be evaluated

 note: rebaned uv_select to select_uv
2010-07-15 16:56:04 +00:00
Campbell Barton
80355fd456 bugfix [#22843] Cannot export to folder with ".blend" on the end. 2010-07-14 11:58:19 +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
Campbell Barton
1028284301 pep8, whitespace edits 2010-06-09 19:12:03 +00:00
Campbell Barton
9cbbc9d3af rename some rna properties filename --> filepath
* filename == "foo.ext"
 * filepath == "/path/to/and/including/foo.ext"

this was alredy followed in some places not not everywhere.
2010-06-02 17:58:28 +00:00
Campbell Barton
a368bdad8d [#22391] Fix for eps-export of UVs
patch from Marc Fontaine (cubbie)
2010-05-23 06:00:08 +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
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
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
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
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
039d087171 subtype support for properties in bpy.props. 2010-02-01 22:04:33 +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
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
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
3ff987c46a bugfix [#20688] Mesh with no materials fails to export UV layout 2010-01-15 12:21:33 +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
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