Skip to content

Commit

Permalink
python: Add initial scene & mesh wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
vkoskiv committed Dec 6, 2023
1 parent ef121e5 commit 0fb102e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions wrappers/c_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,27 @@ def _get_hash(self):

version = _version()

class mesh:
def __init__(self, scene_ptr, mesh_idx):
self.scene_ptr = scene_ptr
self.mesh_idx = mesh_idx

def bind_faces(self, faces, face_count):
_lib.mesh_bind_faces(self.scene_ptr, self.mesh_idx, faces, face_count)

class scene:
def __init__(self, s_ptr):
self.obj_ptr = s_ptr
def close(self):
del(self.obj_ptr)

def totals():
return _lib.scene_totals(self.obj_ptr)
def mesh_new(self, name):
self.name = name
return mesh(self.obj_ptr, _lib.scene_mesh_new(self.obj_ptr, self.name))


class renderer:
def __init__(self):
self.obj_ptr = _lib.new_renderer()
Expand All @@ -180,6 +201,9 @@ def __init__(self):
def close(self):
del(self.obj_ptr)

def scene_get(self):
return scene(_lib.renderer_scene_get(self.obj_ptr))

@classmethod
def from_param(cls, param):
if not isinstance(param, cls):
Expand Down

0 comments on commit 0fb102e

Please sign in to comment.