-
Notifications
You must be signed in to change notification settings - Fork 26
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
Error Migration and Refactoring for 3.6.0 #549
Conversation
Sometimes an exception may not be so clear cut, so let's allow an optional message to return
In this commit, we do the following: - Convert more functions to use MCprepError - Remove Blender Internal and 2.7X specific code
This refactors the following functions to use the new error type: - bAppendLink - open_program In addition, the function bAppendLink has had all 2.7X related code removed, although an argument related to 2.7X layers is kept to avoid widescale breakage
This file is not used at all, and is poorly written. If we need to revisit this idea, we can use Vivy as reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice changes! I see it's still in draft, so just leaving as comments for now. please re-request review once ready for more input
def bv28() -> bool: | ||
"""Check if blender 2.8, for layouts, UI, and properties. """ | ||
""" | ||
Check if blender 2.8, for layouts, UI, and properties. | ||
|
||
Deprecated in MCprep 3.5, but kept to avoid breakage for now... | ||
""" | ||
env.deprecation_warning() | ||
return min_bv((2, 80)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these references have been removed now. If not on this 3.6.0 branch, then check in dev (maybe merging dev into the milestone branch), in which case either way I think this function can just be removed.
I think we should merge this into the CommonMCOBJ branch so we can knock out 2 birds with one stone |
Alright, merging into the CommonMCOBJ branch |
This PR is mainly to migrate errors in MCprep to use the new
MCprepError
class. At some point, we realized the need for being able to return objects with messages, so we also added an optionalmsg
field toMCprepError
.In this PR, we also perform any general refactoring that may crop up as needed. Most of these are related to error handling, but there are a few that for the sake of getting out of the way I've done, which are:
world_tools.py
bAppendLink
, as well as deprecate theactive_layer
argumentThe following functions have been refactored to use the new error type:
convert_mtl
:Optional[bool]
->Optional[MCprepError]
enable_obj_importer
:Optional[Bool]
->Union[OBJImportCode, MCprepError]
bAppendLink
:bool
->Optional[MCprepError]
open_program
:Union[int, str]
->Optional[MCprepError]