Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Python: Add materials and Texmaps to Slate material editor with MaxPlus

Python: Add materials and Texmaps to Slate material editor with MaxPlus

Anonymous
Not applicable
1,331 Views
4 Replies
Message 1 of 5

Python: Add materials and Texmaps to Slate material editor with MaxPlus

Anonymous
Not applicable

Hi,

The example demoMaterials.py shows how to add a material to the compact material editor.

However, when I am trying to add the material in advanced mode, it does not seem to work.

There is no material in the view when the editor opens.

Is there a way to do that?

 

The larger goal here is to create a material graph with texmaps and material connected to each other in Python.

Doing that in compact material mode seems to be complicated. 

Thanks

0 Likes
Accepted solutions (1)
1,332 Views
4 Replies
Replies (4)
Message 2 of 5

denisT.MaxDoctor
Advisor
Advisor

If you try to search the MaxPlus documentation, can you find something about SME or Slate Material Editor?

Hmm ... maybe one more chance ... How about GlobalTracks? 


Maybe something is wrong with MaxPlus? 🤔

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi,

Thanks for your help.

I didn't find anything specific to the Slate Material Editor for MaxPlus.

The demo only specifies you can choose which type of editor you want to open.

If there is something about SME that is unsupported in MaxPlus, it does not seem to be documented.

0 Likes
Message 4 of 5

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

People ask very often: "How can I do <...> by MaxPlus?"

What difference does it make to use exactly the MaxPlus, and not just any solution in Python?

 

There is pymxs.  It's a wrapper of MaxScript. You can do everything with pymxs what you can do with MXS using almost the same syntax. If you need transfer any object (Animatable) between MaxPlus and pymxs you can use its AnimHandle...

import MaxPlus
import pymxs
mp_mat = MaxPlus.Factory.CreateDefaultStdMat()
pm_mat = pymxs.runtime.GetAnimByHandle(mp_mat.AnimHandle)
i = pymxs.runtime.sme.CreateView('mine')
pm_view = pymxs.runtime.sme.GetView(i)
n = pm_view.CreateNode(pm_mat, pymxs.runtime.Point2(0,0))
obj = n.getmxsprop('reference')
MaxPlus.Animatable.GetAnimByHandle(int(pymxs.runtime.GetHandleByAnim(obj)))

something like this 

 

 

 

Message 5 of 5

Anonymous
Not applicable

Thanks Denis,

I didn't know about that, it looks promising.

0 Likes