bcongdon / bpy_lambda

🎥 A compiled binary of Blender-as-a-Python-Module (bpy) for use in AWS Lambda
MIT License
66 stars 22 forks source link

problem on module initialization #4

Closed ihsanmutlu closed 6 years ago

ihsanmutlu commented 6 years ago

Hi and thanks for this project. It saved great amount of time for me. My issue is, after updating to 1.1 version I began to get "module initialization error: libopenjpeg.so.2: cannot open shared object file: No such file or directory" on lambda. The file is there. Am I doing something wrong??

bcongdon commented 6 years ago

I'll take a look at this 🙂

bcongdon commented 6 years ago

I think there was an error in the order by which bpy_lambda was loading in shared object files. Should be fixed now.

If you update to version 1.2, this error should go away.

ihsanmutlu commented 6 years ago

Hi. I have tried the new version and it works great but have you emptied some scripts because remesh modifier throws no error but it doesn't work either.

bcongdon commented 6 years ago

Hmm... I didn't change the build process. Can you provide an error trace or a minimal example of what isn't working?

ihsanmutlu commented 6 years ago

No errors. Log says imports and exports just fine. Other parts do their job but model isn't remeshed. Here is a link to singled out remesh script. dene.zip

ihsanmutlu commented 6 years ago

or let me just copy the code `import os import boto3 import json from bpy_lambda import bpy import mathutils from mathutils import Vector import addon_utils

s3_client = boto3.client('s3') bucketname = 'buckethead' def remeshModifier(mainobj): bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') bpy.context.scene.objects.active = mainobj mod = mainobj.modifiers.new(name='Remesh', type='REMESH') mod.octree_depth = 8 mod.mode = 'SMOOTH' mod.scale = 0.90 bpy.context.scene.objects.active = mainobj bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Remesh")

def lambda_handler(event, context): objName = 'justarm.obj' s3_client.download_file(bucketname, objName, '/tmp/' + objName) bpy.ops.import_scene.obj(filepath='/tmp/' + objName)

os.remove('/tmp/' + objName)

#addon_utils.enable("mesh_mesh_align_plus")
allobj = bpy.context.selected_objects
setOrigin(allobj)
parcalar = [obj for obj in bpy.context.scene.objects if obj.name.startswith("parca_")]
if len(parcalar) != 0:
    joinAll(parcalar)

mainobj = bpy.data.objects["polySurface2_Arms:Arms"]
remeshModifier(mainobj)
bpy.ops.export_scene.obj(filepath='/tmp/' + objName, use_selection=False, use_uvs=False, use_materials=False, use_triangles=True, use_normals=False ) 
data = open('/tmp/' + objName , 'rb')
s3_client.put_object(Body=data, Bucket=bucketname, Key=objName)`
bcongdon commented 6 years ago

Sorry, I don't really know what the error could be. Nothing (that I know of) changed in the build package, other than perhaps a newer version of blender was pulled.

Between versions 1.0 and 1.1, Blender was updated from 2.78 to 2.79. Version 1.2 also uses 2.79, so perhaps there's some discrepancy there.

ihsanmutlu commented 6 years ago

I have been trying to see if I made a mistake in my codes but in both versions (1.0 and 1.2) remesh isn't working. Other modifiers are working just fine though. If I find the problem, I will write it down here. Thanks for your time.