ddg.blender clean up
Cleanup of ddg.visualization.blender.utils
:
Always check and complete docstrings, and check tests.
General conventions
- light, camera, mesh, ... (not bmesh) should by default create (or act on) blender objects (which contain the light, camera, mesh data). use
wrap_in_object=True
as corresponding argument - add documentation for modules
- make clear that specific object modules like light, camera, mesh, include functions working on objects with the respective data or the data itself.
object.py
includes functionalities for all blender objects regardless what data they are carrying.
- make clear that specific object modules like light, camera, mesh, include functions working on objects with the respective data or the data itself.
- Blender object arguments should be called
bobj
everywhere - review docstrings for our conventions
Individual Tasks
-
bmesh
: @do- rename
create_from_pydata
->from_pydata
!421 (merged) - add/complete documentation for:
from_pydata
,bisect_plane
,cut_between_coordinate_planes
,cut_bounding_box
!429 (merged) - delete:
create_curve
,create_quad_mesh
,create_torus
,create_cone
,create_cylinder
,create_cylinder_between_points
,create_icosphere
,create_disc
,create_circle
!420 (merged)- all instances in which they are used should be replaced by internal geometry objects creation
- rename
-
camera
: @tyburn-
add_camera
->camera
; complete docstring !406 (merged) -
look_at_point
is alias, documentation should refer to original instead of duplicate text !406 (merged)
-
-
clear
: @choukri-
clear_xxx
->xxx
-
clear_empty_objects
->empty
-
-
collection
: @prasetya-
children_recursive
can completely be removed. Where it is used it can be replaced by the blender internal collection attributeCollection.children_recursive
. !406 (merged)
-
-
light
: @tyburn-
add_light
->light
!404 (merged) -
look_at_point
is alias, documentation should refer to original instead of duplicate text !404 (merged)
-
-
mesh
: @do- all mesh creation function, e.g.
from_bmesh
should create mesh objects (and optionally only the mesh data) -
add_xxx
andcreate_xxx
should be deleted !420 (merged) -
select_xxx
functions exists on mesh and mesh object basis. they should be joined and optionally work on mesh and mesh object !555 (merged) and !556 (merged) - in
duplicate_by_properties
andduplicate_by_transformation_matrices
: rename argumentunlink_initial_object
->unlink_original
and add to docstring - unify object and mesh argument names: blender object:
bobj
, mesh:mesh
, bmesh:bm
-
transform
should also work on blender objects (use decorator) !531 (merged) -
join
should work on meshes (and on blender objects by decoration), removeparent
andmatrix
attributes !531 (merged) -
connected_compontents
should work on meshes (+ decorator); add warning to docstring: uses bpy operator !547 (merged) -
shade_smooth
should work on meshes (+decorator); should this fail for other data? !531 (merged) -
intersection_curve
: should work on meshe (+decorator); add warning to docstring: uses bpy operator;name=None
, needs tests for empty intersection, intersection with multiple connected components, ideally rewrite to avoidbpy.ops
!547 (merged) -
select_
functions: there should only be select functions that work on mesh objects (+decorator that might have to use bpy operators in this case); !555 (merged) and !556 (merged) - remove
selected_vertices_of_active_object
!556 (merged)
- all mesh creation function, e.g.
-
object
: @hoekstra !466 (merged)-
wrap_in_object
andadd_in_object
should be joined tofrom_data
!408 (merged) -
delete
andcopy
need docstring -
add_joined
->mesh.join
and docstring -
add_connected_components
->mesh.connected_components
and docstring -
selected_vertices_of_active_object
->mesh
and docstring -
add_intersection_curve
->mesh.intersection_curve
-
matrix_to_obj_trafo
missing Return value in docstring -
create_duplicate_linked
->mesh
- module docstring: remove explanation on
create_
vsadd_
-
from_data
in docstring replace "mesh" by "data" - remove
add_joined
,add_connected_components
,selected_vertices_of_active_object
- rename
matrix_to_obj_trafo
->matrix_world_transformation_function
and argumentm
->matrix
- rename
set_bobj_prop
->set_prop
-
look_at_point
: argumentsobj
->bobj
, in docstring "camera"->"object" - remove everythin below
look_at_point
exceptmove_to_layer
and_root
-
move_to_layer
: rename argumentob
->bobj
- rename
_root
->empty
-
-
review compliance with conventions: @rancic - unify attribute names: bobj, mesh, ...
- decorators to wrap in blender objects (see
mesh
module)