Git Product home page Git Product logo

lol_maya's Introduction

LoL Maya 2023

An attempt to update RiotFileTranslator to Maya 2023.

Installation:

  1. Click here and download latest release.

  2. Extract all plug-ins, prefs and scripts folder to Documents \ maya \ 2023.

  3. In Maya toolbar, select Windows > Settings/Preferences > Plug-in Manager.

  4. Tick Load / Auto Load on the plug-in lol_maya.py.

File translators:

  1. Misc:
    • Add fix for read/write file with suffix in name.
    • Export base on original file:
      • How to: have at least 1 of 2 files below in export location:
        • riot_{name of export file}.EXT (take priority first)
        • riot.EXT
      • File type support (EXT):
        • SKN: For fixing incorrect transparent faces on champions.
        • SKL: For fixing bad animation blending of champions that have animation layers.
        • SCO, SCB: For fixing incorrect pivot and central point.
        • MAPGEO: For fixing map crashed while casting a skill has ground indicator.
      • Example: If you want to export modified yone_base.skl base on original file, you must have either riot_yone_base.skl or riot.skl in export location; if you have both of them, riot_yone_base.skl will take priority.
  2. SKN:
    • SKN data in Maya scene:

      • Combined mesh : A single mesh that:

        • Materials and UVs assigned on all faces.
        • All face normals point inward.
        • Bound with joints as a skin cluster and have weight painted on all vertices.

      • Group meshes: A group of combined mesh.

    • Read:

      • 33 22 11 00: V0, V1, V2, V4

      • SKN import options:

        • Import skeleton: load with SKL as skin cluster.
          • Material that has duplicated name with another joint will be renamed to full lowercase letters.
          • Example: If there is a joint Fish, material Fish will be renamed to fish in scene.
        • Import mesh separated by material: load SKN as group meshes separated by materials.

    • Write:

      • To export:
        • Combined mesh: select the bound mesh -> use export selection.
        • Group meshes: select the group of bound meshes -> use export selection.
      • 33 22 11 00: V1
      • Limit vertices: 65535.
      • Show/select component on error:
        • Vertex: 4+ influences vertex, material shared vertex, non UVs assigned vertex.
        • Face: invalid triangulation face, non material assigned face, non UVs assigned face.
  3. SKL:
    • SKL data in Maya scene: all joints in scene, it does not matter if ther are bound or not.
    • Read:
      • r3d2sklt: V1, V2
      • C3 4F FD 22: V0
    • Write:
      • To export: will be exported with SKN.
      • C3 4F FD 22: V0
      • Limit joints: 256
      • New SKL data, no need to update/convert.
  4. ANM:
    • ANM data in Maya scene:
      • Translate + Rotate + Scale keyframes of all joints in scene from animation start time + 1 to animation end time on Time Slider.

        Example: If the animation time range is -5 to 14 like in the below picture, keyframes will be exported from time -4 (-5+1) to 14.

      • FPS support: 30/60.

    • Read:
      • r3d2canm

      • r3d2anmd: V3, V4, V5

      • To delete existing scene animations before load ANM, change ANM import options to:

      • To ensure importing FPS and animation range from ANM file, change ANM import options to:

    • Write:
      • To export: use export all.
      • r3d2anmd: V4
      • Uncompressed, scaling support.
      • No need to convert with lol2dae or edit 1E hex.
  5. Static object:
    • Static object in Maya scene:
      • A single mesh that:

        • UVs assigned on all faces.
        • All face normals point inward.
      • Central point: is translation of mesh's transform.

      • Pivot point (SCO only, optional): is translation of an additional joint that bound with mesh.

    • Read:
      • SCO
      • SCB: r3d2Mesh: V1, V2, V3
    • Write:
      • To export: select the mesh -> use export selection.
      • SCO
      • SCB: r3d2Mesh: V3
      • Show/select component on error:
        • Face: invalid triangulation face, non UVs assigned face.
      • No need to convert with Wooxy.

Shelf buttons

  1. Hover mouse on shelf buttons to read tooltip.
  2. Explain some buttons:
    • Namespace buttons: Quickly add/remove a temporary namespace on selected objects.
    • Separated mesh button: Separate selected mesh by materials.
    • Fix shared vertices button.
    • Martin UV helper: move selected UVs to specific corner.
    • Update bind pose button: set current pose as bind pose for skin cluster, require: select single joint of the skin cluster.
    • Freeze joints buttons: Freeze/bake selected/all joints rotation.
    • Mirror joint buttons: work great if joints rotations have been frozen.
      • L<->R: mirror rotation of a selected joint startswith L_ or R_ to the opposite joint.
      • A<->B: mirror rotation of first selected joint to second selected joint.
    • 4 influences fix button: prune and force max 4 influences on selected skin cluster.
    • Rebind button: Quickly unbind, delete history, rebind selected skin cluster.

