Age | Commit message (Collapse) | Author |
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
Plus a few splits of very long lines…
|
|
|
|
|
|
|
|
tested that correcting invalid meshes works by generating random meshes and checking that only the first call to mesh.validate() makes changes.
found 2 bugs in mesh validation.
- face sorting array wasn't assigned correct indices.
- removing invalid edges used wrong comparison.
|
|
for python so it can correct for bad imported geometry - mesh.validate().
|
|
funcs more easily.
|
|
by modifiers.
detects...
- invalid vertex range for edges/faces
- duplicate indices in edge/face
- duplicate edges/faces in mesh
- missing edges data in faces
At the moment it doesn't correct errors, but eventually it will do this.
|
|
- mesh.add_geometry(v, e, f) --> mesh.vertices.add(tot), mesh.edges.add(tot), mesh.faces.add(tot)
- mesh.add_material(mat) --> mesh.materials.link(mat)
changed material.link so it always adds a material even if it exists in the list, this behavior is good for users but not scripts since it can mess up indicies (some formats may have the same material set twice).
|
|
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)
|
|
|
|
|
|
|
|
bugs in RNA
from the report...
# bug 1. UV properties are not raw editable but are reported
# as RAW_TYPE_INT by RNA causing wrong conversion
# internally (bpy_rna.c line 2205)
# bug 2. raw update of UV coordinates crash blender (rna_access.c line 252)
mtfaces.foreach_set("uv", rawuvs)
# workaround:
#for i in range(int(len(faces)/4)):
# mtfaces[i].uv = uvs[i]
# bug 3. raw update of non-array property fails (rna_access.c line 2270)
mfaces.foreach_set("material_index", mats)
# workaround:
# for i in range(int(len(mfaces))):
# mfaces[i].material_index = mats[i]
# bug 4. It is not possible to add a vertex color layer using mesh API.
me.add_vertex_color()
# no workaround...
|
|
eg.
for v in me.verts: print(v.index)
added calc_edges as an option eg.
mesh.update(calc_edges=True)
This is needed when adding faces to an existing mesh which create new edges.
|
|
* Move mesh API functions to mesh_data.c, would like to keep
RNA layer fairly thin, any non-trivial functions shoud be
in their modules.
* Replace mesh.create_copy by generic id.copy.
* Fix #19250: Mesh.add_geometry() in editmode fails silently,
now gives an error.
|
|
|
|
* copied I/O scripts
* copied, modified rna_*_api.c and rna_*.c
I/O scripts not working yet due to slight BPY differences and RNA changes. Will fix them later.
Not merged changes:
* C unit testing integration, because it is clumsy
* scons cross-compiling, can be merged easily later
|
|
something wrong (`svn status` output: http://www.pasteall.org/7887).
The command: svn merge -r 23130:23129 https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-kazanbas
|
|
Next: update scripts and merge in 2.5.
|
|
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
|
|
|
|
- changing object.matrix now updates object.loc/rot/scale
- added bpy.data.add_lamp()
|
|
- tweaked OBJ importer. It reads primitive files (cube, cone, etc.)
|
|
|
|
- Mesh.calc_normals
- Object.add_vertex_to_group
- Main.add_material
- Main.add_texture
- Material.add_texture
- OBJ importer conversion in progress
|
|
- added Mesh.add_uv_layer, Object.add_vertex_group
|
|
|
|
* Mesh.add_geometry, Mesh.update and make indices editable. This
is without checking if they are valid still, no time now to
implement this.
* Also fix warnings in rna_ui.c, and a bug in CDDM_calc_edges.
Example code:
co = [0.0, 0.0, 0.0] + [1.0, 0.0, 0.0] + [0.0, 1.0, 0.0] + [1.0, 1.0, 0.0]
faces = [0, 1, 2, 0] + [1, 3, 2, 0]
mesh.add_geometry(4, 0, 2)
mesh.verts.foreach_set("co", co)
mesh.faces.foreach_set("verts", faces)
mesh.update()
|
|
Current issues:
- NURBS - needs API additions
- "all scenes" export - cannot switch scene in bpy
- normal calculation, disabled
- duplis - need testing, only dupliverts tested
- matrix problem
- UI, 18 options currently don't fit into filesel panel, will do manual lay out once it's available
- probably others...
BPY:
- made operator "execute" method required to avoid crash
- added bpy.sys module which replicates old "sys" module
API:
- replaced create_*_mesh with a single create_mesh accepting type parameter
- added Mesh.create_copy to create a copy of a mesh with 0 users
Ran `dos2unix` on source/blender/python/SConscript
|
|
* Main.remove_object
* Scene.add_object
* Scene.remove_object
* Object.convert_to_triface
* Object.create_preview_mesh
- a small tweak in set_mesh (blenkernel/inter/mesh.c) to make it work on objects having data == NULL
|
|
- fixed Object.create_dupli_list
- continuing OBJ exporter conversion
|
|
Merging changes made by Arystanbek in the soc-2009-kazanbas branch,
plus some things modified and added by me.
* The API files now all in the makesrna module, convention is to
call them e.g. rna_mesh_api.c for rna_mesh.c. Note for visual
studio build maintainers, the rna_*_api.c files are compiled as
part of "makesrna", but do not have rna_*_gen.c generated as part
of the library. SCons/cmake/make were updated.
* Added function flags FUNC_USE_CONTEXT and FUNC_USE_REPORTS, to
allow RNA functions to get context and error reporting parameters
optionally. Renamed FUNC_TYPESTATIC to FUNC_NO_SELF.
* RNA collections now have a pointer to add/remove FunctionRNA's, this
isn't actually used anywhere yet, purpose is to make an alias
main.meshes.add() for main.add_mesh() in python.
* Fixes to make autogenerating property set/get for multidimensional
arrays work, though a 4x4 matrix will be exposed as a length 16
one dimensional RNA array.
* Functions and properties added:
* Main.add_mesh()
* Main.remove_mesh()
* Object.matrix
* Object.create_render_mesh()
* WindowManager.add_fileselect()
|