Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

General: Better arguments order in creator init #3475

Merged
merged 3 commits into from
Jul 8, 2022

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jul 8, 2022

Brief description

Change order of creator init arguments to have most used project settings as first to less important arguments as last.

Description

In most of cases when creator want to override initialization it's because of using project settings thus it's better to have it as first argument, then system settings and then what is probably not used in custom init just to be passed to super init.

Additional info

Breaks backwards compatibility. So this should be done now before new publisher is used in all hosts.

Order was change from most used to less used arguments.

# Argument in init
# /// Before \\\
def __init__(self, create_context, system_settings, project_settings, headless=False):

# /// Now \\\
def __init__(self, project_settings, system_settings, create_context, headless=False):

# Demonstration when project settings are used
# /// Before \\\
def __init__(self, create_context, system_settings, project_settings, *args, **kwargs):
    super().__init__(create_context, system_settings, project_settings, *args, **kwargs)

# /// Now \\\
def __init__(self, project_settings, *args, **kwargs):
    super().__init__(project_settings, *args, **kwargs)

@iLLiCiTiT iLLiCiTiT self-assigned this Jul 8, 2022
@iLLiCiTiT iLLiCiTiT added the type: enhancement Enhancements to existing functionality label Jul 8, 2022
@iLLiCiTiT iLLiCiTiT requested a review from kalisp July 8, 2022 09:46
Copy link
Member

@kalisp kalisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP Create works in PS, AE

@iLLiCiTiT iLLiCiTiT merged commit 737c1ac into develop Jul 8, 2022
@iLLiCiTiT iLLiCiTiT deleted the feature/change_args_order_in_creator_init branch July 8, 2022 11:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants