Module Templates

Documentation for the Osero Suite: Module Creator update 1.1 (5.2+)

Module Templates are special Data Assets that contain data to use when creating a new module. By default, the tool uses OS_MDC_DefaultTemplate_Data, which is a basic module with no custom code. It's essentially a copy of the module used in the Blank Plugin template when creating a new plugin in the Plugin Manager.

The plugin also comes with an example of a custom Module Template called OS_MDC_Template_OseroSuiteEditorTool, which is a copy of a basic Osero Suite tool module with no custom code. It includes code to add a new tool to the Osero Suite menu, create its slate UI, Details Customisation, and basic static functions used across many Osero Suite tools.

Viewing the Example Template

The Example Template is located in Plugins > Osero Suite: Module Creator Content > Example.

Creating a New Template

To create a new Module Template, right click in the Content Browser or click +Add. Go to Miscellaneous > Data Asset.

Select Osero Suite: Module Template.

The new Module Template will be a copy of the default template and can be modified as needed.

Actions

Copy Existing Module

Clicking this button will replace all the data in this template with the imported data from an existing module in the current project. This action will provide a window to select an existing module to copy.

  • Accept: Replaces ALL data in this template with the data from the selected module. This includes the module header, cpp, Build.cs, and any additional files. This will NOT clear custom keys.

  • Cancel: Cancel the operation, leaving the template as it is.

Import from Json

Clicking this button will replace all the data in this template with the imported data from a valid json file. The tool performs a check to make sure the json file is a json saved from the Osero Suite: Module Creator.

Export to Json

Clicking this button will create a new json file with all of the data in this template for easy copying between projects or editing in an external program. The json file will also include an "OseroSuite" field to identify it as a valid json file for import.

Essentials

The essentials of a module include the module header, module cpp, and Build.cs files. If any of these are left blank, the tool will abort and not create a new module.

Keys (Optional)

Keys allow the user to modify data in a template automatically when the new module is created.

  • Default Keys: These are internal keys used behind the scenes and can be used in most text fields of the module template. Clicking any of these keys will copy it to the clipboard so that it can be easily pasted into the text fields.

    • {Module Name} will be replaced with the New Module Name defined in the tool when creating a new module.

    • {Module Name UPPER} will be replaced with the New Module Name defined in the tool when creating a new module, but all in UPPERCASE. Useful for defining {Module Name UPPER}_API in templates.

    • {Plugin Name} will be replaced with the Target name. This will be the Plugin Name if it's a .uplugin, or the Project Name if it's the root project.

    • {Copyright Notice} will be replaced with this Project's Copyright Notice defined in Project Settings.

  • Custom Keys: Custom keys allow the user to set additional keys to be replaced in the module creation process. Any keys defined here will appear in the Module Creator window when this template is being used to create a new module. In the example, there are two custom keys: {ID} and {Full Name}.

Additional Files (Optional)

Additional Files are files other than the essential module header, module cpp, and Build.cs files. The example includes three additional files: S{ID}_Tool, {ID}_Style, and {ID}_Statics.

  1. View the previous additional file.

  2. The file number that you are viewing and the total number of additional files.

  3. Add a new additional file to this template.

  4. Delete ALL additional files from this template.

  5. View the next additional file.

  6. The subfolder of this additional file relative to the root of the new module (ie, where the module header/cpp is saved).

  7. Insert a new blank additional file here.

  8. Duplicate this additional file.

  9. Delete this additional file from this template.

  10. The additional file's header data.

    1. Private will place the header in the new module's Private folder rather than Public.

  11. The additional file's cpp data.

    1. Leaving the cpp name blank will force the tool to use the header name for the cpp as well. If both are blank, the tool will not generate a module successfully and it will abort the process.

    2. New cpp files will always be placed in the new module's Private folder.

  12. The additional file's other data. This other data can be of any valid file type.

    1. The file extension is defined for this file.

    2. Private will place this file in the new module's Private folder rather than Public.

Last updated