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

Fixed incorrect keyword argument #532

Merged
merged 2 commits into from
Jan 9, 2024
Merged

Fixed incorrect keyword argument #532

merged 2 commits into from
Jan 9, 2024

Conversation

StandingPadAnimations
Copy link
Collaborator

@StandingPadAnimations StandingPadAnimations commented Jan 7, 2024

This is a fix for a major bug that was uncaught before MCprep 3.5.2's release

@StandingPadAnimations StandingPadAnimations linked an issue Jan 8, 2024 that may be closed by this pull request
2 tasks
@TheDuckCow
Copy link
Member

Concerns me that there's no unit test covering this code branch, it's worth making that as a part of this update to prove it wasn't working before and fix it working now.

I'll have time later today to take a crack, unless you want to try to do so first (just make a comment that you've started, otherwise I'll comment when I start that and take over).

Should be reasonable to create a patch tonight either way.

@TheDuckCow
Copy link
Member

Hey @StandingPadAnimations just an FYI I'm taking a stab now at the unit test, shouldn't take long and then I'll process the release. Thanks for flagging and doing the first fix 💪

@TheDuckCow
Copy link
Member

Alright, we should be about good to go. I've written a new test, which when I revert the original one-line change, it results in this failed test. Not sure how I missed migrated the texture swap test! But, now we have it covered

-------------------------------------------------------------------------------
Running tests for (3, 6, 2)...
Run only:  test_swap_texture_pack
module changed on disk: '/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/__init__.py' reloading...
Failed to register scene update handler
Traceback (most recent call last):
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/tracking.py", line 887, in wrapper
    res = function(self, context)
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/materials/prep.py", line 482, in execute
    res += generate.set_texture_pack(mat, folder, self.useExtraMaps)
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/materials/generate.py", line 351, in set_texture_pack
    _ = set_cycles_texture(
TypeError: set_cycles_texture() got an unexpected keyword argument 'use_extra_passes'

Error: Python: Traceback (most recent call last):
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/tracking.py", line 887, in wrapper
    res = function(self, context)
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/materials/prep.py", line 482, in execute
    res += generate.set_texture_pack(mat, folder, self.useExtraMaps)
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/materials/generate.py", line 351, in set_texture_pack
    _ = set_cycles_texture(
TypeError: set_cycles_texture() got an unexpected keyword argument 'use_extra_passes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/tracking.py", line 679, in execute
    raise RuntimeError(self.error_report)
RuntimeError:   File "<addon_path>/prep.py", line 482, in execute
    res += generate.set_texture_pack(mat, folder, self.useExtraMaps)
  File "<addon_path>/g... truncatedError: Python: Traceback (most recent call last):
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/tracking.py", line 887, in wrapper
    res = function(self, context)
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/materials/prep.py", line 482, in execute
    res += generate.set_texture_pack(mat, folder, self.useExtraMaps)
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/materials/generate.py", line 351, in set_texture_pack
    _ = set_cycles_texture(
TypeError: set_cycles_texture() got an unexpected keyword argument 'use_extra_passes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/patrickcrawford/Documents/gits/mcprep/MCprep_addon/tracking.py", line 916, in wrapper
    bpy.ops.mcprep.report_error('INVOKE_DEFAULT', error_report=err)
  File "/Applications/blender 3.6/Blender.app/Contents/Resources/3.6/scripts/modules/bpy/ops.py", line 111, in __call__
    ret = _... truncated-------------------------------------------------------------------------------
<unittest.runner.TextTestResult run=1 errors=1 failures=0>
Wrote out test results.

Removing:  MCprep_addon/mcprep_addon_tracker.json
-------------------------------------------------------------------------------
bversion   	ran_tests	ran	skips	failed	errors
-------------------------------------------------------------------------------
(3.6.2)   	test_swap_texture_pack	1	0	1	test_swap_texture_pack

...and with your change back (and running all tests, across all blender versions instead of just one):

-------------------------------------------------------------------------------
bversion   	ran_tests	ran	skips	failed	errors
-------------------------------------------------------------------------------
(3.6.2)   	all_tests	65	2	0	No errors
(4.0.2)   	all_tests	65	2	0	No errors
(3.5.1)   	all_tests	65	2	0	No errors
(3.4.0)   	all_tests	65	2	0	No errors
(3.3.1)   	all_tests	65	2	0	No errors
(3.2.1)   	all_tests	65	2	0	No errors
(3.1.0)   	all_tests	65	2	0	No errors
(3.0.0)   	all_tests	65	2	0	No errors
(2.93.0)   	all_tests	64	3	0	No errors
(2.90.1)   	all_tests	64	3	0	No errors
(2.80.75)   	all_tests	63	4	0	No errors
tests took 223s to run, ending with code 0

@TheDuckCow TheDuckCow merged commit f3c5c7b into dev Jan 9, 2024
@TheDuckCow TheDuckCow deleted the mcprep-3_5_2-patch branch January 9, 2024 04:43
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

Successfully merging this pull request may close these issues.

Incorrect argument in set_cycles_texture
2 participants