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

Instructions Look: 'RenderSettings' object has no attribute 'alpha_mode' #76

Closed
brianlow opened this issue May 17, 2023 · 3 comments
Closed

Comments

@brianlow
Copy link

brianlow commented May 17, 2023

I think the loader is failing silently near the end of setInstructionsLook():

def setupInstructionsLook():
    # ...

    # This line is failing with:
    #     AttributeError: 'RenderSettings' object has no attribute 'alpha_mode'
    #
    # This attribute doesn't appear in the latest 3.5 docs:
    #     https://docs.blender.org/api/current/bpy.types.RenderSettings.html
    render.alpha_mode = 'TRANSPARENT'

    # ...

I noticed this when running Blender from the terminal:

# launch and run the import via Blender File -> Import
/Applications/Blender.app/Contents/MacOS/Blender

# launch script to automatically render a brick
/Applications/Blender.app/Contents/MacOS/Blender --background --python my-script-to-render-lego.py

Move evidence: the add-on continues to work if I change the offending line to an early return and use the importer normally via Blender File -> Import

Is the rest of setupInstructionsLook() needed? If not would you be open to a PR? I am building a script to render parts and it fails here. Update: I noticed it is missing white lines on black parts

Details:

  • Blender Version 3.5.0 (3.5.0 2023-03-29)
  • MacOS 13.3.1 (22E261)
@brianlow
Copy link
Author

brianlow commented May 17, 2023

Commenting out the offending line so rest of setupInstructionsLook() is run:

  • transparent parts not rendered

  • lines extend past edge of part

  • studs are messy, missing bottom edge

    image

Early return so most of setupInstructionsLook() doesn't run:

  • missing white lines on black parts

  • missing edge on sloped brick

  • studs are cleaner but still missing parts of edges

    image

TobyLobster added a commit that referenced this issue May 21, 2023
@TobyLobster
Copy link
Owner

Thanks for the report - this should now be fixed with the latest release.

@brianlow
Copy link
Author

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants