Skip to content

Update for new versions of blender #1

Description

@OpenFoam-User

Hello,
I've tried this script on Ubuntu 20.04 using blender 2.90 but unfortunately it fails because it seems that the API was changed maybe starting from 2.80
I'm not familiar with blender, I've followed this webpage to modify the script but it still report some errors (See below).

$ blender -b -P GIFandSpriteFromModel.py -- --inm 'tree.obj'

I get:

Blender 2.90.0 (hash 0330d1af29c0 built 2020-08-31 11:54:54)
/run/user/1000/snap.blender/gvfs/ non-existent directory
found bundled python: /snap/blender/45/2.90/python
tree.obj

 Clearing blender scene (default garbage...)
Info: Deleted 1 object(s)
Info: Deleted 1 object(s)
(  0.0000 sec |   0.0000 sec) Importing OBJ 'tree.obj'...
  (  0.0001 sec |   0.0000 sec) Parsing OBJ file...
    (  0.0112 sec |   0.0111 sec) Done, loading materials and images...
ProgressMaterial not found MTL: './tree.obj.mtl'
    (  0.0122 sec |   0.0121 sec) Done, building geometries (verts:415 faces:760 materials: 1 smoothgroups:0) ...
    (  0.0208 sec |   0.0207 sec) Done.
  (  0.0209 sec |   0.0209 sec) Finished importing: 'tree.obj'
Progress: 100.00%


 Obj file imported successfully ...

 Creating and object list and adding meshes to it ...
1 meshes
0/1 meshes, name: tree
tree has 413 verts, 1144 edges, 758 polys

 Saving a .blend file of the scene
ERROR (bke.bpath): /home/sources/buildbot-worker-linux_centos7/linux_290/blender.git/source/blender/blenkernel/intern/bpath.c:230 BKE_bpath_relative_convert: basedir='', this is a bug
Info: Saved "OBJscene.blend"
Info: Saved "OBJscene.blend"

 Saving a .blend file of the scene: 
/tmp/allWork/blender/TransformMeshToGIFSprite

 begin rendering frames: 
Traceback (most recent call last):
  File "/tmp/allWork/blender/TransformMeshToGIFSprite/GIFandSpriteFromModel.py", line 125, in <module>
    ob = scene.objects.active # the newly added cylinder.
AttributeError: 'bpy_prop_collection' object has no attribute 'active'

Blender quit

Here is the tree.obj file:
tree.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions