Itoo Software Forum

Author Topic: Reassign Material?  (Read 2268 times)

jonavark

  • Jr. Member
  • **
  • Posts: 60
Reassign Material?
« on: November 04, 2011, 11:48:25 PM »
I am trying to figure out how materials work in FP. I had done a number of scenes where I used the Blend material and scripted it between the forest_automaterial assigned to a FP obj and a Matte/Shadow material. It seems to be causing crashes on my new scene so I was looking for another way to do this.. basically assign any material and recover the main material at any time.

If I drag a material into a forest object's "Material" button in the roll out, and then attempt to Reassign that object's material should the old material show up in the re-assign button? If so, I can not get this to work for me. When I check the Asset Tracker I see paths for the textures that aren't in my system. I have to manually assign paths for textures to my network. Even though I have the net paths in my setup.

I did a little test with 2 trees. I dragged a standard material onto the slot and then, clicked Reassign Material. FP did reassign an automaterial but it only contains the color ID and no tree material.

Is there a method for getting the FP objects to show up in Matte pass render elements? The occlude when they are black (excluded) but I can not get them to show up white when they are "included" in the matte pass.




I wonder if  it has anything to do with the fact that all of my forest plants and materials are on network folders? Perhaps this is an area where something goes wrong with net paths?




« Last Edit: November 05, 2011, 05:43:40 AM by jonavark »

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3156
    • iToo Software
Re: Reassign Material?
« Reply #1 on: November 05, 2011, 10:38:42 AM »

Ok, i will try to explain how material work:

1) The plugin collects all the materials assigned in the Geometry List (material slot), and creates a multi-sub. It uses instances of the original materials.
2) This multi-sub (automaterial) also includes one standard mat for each color ID of the list. They are used only for display purposes and have not effect in render.
3) The automaterial is assigned automatically to the Forest object, and rebuilt when needed (for example, if you assign a new material in the geom list).
4) The "Reassign" button should be used only if you accidentally assign other material to Forest. In this case, the automaterial exists yet in the scene but it is not assigned to Forest.

So, the right procedure to change a material should be to replace it in the Geometry List. I suggest not to modify directly the automaterial because this would create unexpected results.  Anyways it's safe to edit the automaterial in the material editor, and change the properties of the sub-materials (since they are instances of the original mats), but not replace or overwrite them.

Should not be problem with the net paths, since Forest doesn't modify the textures. It only creates the automaterial, but the source materials and their maps are preserved.

About the matte passes, i forward you question to our 3D artist (he is out of the office until Monday). I'm not expert in this field, so i don't want to give you a wrong reply.

« Last Edit: November 05, 2011, 12:04:37 PM by Itoo »
Carlos Quintero
iToo Software

jonavark

  • Jr. Member
  • **
  • Posts: 60
Re: Reassign Material?
« Reply #2 on: November 05, 2011, 06:55:12 PM »
I understand the material layout. I wanted to get around adding a blend material to every slot of the automaterials so I could script out my passes, some with matte/shadow on the materials.


With regard to the Consolidate and Reassign :

http://www.itoosoft.com/forum/index.php?topic=838.0

I would like to use the method you have described here but it doesn't seem to reassign materials.
If I understand that correctly.

Thanks again for stellar support.




iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3156
    • iToo Software
Re: Reassign Material?
« Reply #3 on: November 05, 2011, 10:13:08 PM »
The procedure would be something as this (i just tested it):

1) Create a Forest object, assign a 3D model from the library (for example "Maple").
2) From the material editor, pick the "maple1" material the scene.
3) Click the "Multi/Sub-Object" button to replace it by a "Blend" material. Reply yes to "Keep old material as sub-material".
4) Replace Material 2 by a "Matte/Shadow/Reflection (mi)".

That's all. Use Mix amount = 0 to render using the true material, and Mix = 100 for the matte. As you can see, it is not necessary to reassign any material to Forest, since the reference of the automaterial to "maple 1" is instanced.

Carlos Quintero
iToo Software

Jose

  • iToo Software
  • Newbie
  • *****
  • Posts: 19
Re: Reassign Material?
« Reply #4 on: November 07, 2011, 09:29:24 AM »
Hi, about the passing of render elements, I do not know if I understand correctly what you want. If you need a occlusion pass, I usually use the following procedure in Vray:

1 .- In the Render elements button Add and choose VRayExtraTex. This channel has a slot to place a texture.
2 .- In this slot I put a texture VRayDirt.
3 .- When the scene will render an Ambient Occlusion pass.

If you need another type of render pass with Forest, please tell me details to study it.
José Antonio Cordón
Itoo Software
www.itoosoft.com
jcordon@itoosoft.com

jonavark

  • Jr. Member
  • **
  • Posts: 60
Re: Reassign Material?
« Reply #5 on: November 07, 2011, 05:00:08 PM »
Thanks Itoo.. that is the procedure I have been using. When you have many plants it is a bit tedious.

Corsam.. what I need is matte passes. When attempting to use the matte render element I found that the FP objects don't show up when 'including' them. They are supposed to render pure white but  they do not show up. They do render when excluded (black) however.

Jose

  • iToo Software
  • Newbie
  • *****
  • Posts: 19
Re: Reassign Material?
« Reply #6 on: November 08, 2011, 11:51:58 AM »
I did some testings with the matte pass render elements in Mental Ray and I reproduced this problem. I agree with you, there is some problem related to Forest and this pass. We will do futher checkings, our develop team is already studying how to solve it.

Meanwhile, you can obtain the same results creating a matte of a Forest pack object by hand, please follow this procedure:

Create two materials standard, a self-illumination white and one black. Apply the white material to the objects included in the material, and the black to all other objects.

Please take care when you assign the material to FP. You have to drag the material from the material editor to the material slot in Forest, as shown in the screenshot attached. Asigning it directly doesn't works because Forest takes materials from base objects.

The scripts that create matte passes usally uses this same process, we suspect that MentalRay matte pass also do the same.

« Last Edit: November 08, 2011, 12:01:03 PM by yuv »
José Antonio Cordón
Itoo Software
www.itoosoft.com
jcordon@itoosoft.com

jonavark

  • Jr. Member
  • **
  • Posts: 60
Re: Reassign Material?
« Reply #7 on: November 08, 2011, 03:50:17 PM »
yes.. thanks! I know I can do that but I have to be able to set my passes up so they're automatically setup prior to render. I have been working towards eliminating the handwork that goes along with creating 20 or so passes of a scene so I can hit my deadlines. I  will look into scripting this.

Thanks again for the matte check. I look forward to the update!