I want to make a material that queries the original for an opacity map, displacement or refraction. Is there any way to get the original material via the shadecontext or something else?
Announcement
Collapse
No announcement yet.
Override Mtl - Get reference to original material?
Collapse
X
-
Hm, not directly. However if the override material is the top-level material, from the ShadeContext you can get a pointer to the INode, from that you can get a pointer to the material, check if it is VRayOverrideMtl material, get the first sub-material, which is the base one, and then try to use that.
This will not work if the override material is inside another material, and not directly attached to the node, but it might still be useful.
Best regards,
VladoI only act like I know everything, Rogers.
-
So that when we do "white" renders for camera approval, we don't have to exclude the glass materials manually. Then sometimes there are trees that use opacity mapped leaves so they can look odd, but going through and fixing those so they render as a 128 white material is a pain in the ass so we skip that. I figured the best place to do it would be a material you can use as the override material, which looks for any opacity maps or refraction and accounts for them.
Comment
-
Originally posted by vlado View PostHm, not directly. However if the override material is the top-level material, from the ShadeContext you can get a pointer to the INode, from that you can get a pointer to the material, check if it is VRayOverrideMtl material, get the first sub-material, which is the base one, and then try to use that.
This will not work if the override material is inside another material, and not directly attached to the node, but it might still be useful.
Best regards,
Vlado
thank you.Best regards,
Jackie Teh
--
3ds Max 2023, V-Ray 7 Hotfix 1 [7.00.05 build 32872]
AMD Ryzen 9 7950X 16-Core Processor@4.50 GHz | 64GB RAM | Nvidia RTX 4090
Website: https://www.sporadicstudio.com
Email: info@sporadicstudio.com
YouTube: https://www.youtube.com/c/SporadicStudio
Comment
Comment