Arnold OSL Shader:
Many Object One Material (MOOM)


Who doesn't love crayons?



Final Renders







Inspiration




			
			

The OSL Code and the MTD File

Shader Code


MTD File


Python Functions

moom_utils.py

init_mooms.mel


Script Editor

1. You have to save the "init_mooms.mel" in the, maya/scripts folder.

2. Go to Render Settings->Render Options Pre-render MEL: and insert this line of code, init_mooms();

The mel script is used to put the workspace directory into the text field because maya reads from the source images folder.

3. Convert the image files in the sourceimages folder to .tx files (use Arnolds TX Manager).

4. For the MOOM shader to function properly, the code below has to be written in a Python window in the Script Editor. Then by selecting the code and pressing the run button, the shader will be assigned. If you're not happy with the results, no worries, all you have to do is highlight the code and run the script again with the elements in the scene highlighted. The shader will randomize the maps every time!


Line #4 was written to select all the crayons in the scene instead of selecting them individually or in the Outliner. This was super helpful since there are so many crayons in the scene. For this to work all the crayons had to be named "crayon_#".






Hypershade - Crayons

When assigning the shader, I seperated the crayons into groups assigned to the box's they were in. This made it easier to select and alter the crayons because there were two different types of labels. This was super beneficial because when I first assigned the shader, I assigned it to all the crayons in the scene. But, I only had the traditional colors imported because I hadn't made the "Colors of the World" maps yet. After the "Colors of the World" maps were created, I selected the aiSS_24crayons node and ran the code above in the script editor. Since there were only 24 crayons, I changed whatever colors that weren't supposed to be in the box individually in the attribute editor under Extra Attrubites > Mtoa Constant TEX.


During my initial renders I found that the colors of the crayons were super saturated. To change this Professor Kesson and I found that if you check the Linearize box on the moom osl node in the Property Editor that the colors will render properly. As you can see the Linearize box is unchecked. This is because after I experimented with WaxRainbow.osl and WaxNude.osl the colors rendered properly.







Hypershade - Crayon Sleeves

When texturing the crayon sleeves in the 96 crayon box, I used the FrontBack shader we developed for a previous SideMask project.





UV Mapping

I created a total of 22 texture maps for the crayons.








Exploration

When developing this shader, I was interested to see if it was possible to seperate the crayon wax texture from their assigned paper labels. Professor Kesson helped me generate a script where I could do just that. The only issue was that since I had two different types of crayons (Regular and Colors of the World), some colors didn't match up with their designated label.


Exploration Renders







The OSL Code

When initially using this shader, instead of putting all 22 colors in one script, I decided to split them up into two, WaxRainbow and WaxNude. I did this so I could control the selection of colors being used in the varrying crayons groups.


Shader Code - WaxRainbow


Shader Code - WaxNude

Hypershade







Final Thoughts

I really enjoyed this project. I struggled to figure out what I wanted to use the shader for because there are so many options. I decided to choose crayons because they are colorful and nostalgic. In the future, I'd like the adjust the labels to a paper texture to make the render more realistic. This shader is super beneficial and I look forward to using it in the future.