MAPGEO

  1. MAPGEO data in Maya scene:

    • A group of meshes that:

      • Materials and UVs assigned on all faces.
      • All face normals point inward.

    • Material:

      • Material names in MAPGEO files or in BIN files are used with /, this character can't be used in Maya, so all / will be converted to __ when import, and will be converted back to / when export.

      • Example:

        • In mapgeo or bin: Maps/KitPieces/Howling_Abyss/Materials/Keep_inst
        • In Maya: Maps__KitPieces__Howling_Abyss__Materials__Keep_inst
      • Material type that used in Maya for MAPGEO by default is Lambert, however, Standard Surface / Arnold's Standard Surface is more advanced to use when export/import materials data through shelf buttons.

      • To import MAPGEO using Standard Surface materials, change MAPGEO import options to:

    • Layer:

      • A map must have 8 layers, equal to 8 set in Maya.

      • If an object is assigned to a layer, it will appear on that layer in game.

      • An object can be assigned to multiple layers, if it is assigned on all 8 layers, it will appear on all 8 layers.

      • Layer in Summoner Rift (SR):

        • Layer 1: Base
        • Layer 2: Inferno
        • Layer 3: Mountain
        • Layer 4: Ocean
        • Layer 5: Cloud
        • Layer 6: Hextech
        • Layer 7: Chemtech
        • Layer 8: Unknown
        • Example in SR: if mesh assigned to set2 -> that object will appear in layer 2 - Inferno map.
      • Layer in Aram / other maps: objects are always assigned to all 8 layers.

    • Bushes:

      • Similar to set for Layers, a map also must have setBushes to indicate which mesh is bush.

      • If an object is assigned to setBushes, it is bush. (yep)

    • Baron (only SR):

      • When importing mapgeo, there is setBaron to indicate which mesh belong to Baron area. This setBaron is just for better organizing in Maya and do not require when exporting mapgeo.

      • However, those meshes must have an extra attribute called Bucket Hash and this Bucket Hash is the thing that will get imported/exported.

      • Bucket Hash: is a FNV1a hash value that can be found in materials.bin. When exporting, if your entered value is not a correct hash, the mesh will be exported with default value: 0.

      • There is also a shelf button for assign/remove meshes to/from setBaron and create Bucket Hash attribute on them.

    • Bucket Grid (Important):

      • Bucket Grid can only be achieved by exporting base on original MAPGEO file. (aka riot.mapgeo method)
      • If you export without Bucket Grid, the modified map will crash League or event worse, freeze you computer.
    • Lightmap (Optional):

      • 2nd texture & UVs to store light data in, will blend with main texture (diffuse texture) in game.

      • Lightmap contains two things: Name and UVs data

      • Name:

        • If there is no lightmap: The group name can be whatever it is.

        • If there is lightmap: The group name must be lightmap folder path and have riot_ before it. Example: In Aram, keep this name if you want original lightmap work.

        • Example Lightmap name in Aram: ASSETS/Maps/Lightmaps/Maps/MapGeometry/Map12/Base/2.dds

      • UVs data: 2nd UV set of mesh, can be generated by a button on shelf.

      • You don't need to have Lightmap if you can bake light straight into main texture, like Riot did with SR.

  2. Read:

    • OEGM: V5, V6, V7, V9, V11, V12, V13, V14, V15
  3. Write:

    • To export: select the group of meshes -> use export selection.

    • OEGM: V15

    • Limit vertices for each mesh: 65535.

    • Show/select component on error:

      • Vertex: material shared vertex, non UVs assigned vertex.
      • Face: invalid triangulation face, non material assigned face, non UVs assigned face.
    • Diffuse UVs must be in 1st UV set; if model uses Lightmap, Lightmap UVs must be in 2nd UV set.

    • Freeze all meshes's transform before you export for better organized.

  4. Shelf buttons:

    Explain buttons from left to right:

    • Rename path of selected objects with input prefix.

    • Rename selected objects with input prefix.

    • Toggle on/off all layers on selected mesh.

    • Toggle on/off layer 1 - 8 on selected mesh.

    • Assigned to / remove from setBushes on selected mesh.

    • Assigned to / remove from setBaron on selected mesh, also create Bucket Hash attribute if not existed.

    • Select all faces of all meshes that have same assigned material as selected face.

    • Set all black emissions weight to 0.

    • Fix shared vertices on all meshes in scene.

    • Import materials.py:

      • Read materials.py file to import textures.
      • assets folder must be in same location as materials.py.
    • Export materials.json: export all materials of selected meshes to a json file; all textures will be copied to same export location; if nothing get selected, this button export all materials in scene instead; materials.json can be read by Avatar (made by Killery) to convert back to materials.py.

    • Export materials.py: export all materials of selected meshes to a py file; all textures will be copied to same export location; if nothing get selected, this button export all materials in scene instead; only diffuse textures will be exported and only export into default_env shader.

    • Check if materials of selected meshes are not defined in materials.py, if nothing get selected, this button will check all materials in scene instead.

    • Extra: League shader <-> Maya shader:

      • Lambert / Other materials:
        • Diffuse Texture -> Color / Transparency
      • Standard Surface / Arnold's Standard Surface:
        • Diffuse Texture <-> Base
        • Glow Texture <-> Base, Glow Color <-> Glow
        • Mask Color <-> Coat, Mask Texture <-> Coat Normal
        • Emissive Texture <-> Emissive Color <-> Emission
    • Generate Lightmap UVs on 2nd UV set of selected objects.

    • Delete Lightmap UVs and 2nd UV set of selected objects.

    • Bake texture: bake textures with Arnold on selected objects.

      • Output: Location of output baked textures.
      • No diffuse:
        • On: Bake only light - use 2nd UV set of selected objects and default material standardSurface1 to bake.
        • Off: Bake with diffuse - use 1st UV set of selected objects and their own materials to bake.
      • Quality: You will want High quality bake for diffuse and Low quality bake for lightmap.
      • Resolution: Resolution of baked textures; integer input, should be 256, 512, 1024,...

