-
Notifications
You must be signed in to change notification settings - Fork 25
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
Internal Refactoring for 3.4.3 #348
Conversation
Realize this is still in review, but calling out now that I'd prefer the name lower-case ENV instead of uppercase; uppercase is generally referred to treat something as a constant, but env is something that will be mutable (verbose can be turned off and on for instance), so will ask you to turn it into lowercase when you can. Holding off on further review in the meantime - thanks for getting a head start here! |
Sure thing, maybe something like One interesting thing I might add to |
Yup that makes sense to have those vars initialized in As for the name of the variable instance, I'd like a convention for naming that is short and easy to use in the other classes. |
Sorry for the lack of updates, hopefully I'll be able to get some changes done by late December/early January. I'll be busy for the next couple of weeks |
Alright, @TheDuckCow, I've renamed |
As mentioned here, I won't be working on MCprep anymore, so this PR will just be left in this state. I believe this will eventually get done in the future, either by the open source community or myself (if I decide to come back), but who knows |
Ok, so I don't know if I'll reopen this, but I'm curious about whether we'll use type annotations (which are supported in Blender 2.8 and above), since it would give the following benefits:
Alternatively we could add type annotations at a later date (not preferable, but better late then never) or figure out a way to use it in older versions of Blender (perhaps with the futures module?) |
I think now I'll be working on this. I'll look into porting the use of OS to Pathlib (for file operations) since it's more readable and concise |
Though now I got to sign all of these commits for verification purposes. Not too annoying though since it's not merged |
Alright with #399 (and this PR is for MCprep 3.5), I think it's now safe to deprecate the use of |
Alright, I'll merge dev with this locally (for updates) ajd get started. I'll be doing the following:
@TheDuckCow just want to know your thoughts |
Just to be clear, you mean merge I'm ok with this. We can use internal-rewrites as an actual "feature branch". I don't want to merge breaking compatibility into dev yet, as we may have more patch releases between now and 3.5 (we will for sure have at least a 3.5.2, based on your report about mtl conversion errors). But it would be good to get a head start on some of these updates. I'd start with removing 2.7x compatibility code, anything to do with Blender Internal. I'm wary about adding type hints everywhere just yet. It will just create more merge conflicts in the future if we annotate every function, whereas if we do this a little closer to the 3.5 release, we'd deal with the state of the code at that time. But this could also be mitigated by diligently re-merging dev into this |
Yep
Sure thing |
79ec6d4
to
143ccd3
Compare
Alright, went ahead and made a new branch called |
So should we move these deprecations to MCprep 3.5? |
I'm fine to proceed with merging these changes to a dedicated MCprep 3.5 branch (not Dev, but newly branched from current dev)Let me set this up later when I have time (give me a day or so). Idea is it will be a branch we treat similar to dev. We merge approved PR changes that are 3.5x only into that, and then only when we are totally ready to move ahead with 3.5x code (ie we know we won't need any further patch releases), then we merge this mcprep35 branch into dev. Until then, I'll be diligent and merge dev changes back into this mcprep35 branch so it doesn't get too out of sync.On Apr 6, 2023 9:45 AM, StandingPad ***@***.***> wrote:
So should we move these deprecations to MCprep 3.5?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I've updated the base since this branch as-is doesn't work in 2.7x (first error is Some changes still needed though, errors on startup with I think some remaining
and
And some others. Once we resolve these, I think it would be good to merge into the newly-assigned feature branch, so that other changes can be reviewed on their own. |
I've updated the base since this branch as-is doesn't work in 2.7x
(first error is print(f"\"{header}\"")), and this is ok. I'm hopeful we
can make 3.5.0 the next release anyways.
I think we can ignore that if we merge this for MCprep 3.5
Some changes still needed though, errors on startup with I think some
remaining ENV variables where the class instance is now named env
(which I think is good). e.g.
Whoops, looks like I missed some places, good catch
Once we resolve these, I think it would be good to merge into the
newly-assigned feature branch, so that other changes can be reviewed on
their own.
The MCprep 3.5 Recore branch or a new branch? If the latter, it might be
easier to just keep them here.
…On 0406, Patrick W. Crawford wrote:
I've updated the base since this branch as-is doesn't work in 2.7x
(first error is print(f"\"{header}\"")), and this is ok. I'm hopeful we
can make 3.5.0 the next release anyways.
Some changes still needed though, errors on startup with I think some
remaining ENV variables where the class instance is now named env
(which I think is good). e.g.
File "/Users/patrickcrawford/Library/Application Support/Blender/3.5/scripts/a
ddons/MCprep_addon/mcprep_ui.py", line 934, in draw
elif env.skin_list and len(ENV.skin_list) <= sind:
NameError: name 'ENV' is not defined. Did you mean: 'env'?
and
Traceback (most recent call last):
File "/Applications/Blender 3.5/blender.app/Contents/Resources/3.5/scripts/mod
ules/addon_utils.py", line 369, in enable
mod.register()
File "/Users/patrickcrawford/Library/Application Support/Blender/3.5/scripts/a
ddons/MCprep_addon/__init__.py", line 64, in register
load_modules.register(bl_info)
File "/Users/patrickcrawford/Library/Application Support/Blender/3.5/scripts/a
ddons/MCprep_addon/load_modules.py", line 181, in register
addon_updater_ops.register(bl_info)
File "/Users/patrickcrawford/Library/Application Support/Blender/3.5/scripts/a
ddons/MCprep_addon/addon_updater_ops.py", line 1360, in register
from .conf import ENV
ImportError: cannot import name 'ENV' from 'MCprep_addon.conf' (/Users/patrickcr
awford/Library/Application Support/Blender/3.5/scripts/addons/MCprep_addon/conf.
py)
And some others.
Once we resolve these, I think it would be good to merge into the
newly-assigned feature branch, so that other changes can be reviewed on
their own.
--
Reply to this email directly, [1]view it on GitHub, or [2]unsubscribe.
You are receiving this because you were mentioned. Message ID:
***@***.***>
References
1. #348 (comment)
2. https://github.com/notifications/unsubscribe-auth/AR4UXCRQQHLMXCKFOY4XWOLW73W3DANCNFSM6AAAAAARGRBB4E
|
Now that there's a milestone branch for 3.5, should we merge this branch? |
Let's fix the couple things mentioned where you missed first, and resolve the conflicts. I'll take one more quick look then, and then yes we can merge into the milestone branch. |
I'm honestly not sure how I missed these, but good thing they were caught. Now MCprep shouldn't be dealing with any errors related to env now...
While removing the last of the ENVs, I noticed some deprecation warnings regarding the use of this function, so I've went ahead and removed it. Since this function calls other deprecated functions as well, what should have been 1 warning was instead 3. Apologies to anyone who had to suffer that in their terminal ;-;
In all honesty I doubt we'll get around to actually removing these functions in 3.5.1, but since we're merging this with the 3.5 feature branch, I think it's important to warn developers and make them think about the eventual demise of these functions. Plus there's absolutely no reason to use deprecated functions for 3.5 when we'll have nice features like type annotations. Anyway, hopefully after this commit, we'll merge this with the MCprep 3.5 feature branch *fingers crossed*
Alright, fixed the remaining uses of @TheDuckCow just need some final checks on this to make sure everything is working as expected |
For some reason the spawner was missing the use of env, causing errors. While this has been fixed, it does illustrate an issue with the current deprecation system in that deprecated stuff will error out. More investigation is needed.
This feature was requested by TheDuckCow to make dev builds easier to create. The idea is that a file is created by the compile scripts, and MCprep checks for the files existence to determine which flags to enable. This makes development a lot more convinient and removes the need for commits that change the dev flag. This does mean the MCprepEnv class no longer has arguments, but that's fine. In the future we might be able to read the contents of the file to give full control over what flags to enable.
Why? It allows us to determine if we're using a dev build or not
-d allows the creation of a dev build, by adding a new file called mcprep_dev.txt to the outputed build folder. -f replaces the -fast option and does the fast compile mode.
Alright I've now pushed the dev build feature to |
When running, an error occured due to log requiring the variables verbose and very_verbose, which do not exist until afterwards. Now it's been moved to after those variables have been set.
Ok I just realized that we also have #401, which makes this branch a bit weird (#401 is also based off of this). Should we merge this completely with I'm leaning more towards the latter so that the changes are more incremental, but I want to know everyone's thoughts |
It's not a problem, both can be merged into milestone-3-5-0, in whichever order (both will likely have a couple merge conflicts, so dealers choice which you want to deal with in which order). So I guess the latter of your two options is what I agree with. The sooner we merge this one though, the fewer problems we'll have. If we need to make future fixes, they can be branched off of the milestone-3-5-0 and PR-merged back into the same milesotne-3-5-0 |
Closing this as this is no longer needed with #401 |
List of Deprecated Features Planned for MCprep 3.4.3
State: Alpha, changes are not final
conf.dev
->conf.env.dev_build
conf.v
->conf.env.verbose
conf.vv
->conf.env.very_verbose
conf.data
->conf.env.data
conf.json_data
->conf.env.json_data
conf.json_path
->conf.env.json_path
conf.use_icons
->conf.env.use_icons
conf.preview_collections
->conf.env.preview_collections
conf.icons_init()
->conf.env.icons_init()
conf.loaded_all_spawners
->conf.env.loaded_all_spawners
conf.skin_list
->conf.env.skin_list
conf.rig_categories
->conf.env.rig_categories
conf.entity_list
->conf.env.entity_list
conf.material_sync_cache
->conf.env.material_sync_cache
conf.register()
->conf.MCprepEnv.__init__(self)
conf.log(statement, vv_only=False)
->conf.env.log(self, statement, vv_only=False)