The system is a kind of bridge aimed to solve the situation that artist need to make animation of properties on some materials.

Chapter 1 - Modules

The system is combined with two modules:

  1. Component MatAnimManager used to control the animation curve configs.
  2. ScriptableObject MatPropCurve used to save the curve configs eternally.

Chapter 2 - Create and edit configs

  1. Create asset config

    Right click on Project View or click Assets on Menu Bar, find item on following path:

    Create - Moonflow - MFMatPropCurve

    click to add a new asset config to the current path.

  2. Add and remove property config

    Select the asset config file, you will see the following interface.

    image.png

  3. Edit config

    After add curve configs to asset, you will see the following table view.

    From top to the bottom row of this example, they’re float param\ vector param\ color param

    image.png

    The left column “Prop Name” used to record which property in target material will be edited by the curve on it’s right side. “Prop Name” must be the same on target material.

    IMPORTANT: most of time the real property name is not the same as shown on material inspector. The real name of properties can be found on Debug Mode of Inspector (in the “Saved Properties”, the following screen capture shows how to switch to debug mode and find the real name). If you cannot recognize the matching relations of properties on target material, you have to ask the writer who write down the code of shader of target material for help.

    image.png

    image.png

    The following config means that property called “_Str” will be edited. It’s an example to control a material used “Distortion” shader, You cannot find any property called “_Str” but at the same time, another property called “Str” is displayed on view. It is because that the property “_Str” is edited to displayed as “Str”.

    image.png

    image.png

  4. Save changes - Click save to save all the changes. And you can find the sub asset of curve config is renamed as the prop name you have just edited.

    image.png

Chapter 3 - Use Controller Component

  1. Add Component

    Add MatAnimManager to a gameobject which will use animation.

    You will find the following view.

    image.png

  2. Add Curve Config

    Drag the MFMatPropCurve asset which created at the previous step into Mat Prop Curves list.

    And the same editor view of curve configs will displayed on the bottom of this component.

    Of course the functions and interactives are also the same.

    image.png

    If there is any empty reference in the Mat Prop Curves list, there will show the error info with red color font.

    image.png

  3. Control Panel

    The mid panel between two cyan divide line is control panel. ****

    Every properties in control panel could be recorded by animation.

    The default state of Auto Update is inactive.

    image.png

  4. Collect Renderer

    image.png

    Press Collect Renderer Button to collect renderers from current object which added this component.

    For this manager only apply changes to materials from renderers on Renderers list, you can manually pick out which renderer will be effected.

    You can also drag renderers from other gameobjects into the list or even added any renderer you want via script(be careful you have to be sure that every renderer you need is added perfectly before play toggle is checked). It’s usually useful for those character rendering which prefab has more than one skinned mesh renderer.