Commit Graph

158 Commits

Author SHA1 Message Date
19c09fe0da -> Fix for Mesh Properties Python API
When switching Mesh properties over to METH_O from METH_VARARGS certain method definitions
didn't get switched over correctly, causing calls to mesh property functions to fail.
2007-09-11 20:58:00 +00:00
0bd32f3ac6 Changes to "Face Select" mode
* Does not indicate that UV's exist, nor does it add UV's when used.
* Only accessible for texturepaint, vertexpaint and weightpaint from a button in the header (Paint Selection Mask)
* Not accessible from the mode menu, this is only an option that applies to paint modes.

This dosnt effect DNA, face select (G_FACESELECT) can be enabled at any time but is only used when paint modes are enabled.

Other changes
* UKey is uv unwrap in editmode, Ukey for undo was editmode only anyway.
* UVCalc in editmode adds a UV Layer if there is not one alredy.
* texture draw in editmode does not draw the face dots (they are get in the way of texturing)
* some missing updates were added.
* removed manipulator from when paint modes are enabled since the manipulator is not drawn in the 3d view.
2007-09-10 19:32:44 +00:00
7b0098bd04 getting the mesh for all curves/surfs/text raised an error every time because it was checking the wrong object was converted to a mesh. might be own fault. 2007-08-27 20:05:05 +00:00
e8c39a5864 added face sorting to mesh so you can do mesh.faces.sort(...)
uses list sorting internally so is exactly the same as list sorting.
2007-08-20 10:08:59 +00:00
9776f489e6 Mesh.c - getVertFromGroup ~25% speedup.
export_fbx.py - initial support for bones applied to weighted meshes.
2007-08-09 13:34:44 +00:00
Ken Hughes
229e4674f8 Python API
----------

Fix uninitialized variable in MEdge_setSel.
2007-07-12 15:32:15 +00:00
bfb9603cb4 From stable
Revision: 11237
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11237
Author:   campbellbarton
Date:     2007-07-12 13:05:31 +0200 (Thu, 12 Jul 2007)

Log Message:
-----------
PyObject_IsTrue was missing a check for an error return value in many cases.
2007-07-12 11:51:21 +00:00
39e4dc6202 replace PyInt_CheckExact with PyInt_Check, same for floats and strings so subclass and C/subtypes work.
was reported as a bug a while ago.
2007-07-01 05:41:23 +00:00
7b05c1023d mixed decloration, own Lattice typo's 2007-06-30 00:00:04 +00:00
d31999767b same as 2.44 stable - missing NULL checks. 2007-06-29 13:46:15 +00:00
e192e7e024 remove unneeded checks from the python API 2007-06-29 08:59:26 +00:00
85bbc4c3e2 Mesh.c - added missing error checking for vert ranges and that verts are valid.
Mesh.c - removed unneeded checks for creating ints.
Text3d.c - own error - setting the 3d text didnt work, 1 liner fix.
2007-06-28 13:46:42 +00:00
39a526a963 Python PyMethodDef supports single argument methods (METH_O) but was using METH_VARARGS everywhere and getting the single args from the tuple.
Use METH_O where applicable.
2007-06-16 12:24:41 +00:00
ba958bea0f -> Custom Properties for Mesh entities
In order to give import/export script authors the ability to add properties
to inidividual faces, vertices and edges in the same manner as they are able
to do with ID structures three new custom data types have been added to blender
for floats, integers and strings.

Things to note:

-Since property Layers are custom data, they are added to all verts, edges 
 or faces at once.
-Only one property layer for each unique property name may exist. In  other 
 words, you cannot have a float layer as well as an integer layer
 both with the same name.
-No user interface for this exists at the moment.

The following methods and attributes have been added to the Blender.Mesh
Python module and it's object types:

->MVert/Edge/FaceSeq:
	addPropertyLayer(name, type)
	removePropertyLayer(name)
	renamePropertyLayer(original name, new name)
	properties(readonly list.)

->MVert/Edge/Face
	getProperty(name)
	setProperty(name, value)

