Notifications
Clear all

[Closed] Possible to remove extended parameter.??

Hi guys,
Long time ago I have extended the VRayMtl with my custom attributs, now 2 years latter I no more need those extended parameters but all my materials librarie have been build with this costum material plugins. Is there a way that I can reverse this? I need to remove that extended attribut in all my materials…

Regards,

OzRay

8 Replies

No one can answer this? I don’t need the full answer just if it’s fesable…

Bobo maybe?

Regards,
OZRay

probably the extended parameter is some custom attribute. if you know this attribute definition or index you can delete it using custAttributes.delete (see mxs help – > Custom Attributes Management Functions)

if you don’t need any custom attribute you can use:


 while <node>.custAttributes.count > 0 do deleteItem <node>.custAttributes  1
 

Well, this is the original script that have been used on all our material libraries…
So if I have a machine that don’t have this extended material the material doesn’t load cause missing plugin… So how I can convert a material back to basic by removing my costum extended parameters. This was for managing VRay receive and generate GI by material and not by objects.

plugin material VRayUrbanimage
name:“VRay Urbanimage”
classID:#(0x7ca77987, 0x462dc734)
extends:VRayMTL
replaceUI:false
version:1
(
parameters main rollout:params
(
generateGI type:#float ui:generateGI default:1.00
receiveGI type:#float ui:receiveGI default:1.00
)

 rollout params "Extended Urbanimage Attributes" 
 ( 
     spinner generateGI "Generate GI" fieldwidth:50 range:[0.00,100.00,1.00] scale:0.01 align:#center across:2
     spinner receiveGI  "Receive  GI" fieldwidth:50 range:[0.00,100.00,1.00] scale:0.01

     on generateGI changed value do
     (
         objList = #()
         
         for x in $* do
         (
             if x.material == meditmaterials[medit.GetActiveMtlSlot()] do
             (
                 try(
                         setUserProp x "VRay_GI_GenerateMultipier" x.material.generateGI
                         setUserProp x "VRay_GI_Multipier" x.material.receiveGI
                     )
             catch()
             )
         )
     )

     on receiveGI changed value do
     (
         objList = #()
         
         for x in $* do
         (
             if x.material == meditmaterials[medit.GetActiveMtlSlot()] do
             (
                 try(
                         setUserProp x "VRay_GI_GenerateMultipier" x.material.generateGI
                         setUserProp x "VRay_GI_Multipier" x.material.receiveGI
                     )
             catch()
             )
         )
     )
 ) 

)

Your logic is flawed, the problem is the scripted plugin not the parameters. As long as the plugin (classID:#(0x7ca77987, 0x462dc734)) is referenced in the scenes then you will get the missing plugin warnings. Deleting the extended parameters won’t do anything, you must delete all reference to the plugin/material in the scene to make it no longer a part of the scene. So you will need to replace every VrayUrbanimage reference to make it go away.

The easier solution is placing plugins like that on a shared network drive that your plugin.ini points to.

-Eric

So the only way to remove it will be to create a script that loop all objects that have the VRayUrbanimage Materials and copy each parameter to a new VRay Standard material then assign that new material back to the object. ? Can I create a array of all the VrayUrbanimage material in my library?

Regards,
OZRay

2 Replies
(@denist)
Joined: 11 months ago

Posts: 0

try to search in this forum. A month ago i posted how to replace one material with another in the entire scene.
to find all VrayUrbanimage materials use getclassinstances (see help for details)

(@pixel_monkey)
Joined: 11 months ago

Posts: 0

The post denisT is talking about can be found here. You will have to run it on an instance of max that has the plugin installed otherwise you won’t be able to access the parameters from the plugin.

-Eric

thanks a lot guys!
Will give this a try.

Regards,

OZRay