CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 01-10-2011, 03:33 PM   #1
New Member
inglobetechnologies's Avatar
Ceccano, Italy
Join Date: May 2010
Posts: 18
[MEL/Python] Create new material type

Hi all,
it's my second time posting here and I really hope you can help me.

The problem is: I want to create a new material type (a very simple one to start off...) that maya users can pick from the list of all materials (lambert, phong, blinn, ...). Just like, for example, Mental Ray materials.
Of course once selected and assigned to an object, it must show some particular attributes and the UI elements to adjust them, just like any other surface/mr material.

Is it possible to do something like this in Mel or Python?
For example in 3ds Max, by using maxscript, I can create new materials and define a custom UI that it is showed in the material configuration panel.

I hope this is not something already discussed/solved in other threads (btw, if it is please link them to me... ).

Thanks in advance for any help or hint you can give.
Old 01-11-2011, 01:57 AM   #2
Windows90's Avatar
Cuckon Sue
Jinan, China
Join Date: Aug 2007
Posts: 108
Send a message via MSN to Windows90
Yes the powerful python could do this~ Check this link dude:
You are the reason I love CGTalk, my kind-hearted friends!
Old 01-11-2011, 11:08 AM   #3
New Member
inglobetechnologies's Avatar
Ceccano, Italy
Join Date: May 2010
Posts: 18
First of all, thanks for your reply.
I actually checked that example (and a bunch of others from the maya scripts directory) but it seems to me that it just create a color utility (that can be used in hypershade) and not a new material type.

Am i missing something?

I found that the 'devkit/plug-ins' maya directory contains some c++ written shaders but I'd rather stick to python/mel for portability reasons.
Old 01-11-2011, 01:38 PM   #4
HighEnd3D deserter
NaughtyNathan's Avatar
Naughty Nathan
Technical Artist
Sony SCEE Liverpool
Manchester, United Kingdom
Join Date: May 2008
Posts: 2,608
what you want is in 'devkit/plug-ins/scripted'. that's the python equivalents. take a look at

Old 01-11-2011, 02:18 PM   #5
New Member
inglobetechnologies's Avatar
Ceccano, Italy
Join Date: May 2010
Posts: 18
thanks Nathan,
currently, I'm trying to figure out something that is based on that script.

I'll post some code as soon as I assemble something that can be useful AND usable.

Quick update

I changed the node classification string of the node and now I am able to access the new material and edit all its defined attributes.

kPluginNodeClassify = "shader/surface" mplugin.registerNode( kPluginNodeName, kPluginNodeId, nodeCreator, nodeInitializer, OpenMayaMPx.MPxNode.kDependNode, kPluginNodeClassify )

Now i JUST need to write down how to update the viewports to reflect the actual attribute modifications...

Last edited by inglobetechnologies : 01-12-2011 at 11:31 AM.
Old 01-11-2011, 02:18 PM   #6
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,479
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 08:41 AM.

Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.