Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Blender version 4.3 #267

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions blender/osci_render/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,30 @@ def get_frame_info():
frame_info = {"objects": []}

for obj in bpy.data.objects:
if obj.visible_get() and obj.type == 'GPENCIL':
object_info = {"name": obj.name}
strokes = obj.data.layers.active.frames.data.active_frame.strokes
object_info["vertices"] = []
for stroke in strokes:
object_info["vertices"].append([{
"x": vert.co[0],
"y": vert.co[1],
"z": vert.co[2],
} for vert in stroke.points])

frame_info["objects"].append(append_matrix(object_info, obj))
if obj.visible_get():
if (4, 3, 0) >= bpy.app.version and obj.type == 'GREASEPENCIL':
object_info = {"name": obj.name}
strokes = obj.data.layers.active.frames.data.current_frame().drawing.strokes
object_info["vertices"] = []
for stroke in strokes:
object_info["vertices"].append([{
"x": vert.position.x,
"y": vert.position.y,
"z": vert.position.z,
} for vert in stroke.points])
frame_info["objects"].append(append_matrix(object_info, obj))

elif (4, 3, 0) < bpy.app.version and obj.type == 'GPENCIL':
object_info = {"name": obj.name}
strokes = obj.data.layers.active.frames.data.active_frame.strokes
object_info["vertices"] = []
for stroke in strokes:
object_info["vertices"].append([{
"x": vert.co[0],
"y": vert.co[1],
"z": vert.co[2],
} for vert in stroke.points])
frame_info["objects"].append(append_matrix(object_info, obj))

frame_info["focalLength"] = -0.05 * bpy.data.cameras[0].lens

Expand Down