Home Technical Talk

2D mouths "sliders"

polycounter lvl 5
Offline / Send Message
dg3duy polycounter lvl 5

I have a multi-object material with 3 materials, I have applied a material IDmodifier on the mouth to change between materials
I can't automatically change the material id in the mouth modifier and at the same time manipulate the sliders.

I leave the scene here so you can help me.


Replies

  • Mark Dygert
    That kind of depends on two things.
    1) How you rigged up the siders and what they are interacting with inside the material?
    1a) Is it adjusting the UVs on the mesh, or UV offset values for the map in the material?
    2) How comfortable are you with scripting?

    The first idea that jumps to mind, is to use a callback that sets the matID when you select the slider. 

    Callback documentation: https://knowledge.autodesk.com/support/3ds-max/getting-started/caas/CloudHelp/cloudhelp/2019/ENU/3DSMax-Lighting-Shading/files/GUID-850CFCCD-2DF9-4FC9-85F7-9A92AE0C0297-htm.html

    However that could be problematic because the animation could jump between multiple sliders over the course of an animation so you need a way to activate them and key those times the controls are active. That might be as simple as adding another "on/off" slider for each one, that will toggle the matID.

    The next idea I had was to use a composite map instead multi-sub. And this might be a better way to go because it doesn't involve scripting and it works in a similar way to the multi-sub object material but allows you to toggle the opacity of each component, getting rid of the need to toggle between matIDs. 

    Composite map: https://knowledge.autodesk.com/support/3ds-max/getting-started/caas/CloudHelp/cloudhelp/2019/ENU/3DSMax-Lighting-Shading/files/GUID-850CFCCD-2DF9-4FC9-85F7-9A92AE0C0297-htm.html

    One other thing to think about, is that you might want to isolate the animating area(s) to planes that hover just above the surface instead of putting it directly on the head material. That way you only have to manage/transform the UVs for that plane and it can be added to any character anywhere regardless of their head topology. Just drop the plane on the head, conform it to the surface (with a slight offset) and they're ready to go.
  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 5
    The handling of the sliders is the same as this technique. http://www.monotoneminimal.com/archives/506
    Thank you for the information Mark Dygert, now I have decided the way of materialID and not composite.
    On-screen management is faster with sliders.

  • Mark Dygert
    Ahh I see, with an expression, slick! That should work pretty well.

    That should work just fine with a composite map also. Not that I want to push you in a particular direction but you should be able to wire the opacity of the composite maps to sliders using Wire Parameters or Reaction Manager.

    Now that I think about it, instead of making an on/off for each slider, just make one slider that sets the matID... humm... there are a lot of ways to deal with these, all of the options are pretty good so you can't really go wrong. Good luck with any route you take! =)
  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 5
    Ahh I see, with an expression, slick! That should work pretty well.

    That should work just fine with a composite map also. Not that I want to push you in a particular direction but you should be able to wire the opacity of the composite maps to sliders using Wire Parameters or Reaction Manager.

    Now that I think about it, instead of making an on/off for each slider, just make one slider that sets the matID... humm... there are a lot of ways to deal with these, all of the options are pretty good so you can't really go wrong. Good luck with any route you take! =)
    Is the slider you mention by attribute holder in a selected object or is it in the 3D scene like a 3D slider object? 
  • Mark Dygert
    3D in the scene. You can use Reaction Manager to wire a 3d control board to just about anything.

    Here is a tutorial where the guy makes the shapes for the control board and then hooks them up using reaction manager. 

    https://vimeo.com/30133466
  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 5
    3D in the scene. You can use Reaction Manager to wire a 3d control board to just about anything.

    Here is a tutorial where the guy makes the shapes for the control board and then hooks them up using reaction manager. 

    https://vimeo.com/30133466
    I spent a few hours trying with reaction manager without making it work properly, based on your advice that you give me again I'm going to try this way. Thank you

    update:
    In the scene there are 3 controls, in reaction manager I can only choose 1 master control and I can not choose the 3. It does not allow to select 3 master objects to control the modifier materialid of the mouth.
  • Mark Dygert
    You could create a separate controller for the matID. If you use reaction manager you can add multiple states that are set to use different values on a single slider. 

    Also, I'm not sure how you're making your sliders and control board but you might want to grab the joystick creator script that Nevil made back in 2013 http://nevilart.blogspot.com/2013/07/joystick.html It's super easy to use, you just create shapes, run the script and click the joystick button and it creates a controller.
    1. Create a rectangular shape (command panel, shapes, rectangle) make it rectangular to make it a slider and square to make it joystick.
    2. Run the script, (drag the .ms file into your viewport) it should pop up a floating box
    3. Select the shape and click the joystick button and now you have a controller
    4. In reaction manager, set the handle as the master > Transform > Position > X Position > Limit controller Bezier Float
    5. Create a slave and target the material ID
    6. Create 3 states below
    7. State001 Value -45, ID1
    8. State002 Value 0, ID2
    9. State003 Value 45, ID3
    10. Note: You can also create states for the attribute left/right holders instead of using the Bezier Float, but that means you need two master reactions to control one slider and I like only having to mange one. Just remember that left is -45, the middle is 0 and right is 45.
    Now when you slide it left to right it will flip between the different matIDs. You can key that handle to activate the different materials.




  • Mark Dygert
    Yeah, perfect! That's a cool UI setup too, I like the way you nested it. NICE!
Sign In or Register to comment.