External Links:

lol_maya's People

Contributors

crauzer avatar tarngaina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lol_maya's Issues

Can't enable this Plugin due to Error

I tried to install several versions of this plugin on both maya 2023 and 2024 and i always get the error:

// Warning: file: C:/Program Files/Autodesk/MayaCreative2023/scripts/others/pluginWin.mel line 316: Plug-in C:/Users/****/Documents/maya/2023Creative/plug-ins/lol_maya.py does not have a valid Autodesk plug-in signature and is not authorized for use with this application

I looked online for solutions to this already but either didnt understand them or tried them and they didnt work.
I dont know much about how programs like maya work internally so help would be greatly apreciated, thanks in advance.

Error export skn

// Model|ModelShape
select -cl ;
select -r Model|ModelShape ;
file -force -options "" -typ "League of Legends: SKN + SKL" -pr -es "C:/Users/andre/Desktop/teste.skn";
// Error: IndexError: file C:/Users/andre/Documents/maya/2023/plug-ins/lol_maya.py line 785: tuple index out of range
// Error: Could not save file "C:/Users/andre/Desktop/teste.skn".

"Corrupted" mapgeo when imported in Maya

corrupt
I tried to import few .mapgeo file with the plugin recently and I had this issue with some of them where the viewport is black, you can barely turn around (its really laggy). This one is the most recent one: "carousel_set10.mapgeo"
I have no clue where this could come from but it's not the only .mapgeo file with this issue even if most of them are working fine

MapGeometry import failure if Mesh Range Material is `-missing@environment-`

file -import -type "League of Legends: MAPGEO"  -ignoreVersion -ra true -mergeNamespacesOnClash false -namespace "worlds_trophyonly_rewritten" -options "ssmat=0"  -pr  -importFrameRate true  -importTimeRange "override" "C:/dev/LeagueToolkit/src/LeagueToolkit.Sandbox/bin/Debug/net6.0/worlds_trophyonly_rewritten.mapgeo";
// Error: ...shadingNode -asShader lambert -name "-missing@environment-";sets -renderable true -noSurfaceShader true -empty -name "-missing@
// Error: Line 1.168: Syntax error
// Error: RuntimeError: file C:/Users/Filip/Documents/maya/2023/plug-ins/lol_maya.py line 3703: (kFailure): Unexpected Internal Failure
// File read in  8.3 seconds.
// Error: Error reading file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.