PDA

View Full Version : Texture sample in interface


BigRoyNL
11-02-2010, 12:28 PM
Hey Guys,

I can't seem to figure this out.
I'm creating an interface for a mel script and I want to have some thumbnails / example pictures (loved it if this were clickable too, but that's probably to hard.) for pictures I load in. So I want to have a picture of a picture that has been loaded or browsed.

Something like the Texture Sample in the Attribute editor when you're editing a texture or something like the thumbnail of the shader in the hypershade where you can see the Texture on a sphere.

Hope someone knows how to do something like this?

Thanks in advance,

Roy

NaughtyNathan
11-02-2010, 01:11 PM
you need the swatchDisplayPort control command. Do a search for that here (or just look in the MEL docs) and you'll find some example code for it (reeks' shader list that I prototyped here used it iirc)

:nathaN

BigRoyNL
11-02-2010, 01:15 PM
NaughtyNathan once again. Very good! Nice little command.

So, this gives me the sphere preview.

Now just to keep my knowledge going?
Is there a way to get a 'image' preview (just a flat picture) like the Texture Sample in the attribute editor? (so this just means showing a image in a small size within the interface)

Thanks in advance again!
And.. Nathan, keep up the great support.

Roy

NaughtyNathan
11-02-2010, 01:18 PM
yeah, sure.. it should just show whatever node you tell it. to see an image, give it a file node focus.

:nathaN

BigRoyNL
11-02-2010, 01:31 PM
That's amazing and just what I needed!
Somehow some MEL commands just seem to surprise.

Great.

Roy

NaughtyNathan
11-02-2010, 01:43 PM
Somehow some MEL commands just seem to surprise.HAH! yeah, usually they suprise me by crashing Maya. :D

glad that command is what you wanted, and you can even script a click-event! so not too hard after all!
:nathaN

CGTalk Moderation
11-02-2010, 01:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.