->Mesh module
	PropertyTypes (readonly dictionary)
2007-06-04 19:18:19 +00:00
f579a66d7b made change to NMesh decrefing suggested by theeth, and added 2 more missing decrefs in new_NMFace 2007-06-02 02:02:33 +00:00
228e927c04 pointInside wasnt working properly (did work with the examples I was using with many small faces) 2007-06-02 00:31:20 +00:00
a8bc1f3397 fix for a crash in Blender.Mesh,
getting curve data from an object failed (with only 1 curve vertex)
Blender.Mesh didnt check this and crashed.
2007-05-28 16:49:48 +00:00
bcc3143119 more memory leak fixes, though only a few are likely to happen 2007-05-27 21:33:48 +00:00
deffce3c19 Key.c/h - Removed unneeded functions. and ipo in struct wasnt being used.
Lattice.c - removed warning
Mesh.c - (own error) when running me.update(key="...") didnt update the right keyframe.

mesh_cleanup.py - Bugfix from a report by plumiferos that started uncovering all the memory leaks.
Removing NAN verts didnt work with mesh keyframes.
2007-05-26 12:58:46 +00:00
f231bd0d57 Many long standing memory leaks fixed in the BPY api.
Data from Armature.c and logic.c still leaks.

Mostly todo with PyList_Append adding a refcount and the bpython api not decrefing.

Also added some features needed to fix a bug in mesh_clean.py (ob.pinShape and ob.activeShape)
2007-05-25 16:43:25 +00:00
d7235265fe PyAPI, Mesh.c - added renderColorLayer and renderUVLayer to the mesh
buttons_editing.c - use icons for mesh viewport layer/render layer
2007-05-02 00:49:41 +00:00
29932487c4 Fix for bug #6461:
quadToTriangle() crash, was a missing depsgraph update.
2007-04-15 15:33:17 +00:00
985fb03478 * Changed mesh so all new data is selected (fits in with blender's UI and other areas of Python API), this could break existing scripts that count on new data being unselected (unlikely)
* Added a keyword argument to mesh.transform() - "selected_only" so you can transform the selected verts. this wont break existing scripts.
* Documented these changes in epydocs.
* used these functions in BPyAddMesh
2007-04-05 07:45:11 +00:00
afdd54fa37 moved source and text to american spelling
* colour -> color
* centre -> center
* normalise -> normalize
* modelling -> modeling
2007-04-04 13:18:41 +00:00
c97be098f7 Python API
made all libdata hashable - use the object type,name and lib for the hash.
added .tag to libdata so we can test if data's been processed without using dictionaries
added libdataseq.tag (write only) setting the tag flag (which can always be dirty)
2007-03-26 02:10:24 +00:00
52e43441d1 removed unneeded dealloc functions 2007-03-15 01:47:53 +00:00
ee5dc4d0bf removed duplicate functionality, macro's and functions existed to check a PyObjects type, now only use macro's 2007-03-15 01:09:14 +00:00
5c5a80f644 made all python types that can do .__copy__(), also do .copy()
added copy function to lamp, texture and ipo types
2007-03-14 03:01:24 +00:00
ffd91ac726 Fix for bug #6127:
Import scripts could create meshes with old style edgecodes.
2007-03-12 00:30:46 +00:00
Ken Hughes
d60b05254d Remove gcc compiler warnings from various files. 2007-03-11 17:31:27 +00:00
e0c77c0f14 made all data adding functions accept a name such as add_mesh or add_curve, previously only some datatypes adding functions accepted a name.
also updated the Bpy.py epydocs
2007-03-11 16:25:17 +00:00
1135434ed1 moved python functions that deal with blender libdata into gen_library.c from gen_utils and BPY_interface
small cleanup, removed unused functions and explicetly cast pointers..
2007-03-11 04:05:45 +00:00
5eaf9f90c1 BPython API
added a function - GenericLib_assignData for assigning blender data, to assign an ipo to a camera or world to a scene for instance.
Using this function removed ~300 lines of code.
also fixes user count error in some places that didnt check.

also made it possible to clear the colorband by setting it to []
2007-03-08 14:37:34 +00:00
4bd5ab628b == Multires ==
Fixed bug #6153, Blender Crash during rendering (internal) with object selected in edit mode.

* Added a render parameter to several of multires's functions. If render==true, multires won't push data onto the undo stack, and regular Mesh data is always used (as opposed to EditMesh data.)
2007-03-08 05:54:39 +00:00
37c7d4d385 Type header_seq.c - Reassing Inputs -> Reassign Inputs
Mesh.c added new function to mesh - mesh.pointInside(vec)
2007-03-07 08:53:26 +00:00
Ken Hughes
e85228cfd9 Python API
----------
Bugfix #6166: Mesh.getFromObject() didn't accept three parameters.
2007-03-06 18:35:03 +00:00
436e1697fd made attributes (name, property, users, fakeUser, lib) into functions all python types can use.
removed a lot of code duplication when moving to this.
Also removed unused functions GetMaterialByName(), same for Mesh, Object, World etc.
2007-02-25 07:36:50 +00:00
086d51c822 BPython API
* Added data.lib attributes to almost all data types, (except for Text3d and NLA)
  This is None or the path of the library as a string.
* Main was giving a warning, Include Curve.h rather then CurNurb.h
* Added Library.LinkedLibs(), returns a list of externaly linked libs.
2007-02-23 14:51:20 +00:00
b90a0ce285 Made multires and shape keys throw errors when adding if the other existed (so both can never coexist) documented this too. 2007-02-11 02:21:26 +00:00
b3e6a6a9c1 animation_trajectory - was printing deprecation warnings. cleaned up some of its code too.
Mesh - removing UV or Color layers didnt check if the active object was in vpaint of uv mode, removing the last layer could crash blender - now switch to object mode if its the last layer like the UI.
2007-02-07 07:43:10 +00:00
907d19b93d made Mesh.Get('foo') raise an error when foo dosnt exist rather then returning None (to work like other modules)
also update Metaball.Get() to be less messy - still functions the same.
2007-01-28 04:58:22 +00:00
235ad674c8 made mesh.getFromObject also get the meshes smoothing value when copied from another mesh object. 2007-01-11 09:15:31 +00:00
9afe662c12 renameing datablocks was imposing a name limit on the python side.
This isnt needed because the limit is alredy being set by rename_id()
some other minor changed- use None returning maro
2006-12-27 05:04:20 +00:00
2a9fab55ba PyAPI driverExpression:
added "ipocurve.driver = 2" to set the curve to use driver python expressions.
added ipocurve.driverExpression - the string to run.
2006-12-25 10:44:28 +00:00
c5de881413 added CustomData_add_layer_named, same as CustomData_add_layer but accepts a name. saves Mesh.c having to look up the data after adding (just to rename it) 2006-12-24 11:15:54 +00:00
1be58e7a8d initial python support for dealing with multires meshes.
Can only change levels and values at the moment. adding and removing is still needed.

multires: bool
multiresLevelCount: int
multiresDrawLevel: int
multiresEdgeLevel: int
multiresPinLevel: int
multiresRenderLevel: int
2006-12-24 10:51:31 +00:00
1c6f41a27a Added CustomData_get_named_layer_index to customdata to get a layer index by name, only used in Mesh.c at the moment.
cleanup Mesh.c, updated the epydocs
2006-12-23 23:33:03 +00:00
bef18061ec Select Grouped editdata- minor fix in the menu.
Updated Python Mesh API to support UV and Color layers with names.
Similar to vertex group's

renamed a function in customdata.c CustomData_free_layers -> CustomData_free_layers_active and made CustomData_free_layers accept an index, this is needed so python could free layers that arnt active.
2006-12-23 17:07:02 +00:00
30cc7499c3 setting/getting mcol by index was flipping red/blue. works now. 2006-12-22 22:57:05 +00:00
Ken Hughes
5329e0d035 Python API
----------
Silence gcc warnings in Mesh API code.
2006-12-21 16:05:43 +00:00