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

Restore ExportFiles for Scripting and Add Export Settings #1046

Merged
merged 2 commits into from
Jan 2, 2023

Conversation

dragonzkiller
Copy link
Member

Fixed:

  • Refactored wkit.ExportFiles for scripting

Currently just a draft PR to track adding in export options. PR could be merged now to restore functionality without the additional feature

@dragonzkiller dragonzkiller self-assigned this Dec 31, 2022
@dragonzkiller
Copy link
Member Author

dragonzkiller commented Jan 1, 2023

Added in export settings with the option to select the exposed property name in the script via an attribute. By default, the attribute will keep the property name, but setting it to something else will change the name in the script. Only parameters that are built-in types or enums have been tagged since currently no type conversions exist for more advanced types.

Export settings for the following types (not all attributes) are now supported:

  • xbm
  • mesh
  • wem
  • opus
  • mlmask
  • anims
  • morphtarget

For example: in the script below, ImageType is the overridden name for scripts that actually points to MaterialUncookExtension parameter for Mesh and UncookExtension parameter for Xbm. However, LodFilter points to the LodFilter parameter, since the attribute has no script name defined.

wkit.ExportFiles(['base\\environment\\architecture\\common\\int\\int_nkt_apartment_a\\int_nkt_apartment_a_deco_pillar_l60_h400_aa.mesh',
    'base\\gameplay\\gui\\fullscreen\\loading\\wat_lch_dc_4k.xbm'],
    {
        Mesh: { ExportType: "WithMaterials", ImageType: "png", LodFilter: true, Binary: false},
        Xbm: { ImageType: "dds", Flip: false }
    }
);

See ExportArgs.cs for more information on how it was done.

@dragonzkiller dragonzkiller marked this pull request as ready for review January 1, 2023 06:05
@dragonzkiller dragonzkiller changed the title fix: Restore ExportFiles for Scripting Restore ExportFiles for Scripting and Add Export Settings Jan 1, 2023
@dragonzkiller
Copy link
Member Author

Oh I also forgot to mention that this also enables scripts to use both relative paths and absolute paths since the code checks for that now

impExpVM.IsExportsSelected = true;
impExpVM.IsImportsSelected = false;
// get the export view model and clear the items
var expVM = Locator.Current.GetService<TextureExportViewModel>();
Copy link
Member

Choose a reason for hiding this comment

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

I would rather not use the viewModel here to be honest (just refactor it in local variables and methods). But if this is critical, we can refactor it later(TM).

@rfuzzo rfuzzo merged commit e6fb77d into main Jan 2, 2023
@dragonzkiller dragonzkiller deleted the feature/script-exports branch January 10, 2023 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants