Max DirectX viewport shader ego rollout

Hello,

I’m trying to figure out if it’s possible to add a version number / information rollout (or even just a string in the interface) to a dx shader but documentation on the max end of things is a bit thin on the ground.

any ideas?

Can you use a scripted material that delegates to a dx shader? Then you can have a custom UI.

yep, I figured that out for myself eventually.

This is (obviously) a follow on from my thread on standard materials / shader replacement etc.

I only had half an hour to spare earlier but had a bit of difficulty querying the DX shader for things like the technique or bitmaps in use when it’s wrapped up in the scripted material.

I assume it’s some sort of scope issue as I could get at things like the material name which are declared as part of the scripted material but couldn’t get at anything that belongs to the directx_9_shader.

I’m sure there’s a very simple solution that will hit me ten minutes before hometime tomorrow though…

Anything belonging to the DX shader needs to be accessed via .delegate, so:

material.delegate.technique
etc

Just what i wanted to hear, thankyou very much sir :slight_smile:

okay, that worked.

now it’s stupid question time (feel free to point me at the appropriate search term on google)

How do i package this stuff up? I’d like it all to be in an mzp and auto install

I’ve got…

1 x .fx file
2 x .ms files (one for the shader, one for the export process)

I get the impression that I ought to be putting my shader file in maps/fx, I’ll need the scripted material plugin to execute at startup and the export to happen on demand (i might make that into a utility plugin later but no concrete plans)

apologies - i’ve always worked with tech savvy teams so I never needed to make it easy before…

3ds Max locates .fx files used by materials on its “External Files” paths, which are the same paths used to locate textures. Anywhere in that list would be fine. If it’s useful, it also looks in the folder each maxfile is loaded from, and subdirs under that, without those being explicitly on the external files list.

Startup scripts need to be under \scripts\startup somewhere, including subdirs underneath. Scripted materials should generally go under startup, yes.

Your export script can go nearly anywhere, really. It depends how you would like it to be run. If you create a macroscript for it, that allows it to be added to any menu, right-click menu or bound to a keyboard shortcut. The macroscript would just do a filein, pointing to where the script actually sits on disk.

lovely - ta very much :slight_smile: