Write Vray Mesh Macro

Hi all!

I was wondering if anyone had any tips on my situation. I have a model with a large amount of geometry on about 10 different layers, separated by material. I am rendering in 3ds MAX. So rather than exporting all the geometry as a dwg and linking it in 3ds MAX, selecting each layer’s objects, creating a vray mesh of them inside rhino and then referencing that mesh in 3ds MAX.

I am looking for a way to expedite the process of creating the mesh of each layer everytime the geometry changes. I was thinking a script that would select each layer’s objects and create a proxy of those objects automatically .Although I am not sure how this works with using vray tools and their dialogue boxes with rhino/ python script.

Any help is appreciated!

@Jarek, is this anything you can help with?

Automating what Daniel described should be doable; however I can’t seem to find any reference on how to use Vray Scripting Object to create Vray mesh file. The command to do that is dialog-only so can’t script/macro that.
@matt_newberg - is there any general reference for Vray for Rhino scripting methods (a list of all available ones and how to use them?) Or in particular ones that deal with proxy meshes ?

–jarek

@Jarek @Daniel_Smith

We do not have any scripting methods to script proxy adding or proxy generation in V-Ray For Rhino."-visProxyObject" can be run via the rhino command line at this time, but “-visWriteVRMesh” requires the interactive GUI. I will add a ticket for scripting -visWriteVRMesh via the command line, and as well as from the scripting methods. Which scripting language (RhinoScript, Python, C++) would you like this added to?

@matt_newberg @Jarek

Thanks so much for the reponses! Being able to script V-Ray commands in Python would awesome.

@matt_newberg, thanks for the info.
I would say both RhinoScript and Python would be great.
Other than asking each time over here, is there a list of currently available RhinoScript methods for VfR that we can look at?

–jarek

There are a few sample scripts that are installed in:

C:\ProgramData\ASGVIS\VfR564\SampleScripts

That would be a good starting point to see how to access some of these scripting functions.

Below is a list of all RhinoScript functions. Some have been obsoleted with age and/or new features. Feel free to ask any questions you have about the methods. There are also others that were added because of special customer requests and might not work in all use cases.

 "GetSceneMaterialNames", dispidGetSceneMaterialNames, GetSceneMaterialNames, VT_EMPTY, VTS_PVARIANT
 "PurgeUnusedMaterials", dispidPurgeUnusedMaterials, PurgeUnusedMaterials, VT_EMPTY, VTS_NONE
 "SetFrameStamp", dispidSetFrameStamp, SetFrameStamp, VT_EMPTY, VTS_WBSTR VTS_BOOL VTS_I4 VTS_I4
 "DeleteMaterial", dispidDeleteMaterial, DeleteMaterial, VT_BOOL, VTS_WBSTR VTS_BOOL 
 "DeleteAllMaterials", dispidDeleteAllMaterials, DeleteAllMaterials, VT_EMPTY, VTS_NONE
 "SaveMaterial", dispidSaveMaterial, SaveMaterial, VT_EMPTY, VTS_WBSTR
 "SaveMaterialToFile", dispidSaveMaterialToFile, SaveMaterialToFile, VT_EMPTY, VTS_WBSTR VTS_WBSTR
 "GetMaterialNameFromVismat", dispidGetMaterialNameFromVismat, GetMaterialNameFromVismat, VT_BSTR, VTS_WBSTR VTS_BOOL
 "SetIrradianceMapMode", dispidSetIrradianceMapMode, SetIrradianceMapMode, VT_EMPTY, VTS_I4
 "SetIrradianceMapAutoSave", dispidSetIrradianceMapAutoSave, SetIrradianceMapAutoSave, VT_EMPTY, VTS_I4
 "SetIrradianceMapDoNotDelete", dispidSetIrradianceMapDoNotDelete, SetIrradianceMapDoNotDelete, VT_EMPTY, VTS_I4
 "SetLightMapMode", dispidSetLightMapMode, SetLightMapMode, VT_EMPTY, VTS_I4
 "SetIrradianceMapFromFile", dispidSetIrradianceMapFromFile, SetIrradianceMapFromFile, VT_EMPTY, VTS_BSTR
 "SetIrradianceMapSaveFile", dispidSetIrradianceMapSaveFile, SetIrradianceMapSaveFile, VT_EMPTY, VTS_BSTR
 "SetLightMapAutoSave", dispidSetLightMapAutoSave, SetLightMapAutoSave, VT_EMPTY, VTS_I4
 "SetLightMapDoNotDelete", dispidSetLightMapDoNotDelete, SetLightMapDoNotDelete, VT_EMPTY, VTS_I4
 "SetLightMapFromFile", dispidSetLightMapFromFile, SetLightMapFromFile, VT_EMPTY, VTS_BSTR
 "SetLightMapSaveFile", dispidSetLightMapSaveFile, SetLightMapSaveFile, VT_EMPTY, VTS_BSTR
 "SetPhotonMapMode", dispidSetPhotonMapMode, SetPhotonMapMode, VT_EMPTY, VTS_I4
 "SetPhotonMapAutoSave", dispidSetPhotonMapAutoSave, SetPhotonMapAutoSave, VT_EMPTY, VTS_I4
 "SetPhotonMapDoNotDelete", dispidSetPhotonMapDoNotDelete, SetPhotonMapDoNotDelete, VT_EMPTY, VTS_I4
 "SetPhotonMapFromFile", dispidSetPhotonMapFromFile, SetPhotonMapFromFile, VT_EMPTY, VTS_BSTR
 "SetPhotonMapSaveFile", dispidSetPhotonMapSaveFile, SetPhotonMapSaveFile, VT_EMPTY, VTS_BSTR
 "SetCausticsMapMode", dispidSetCausticsMapMode, SetCausticsMapMode, VT_EMPTY, VTS_I4
 "SetCausticsMapAutoSave", dispidSetCausticsMapAutoSave, SetCausticsMapAutoSave, VT_EMPTY, VTS_I4
 "SetCausticsMapDoNotDelete", dispidSetCausticsMapDoNotDelete, SetCausticsMapDoNotDelete, VT_EMPTY, VTS_I4
 "SetCausticsMapFromFile", dispidSetCausticsMapFromFile, SetCausticsMapFromFile, VT_EMPTY, VTS_BSTR
 "SetCausticsMapSaveFile", dispidSetCausticsMapSaveFile, SetCausticsMapSaveFile, VT_EMPTY, VTS_BSTR
 "SetRenderOutputEnable", dispidSetRenderOutputEnable, SetRenderOutputEnable, VT_EMPTY, VTS_I4
 "SetRenderVRImageEnable", dispidSetRenderVRImageEnable, SetRenderVRImageEnable, VT_EMPTY, VTS_I4
 "SetRenderOutputSaveFile", dispidSetRenderOutputSaveFile, SetRenderOutputSaveFile, VT_EMPTY, VTS_BSTR
 "SetRenderVRImageSaveFile", dispidSetRenderVRImageSaveFile, SetRenderVRImageSaveFile, VT_EMPTY, VTS_BSTR
 "SetAnimationOn", dispidSetAnimationOn, SetAnimationOn, VT_EMPTY, VTS_I4
 "SetAnimationType", dispidSetAnimationType, SetAnimationType, VT_EMPTY, VTS_I4 VTS_I4
 "SetReflectionOn", dispidSetReflectionOn, SetReflectionOn, VT_EMPTY, VTS_BOOL
 "SetMaxDepthOn", dispidSetMaxDepthOn, SetMaxDepthOn, VT_EMPTY, VTS_BOOL VTS_I4
 "SetTransparentLevelsAndCutoff", dispidSetTransparentLevelsAndCutoff, SetTransparentLevelsAndCutoff, VT_EMPTY, VTS_I4 VTS_R4
 "SetMapsOn", dispidSetMapsOn, SetMapsOn, VT_EMPTY, VTS_BOOL
 "SetFilterMapsOn", dispidSetFilterMapsOn, SetFilterMapsOn, VT_EMPTY, VTS_BOOL
 "SetGlossyEffectsOn", dispidSetGlossyEffectsOn, SetGlossyEffectsOn, VT_EMPTY, VTS_BOOL
 "DoNotRenderFinalImage", dispidDoNotRenderFinalImage, DoNotRenderFinalImage, VT_EMPTY, VTS_BOOL
 "SetBatchRenderOn", dispidSetBatchRenderOn, SetBatchRenderOn, VT_EMPTY, VTS_BOOL
 "SetThreadPriorityOn", dispidSetThreadPriorityOn, SetThreadPriorityOn, VT_EMPTY, VTS_BOOL
 "SetProgressWindowOn", dispidSetProgressWindowOn, SetProgressWindowOn, VT_EMPTY, VTS_BOOL
 "SetLightsOn", dispidSetLightsOn, SetLightsOn, VT_EMPTY, VTS_BOOL
 "SetHiddenLightsOn", dispidSetHiddenLightsOn, SetHiddenLightsOn, VT_EMPTY, VTS_BOOL
 "SetDefaultLightsOn", dispidSetDefaultLightsOn, SetDefaultLightsOn, VT_EMPTY, VTS_BOOL
 "SetShadowsOn", dispidSetShadowsOn, SetShadowsOn, VT_EMPTY, VTS_BOOL
 "SetOnlyGIOn", dispidSetOnlyGIOn, SetOnlyGIOn, VT_EMPTY, VTS_BOOL
 "SetGammaCorrectionOutput", dispidSetGammaCorrectionOutput,SetGammaCorrectionOutput, VT_EMPTY, VTS_R4
 "SetCorrectRGBOn", dispidSetCorrectRGBOn, SetCorrectRGBOn, VT_EMPTY, VTS_BOOL
 "SetCorrectLDROn", dispidSetCorrectLDROn, SetCorrectLDROn, VT_EMPTY, VTS_BOOL
 "SetFixedRateSubdivs", dispidSetFixedRateSubdivs, SetFixedRateSubdivs, VT_EMPTY, VTS_I4
 "SetAdaptiveDMCMinMaxSubdivs", dispidSetAdaptiveDMCMinMaxSubdivs, SetAdaptiveDMCMinMaxSubdivs, VT_EMPTY, VTS_I4 VTS_I4
 "SetAdaptiveDMCNoiseThreshold", dispidSetAdaptiveDMCNoiseThreshold, SetAdaptiveDMCNoiseThreshold, VT_EMPTY, VTS_R4
 "SetAdaptiveSubdivisionMinMaxRate", dispidSetAdaptiveSubdivisionMinMaxRate, SetAdaptiveSubdivisionMinMaxRate, VT_EMPTY, VTS_I4 VTS_I4
 "SetAdaptiveSubdivisionThreshold", dispidSetAdaptiveSubdivisionThreshold, SetAdaptiveSubdivisionThreshold, VT_EMPTY, VTS_R4
 "SetAdaptiveSubdivisionNormals", dispidSetAdaptiveSubdivisionNormals, SetAdaptiveSubdivisionNormals, VT_EMPTY, VTS_BOOL VTS_R4
 "SetAdaptiveSubdivisionSamples", dispidSetAdaptiveSubdivisionSamples, SetAdaptiveSubdivisionSamples, VT_EMPTY, VTS_BOOL
 "SetAntialiasingFilterOn", dispidSetAntialiasingFilterOn, SetAntialiasingFilterOn, VT_EMPTY, VTS_BOOL VTS_I4 VTS_R4
 "SetDMCAdaptiveAmount", dispidSetDMCAdaptiveAmount, SetDMCAdaptiveAmount, VT_EMPTY, VTS_R4
 "SetDMCMinimumSamples", dispidSetDMCMinimumSamples, SetDMCMinimumSamples, VT_EMPTY, VTS_I4
 "SetDMCNoiseThreshold", dispidSetDMCNoiseThreshold, SetDMCNoiseThreshold, VT_EMPTY, VTS_R4
 "SetDMCSubdivisionMultiplier", dispidSetDMCSubdivisionMultiplier, SetDMCSubdivisionMultiplier, VT_EMPTY, VTS_R4
 "SetDMCPathSampler", dispidSetDMCPathSampler, SetDMCPathSampler, VT_EMPTY, VTS_I4
 "SetColorMappingLinear", dispidSetColorMappingLinear, SetColorMappingLinear, VT_EMPTY, VTS_R4 VTS_R4
 "SetColorMappingExponential", dispidSetColorMappingExponential, SetColorMappingExponential, VT_EMPTY, VTS_R4 VTS_R4
 "SetColorMappingHSVExponential", dispidSetColorMappingHSVExponential, SetColorMappingHSVExponential, VT_EMPTY, VTS_R4 VTS_R4
 "SetColorMappingIntensityExponential", dispidSetColorMappingIntensityExponential, SetColorMappingIntensityExponential, VT_EMPTY, VTS_R4 VTS_R4
 "SetColorMappingGammaCorrection", dispidSetColorMappingGammaCorrection, SetColorMappingGammaCorrection, VT_EMPTY, VTS_R4 VTS_R4
 "SetColorMappingIntensityGamma", dispidSetColorMappingIntensityGamma, SetColorMappingIntensityGamma, VT_EMPTY, VTS_R4 VTS_R4
 "SetColorMappingReinhard", dispidSetColorMappingReinhard, SetColorMappingReinhard, VT_EMPTY, VTS_R4 VTS_R4
 "SetColorMappingAffectBackgroundOn", dispidSetColorMappingAffectBackgroundOn, SetColorMappingAffectBackgroundOn, VT_EMPTY, VTS_BOOL
 "SetColorMappingClampOutputOn", dispidSetColorMappingClampOutputOn, SetColorMappingClampOutputOn, VT_EMPTY, VTS_BOOL
 "SetColorMappingSubpixelOn", dispidSetColorMappingSubpixelOn, SetColorMappingSubpixelOn, VT_EMPTY, VTS_BOOL
 "SetDisplacementEdgeLength", dispidSetDisplacementEdgeLength, SetDisplacementEdgeLength, VT_EMPTY, VTS_R4
 "SetDisplacementMaxSubdivs", dispidSetDisplacementMaxSubdivs, SetDisplacementMaxSubdivs, VT_EMPTY, VTS_I4
 "SetDisplacementAmount", dispidSetDisplacementAmount, SetDisplacementAmount, VT_EMPTY, VTS_R4
 "SetDisplacementRelativeTobboxOn", dispidSetDisplacementRelativeTobboxOn, SetDisplacementRelativeTobboxOn, VT_EMPTY, VTS_BOOL
 "SetDisplacementViewDependentOn", dispidSetDisplacementViewDependentOn, SetDisplacementViewDependentOn, VT_EMPTY, VTS_BOOL
 "SetDisplacementTightBoundsOn", dispidSetDisplacementTightBoundsOn, SetDisplacementTightBoundsOn, VT_EMPTY, VTS_BOOL
 "SetDMCGISubdivisions", dispidSetDMCGISubdivisions, SetDMCGISubdivisions, VT_EMPTY, VTS_I4
 "SetDMCGISecondaryBounces", dispidSetDMCGISecondaryBounces, SetDMCGISecondaryBounces, VT_EMPTY, VTS_I4
 "SetGIOn", dispidSetGIOn, SetGIOn, VT_EMPTY, VTS_BOOL
 "SetGIReflectCausticsOn", dispidSetGIReflectCausticsOn, SetGIReflectCausticsOn, VT_EMPTY, VTS_BOOL
 "SetGIRefractCausticsOn", dispidSetGIRefractCausticsOn, SetGIRefractCausticsOn, VT_EMPTY, VTS_BOOL
 "SetPostProcessingSaturation", dispidSetPostProcessingSaturation, SetPostProcessingSaturation, VT_EMPTY, VTS_R4
 "SetPostProcessingContrast", dispidSetPostProcessingContrast, SetPostProcessingContrast, VT_EMPTY, VTS_R4
 "SetPostProcessingContrastBase", dispidSetPostProcessingContrastBase, SetPostProcessingContrastBase, VT_EMPTY, VTS_R4
 "SetSaveMapsPerFrameOn", dispidSetSaveMapsPerFrameOn, SetSaveMapsPerFrameOn, VT_EMPTY, VTS_BOOL
 "SetPrimaryEngine", dispidSetPrimaryEngine, SetPrimaryEngine, VT_EMPTY, VTS_R4 VTS_I4
 "SetSecondaryEngine", dispidSetSecondaryEngine, SetSecondaryEngine, VT_EMPTY, VTS_R4 VTS_I4
 "AddVFBChannelByName", dispidAddVFBChannelByName, AddVFBChannelByName, VT_EMPTY, VTS_BSTR
 "RemoveVFBChannelByName", dispidRemoveVFBChannelByName, RemoveVFBChannelByName, VT_EMPTY, VTS_BSTR

 "SetIrradianceMapMinMaxRate", dispidSetIrradianceMapMinMaxRate, SetIrradianceMapMinMaxRate, VT_EMPTY, VTS_I4 VTS_I4
 "SetIrradianceMapHSubdivisions", dispidSetIrradianceMapHSubdivisions, SetIrradianceMapHSubdivisions, VT_EMPTY, VTS_I4
 "SetIrradianceMapSamples", dispidSetIrradianceMapSamples, SetIrradianceMapSamples, VT_EMPTY, VTS_I4
 "SetIrradianceMapColorThreshold", dispidSetIrradianceMapColorThreshold, SetIrradianceMapColorThreshold, VT_EMPTY, VTS_R4
 "SetIrradianceMapNormalThreshold", dispidSetIrradianceMapNormalThreshold, SetIrradianceMapNormalThreshold, VT_EMPTY, VTS_R4
 "SetIrradianceMapDistanceThreshold", dispidSetIrradianceMapDistanceThreshold, SetIrradianceMapDistanceThreshold, VT_EMPTY, VTS_R4
 "SetIrradianceMapShowSamples", dispidSetIrradianceMapShowSamples, SetIrradianceMapShowSamples, VT_EMPTY, VTS_BOOL
 "SetIrradianceMapShowCalc", dispidSetIrradianceMapShowCalc, SetIrradianceMapShowCalc, VT_EMPTY, VTS_BOOL
 "SetIrradianceMapMultiPass", dispidSetIrradianceMapMultiPass, SetIrradianceMapMultiPass, VT_EMPTY, VTS_BOOL
 "SetIrradianceMapClearCurrentMap", dispidSetIrradianceMapClearCurrentMap, SetIrradianceMapClearCurrentMap, VT_EMPTY, VTS_NONE
 "SetIrradianceMapDetailEnhancementOn", dispidSetIrradianceMapDetailEnhancementOn, SetIrradianceMapDetailEnhancementOn, VT_EMPTY, VTS_BOOL
 "SetIrradianceMapDetailEnhancementRadius", dispidSetIrradianceMapDetailEnhancementRadius, SetIrradianceMapDetailEnhancementRadius, VT_EMPTY, VTS_R4
 "SetIrradianceMapDetailEnhancementSubdivision", dispidSetIrradianceMapDetailEnhancementSubdivision, SetIrradianceMapDetailEnhancementSubdivision, VT_EMPTY, VTS_R4
 "SetLightMapSubdivisions", dispidSetLightMapSubdivisions, SetLightMapSubdivisions, VT_EMPTY, VTS_I4
 "SetLightMapScale", dispidSetLightMapScale, SetLightMapScale, VT_EMPTY, VTS_I4
 "SetLightMapSampleSize", dispidSetLightMapSampleSize, SetLightMapSampleSize, VT_EMPTY, VTS_R4
 "SetLightMapPhases", dispidSetLightMapPhases, SetLightMapPhases, VT_EMPTY, VTS_I4
 "SetLightMapStoreDirectLightOn", dispidSetLightMapStoreDirectLightOn, SetLightMapStoreDirectLightOn, VT_EMPTY, VTS_BOOL
 "SetLightMapShowCalcOn", dispidSetLightMapShowCalcOn, SetLightMapShowCalcOn, VT_EMPTY, VTS_BOOL
 "SetLightMapUseForGlossyRaysOn", dispidSetLightMapUseForGlossyRaysOn, SetLightMapUseForGlossyRaysOn, VT_EMPTY, VTS_BOOL
 "SetLightMapClearCurrentMap", dispidSetLightMapClearCurrentMap, SetLightMapClearCurrentMap, VT_EMPTY, VTS_NONE
 "SetCameraType", dispidSetCameraType, SetCameraType, VT_EMPTY, VTS_I4
 "SetCameraFOVOn", dispidSetCameraFOVOn, SetCameraFOVOn, VT_EMPTY, VTS_BOOL VTS_R4
 "SetPhysicalCameraOn", dispidSetPhysicalCameraOn, SetPhysicalCameraOn, VT_EMPTY, VTS_BOOL
 "SetPhysicalCameraType", dispidSetPhysicalCameraType, SetPhysicalCameraType, VT_EMPTY, VTS_I4
 "SetPhysicalCameraShutterSpeed", dispidSetPhysicalCameraShutterSpeed, SetPhysicalCameraShutterSpeed, VT_EMPTY, VTS_R4
 "SetPhysicalCameraFNumber", dispidSetPhysicalCameraFNumber, SetPhysicalCameraFNumber, VT_EMPTY, VTS_R4
 "SetPhysicalCameraISO", dispidSetPhysicalCameraISO, SetPhysicalCameraISO, VT_EMPTY, VTS_R4
 "SetPhysicalCameraWhiteBalance", dispidSetPhysicalCameraWhiteBalance, SetPhysicalCameraWhiteBalance, VT_EMPTY, VTS_R4 VTS_R4 VTS_R4
 "SetPhysicalCameraExposureOn", dispidSetPhysicalCameraExposureOn, SetPhysicalCameraExposureOn, VT_EMPTY, VTS_I4
 "SetPhysicalCameraVignettingOn", dispidSetPhysicalCameraVignettingOn, SetPhysicalCameraVignettingOn, VT_EMPTY, VTS_I4
 "SetDepthOfFieldOn", dispidSetDepthOfFieldOn, SetDepthOfFieldOn, VT_EMPTY, VTS_BOOL
 "SetDepthOfFieldAperture", dispidSetDepthOfFieldAperture, SetDepthOfFieldAperture, VT_EMPTY, VTS_R4
 "SetDepthOfFieldSidesOn", dispidSetDepthOfFieldSidesOn, SetDepthOfFieldSidesOn, VT_EMPTY, VTS_BOOL VTS_I4
 "SetDepthOfFieldSubdivision", dispidSetDepthOfFieldSubdivision, SetDepthOfFieldSubdivision, VT_EMPTY, VTS_I4
 "SetRenderOutputSize", dispidSetRenderOutputSize, SetRenderOutputSize, VT_EMPTY, VTS_I4 VTS_I4
 "SetRenderOutputPixelAspect", dispidSetRenderOutputPixelAspect, SetRenderOutputPixelAspect, VT_EMPTY, VTS_R4
 "SetDistributedRenderingOn", dispidSetDistributedRenderingOn, SetDistributedRenderingOn, VT_EMPTY, VTS_BOOL
 "SetDistributedRenderingAddServer", dispidSetDistributedRenderingAddServer, SetDistributedRenderingAddServer, VT_EMPTY, VTS_BSTR
 "SetDistributedRenderingAssetCollectionOn", dispidSetDistributedRenderingAssetCollectionOn, SetDistributedRenderingAssetCollectionOn, VT_EMPTY, VTS_BOOL
 "GetIrradianceMapMinMaxRate", dispidGetIrradianceMapMinMaxRate, GetIrradianceMapMinMaxRate, VT_EMPTY, VTS_PVARIANT VTS_PVARIANT
 "GetIrradianceMapHSubdivisions", dispidGetIrradianceMapHSubdivisions, GetIrradianceMapHSubdivisions, VT_I4, VTS_NONE
 "GetIrradianceMapSamples", dispidGetIrradianceMapSamples, GetIrradianceMapSamples, VT_I4, VTS_NONE
 "GetIrradianceMapColorThreshold", dispidGetIrradianceMapColorThreshold, GetIrradianceMapColorThreshold, VT_R4, VTS_NONE
 "GetIrradianceMapNormalThreshold", dispidGetIrradianceMapNormalThreshold, GetIrradianceMapNormalThreshold, VT_R4, VTS_NONE
 "GetIrradianceMapDistanceThreshold", dispidGetIrradianceMapDistanceThreshold, GetIrradianceMapDistanceThreshold, VT_R4, VTS_NONE
 "GetLightMapSubdivisions", dispidGetLightMapSubdivisions, GetLightMapSubdivisions, VT_I4, VTS_NONE
 "GetLightMapSampleSize", dispidGetLightMapSampleSize, GetLightMapSampleSize, VT_R4, VTS_NONE
 "GetLightMapPhases", dispidGetLightMapPhases, GetLightMapPhases, VT_R4, VTS_NONE
 "GetRenderOutputSize", dispidGetRenderOutputSize, GetRenderOutputSize, VT_EMPTY, VTS_PVARIANT  VTS_PVARIANT
 "GetRenderOutputPixelAspect", dispidGetRenderOutputPixelAspect, GetRenderOutputPixelAspect, VT_R4, VTS_NONE
 "GetCameraType", dispidGetCameraType, GetCameraType, VT_I4, VTS_NONE
 "GetCameraFOVAngle", dispidGetCameraFOVAngle, GetCameraFOVAngle, VT_R4, VTS_NONE
 "GetPhysicalCameraType", dispidGetPhysicalCameraType, GetPhysicalCameraType, VT_I4, VTS_NONE
 "GetPhysicalCameraShutterSpeed", dispidGetPhysicalCameraShutterSpeed, GetPhysicalCameraShutterSpeed, VT_R4, VTS_NONE
 "GetPhysicalCameraFNumber", dispidGetPhysicalCameraFNumber, GetPhysicalCameraFNumber, VT_R4, VTS_NONE
 "GetPhysicalCameraISO", dispidGetPhysicalCameraISO, GetPhysicalCameraISO, VT_R4, VTS_NONE
 "GetPhysicalCameraWhiteBalance", dispidGetPhysicalCameraWhiteBalance, GetPhysicalCameraWhiteBalance, VT_EMPTY, VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT
 "GetDepthOfFieldAperture", dispidGetDepthOfFieldAperture, GetDepthOfFieldAperture, VT_R4, VTS_NONE
 "GetDepthOfFieldSides", dispidGetDepthOfFieldSides, GetDepthOfFieldSides, VT_I4, VTS_NONE
 "GetDepthOfFieldSubdivisions", dispidGetDepthOfFieldSubdivisions, GetDepthOfFieldSubdivisions, VT_I4, VTS_NONE
 "AddResourceSearchPath", dispidAddResourceSearchPath, AddResourceSearchPath, VT_EMPTY, VTS_BSTR 
 "SaveVisopt", dispidSaveVisopt, SaveVisopt, VT_EMPTY, VTS_BSTR 
 "SetObjectExclusionForMaterial", dispidSetObjectExclusionForMaterial, SetObjectExclusionForMaterial, VT_BOOL, VTS_BSTR VTS_BOOL 
 "GetObjectExclusionForMaterial", dispidGetObjectExclusionForMaterial, GetObjectExclusionForMaterial, VT_BOOL, VTS_BSTR 
 "SetAlphaContributionForMaterial", dispidSetAlphaContributionForMaterial, SetAlphaContributionForMaterial, VT_BOOL, VTS_BSTR VTS_R4 
 "GetAlphaContributionForMaterial", dispidGetAlphaContributionForMaterial, GetAlphaContributionForMaterial, VT_R4, VTS_BSTR 
 "GetPrimaryEngineSettings", dispidGetPrimaryEngineSettings, GetPrimaryEngineSettings, VT_EMPTY, VTS_PVARIANT  VTS_PVARIANT 
 "GetSecondaryEngineSettings", dispidGetSecondaryEngineSettings, GetSecondaryEngineSettings, VT_EMPTY, VTS_PVARIANT VTS_PVARIANT 
 "GetCausticsOn", dispidGetCausticsOn, GetCausticsOn, VT_BOOL, VTS_NONE 
 "GetDependentMapsForVismat", dispidGetDependentMapsForVismat, GetDependentMapsForVismat, VT_BOOL, VTS_BSTR VTS_PVARIANT 
 "GetDependentMapsForVisopt", dispidGetDependentMapsForVisopt, GetDependentMapsForVisopt, VT_BOOL, VTS_BSTR VTS_PVARIANT 
 "GetObjectExclusionShortCircuitForMaterial", dispidGetObjectExclusionShortCircuitForMaterial, GetObjectExclusionShortCircuitForMaterial, VT_BOOL, VTS_BSTR 
 "SetObjectExclusionShortCircuitForMaterial", dispidSetObjectExclusionShortCircuitForMaterial, SetObjectExclusionShortCircuitForMaterial, VT_BOOL, VTS_BSTR VTS_BOOL 
 "GetCameraFOVOn", dispidGetCameraFOVOn, GetCameraFOVOn, VT_BOOL, VTS_NONE 
 "GetPhysicalCameraOn", dispidGetPhysicalCameraOn, GetPhysicalCameraOn, VT_BOOL, VTS_NONE 
 "GetPhysicalCameraExposureOn", dispidGetPhysicalCameraExposureOn, GetPhysicalCameraExposureOn, VT_BOOL, VTS_NONE 
 "GetPhysicalCameraVignettingOn", dispidGetPhysicalCameraVignettingOn, GetPhysicalCameraVignettingOn, VT_BOOL, VTS_NONE 
 "GetDepthOfFieldOn", dispidGetDepthOfFieldOn, GetDepthOfFieldOn, VT_BOOL, VTS_NONE 
 "GetDepthOfFieldSidesOn", dispidGetDepthOfFieldSidesOn, GetDepthOfFieldSidesOn, VT_BOOL, VTS_NONE 
 "SetDepthOfFieldFocalDistOn", dispidSetDepthOfFieldFocalDistOn, SetDepthOfFieldFocalDistOn, VT_EMPTY, VTS_BOOL VTS_R4 
 "GetDepthOfFieldFocalDistOn", dispidGetDepthOfFieldFocalDistOn, GetDepthOfFieldFocalDistOn, VT_BOOL, VTS_NONE 
 "GetDepthOfFieldFocalDist", dispidGetDepthOfFieldFocalDist, GetDepthOfFieldFocalDist, VT_R4, VTS_NONE 
 "SetPhysicalCameraLensShift", dispidSetPhysicalCameraLensShift, SetPhysicalCameraLensShift, VT_EMPTY, VTS_R4 
 "GetPhysicalCameraLensShift", dispidGetPhysicalCameraLensShift, GetPhysicalCameraLensShift, VT_R4, VTS_NONE 
 "SetZdepthBlackVal", dispidSetZdepthBlackVal, SetZdepthBlackVal, VT_EMPTY, VTS_R4 
 "GetZdepthBlackVal", dispidGetZdepthBlackVal, GetZdepthBlackVal, VT_R4, VTS_NONE 
 "SetZdepthWhiteVal", dispidSetZdepthWhiteVal, SetZdepthWhiteVal, VT_EMPTY, VTS_R4 
 "GetZdepthWhiteVal", dispidGetZdepthWhiteVal, GetZdepthWhiteVal, VT_R4, VTS_NONE 
 "SetZdepthClamp", dispidSetZdepthClamp, SetZdepthClamp, VT_EMPTY, VTS_BOOL 
 "GetZdepthClamp", dispidGetZdepthClamp, GetZdepthClamp, VT_BOOL, VTS_NONE 
 "ApplyWrapperMaterialToSelection", dispidApplyWrapperMaterialToSelection, ApplyWrapperMaterialToSelection, VT_BOOL, VTS_BSTR 
 "LoadVisopt", dispidLoadVisopt, LoadVisopt, VT_EMPTY, VTS_BSTR 
 "LoadVismat", dispidLoadVismat, LoadVismat, VT_EMPTY, VTS_BSTR 
 "LoadDirectoryOfVismats", dispidLoadDirectoryOfVismats, LoadDirectoryOfVismats, VT_EMPTY, VTS_BSTR 
 "SetRTEngineOn", dispidSetRTEngineOn, SetRTEngineOn, VT_EMPTY, VTS_BOOL	
 "ThisIsATest", dispidThisIsATest, ThisIsATest, VT_EMPTY, VTS_NONE
 "LaunchDR", dispidLaunchDR, LaunchDR, VT_BOOL, VTS_NONE
 "SetDistributedRenderServerEnabled", dispidSetDistributedRenderServerEnabled, SetDistributedRenderServerEnabled, VT_EMPTY, VTS_BSTR VTS_BOOL
 "CancelRender", dispidCancelRender, CancelRender, VT_EMPTY, VTS_NONE 
 "SetMaterialParameterFloat", dispidSetMaterialParameterFloat, SetMaterialParameterFloat, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_R4 
 "SetMaterialParameterBool", dispidSetMaterialParameterBool, SetMaterialParameterBool, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_BOOL 
 "SetMaterialParameterInteger", dispidSetMaterialParameterInteger, SetMaterialParameterInteger, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_I4 
 "GetMaterialParameterFloat", dispidGetMaterialParameterFloat, GetMaterialParameterFloat, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "GetMaterialParameterBool", dispidGetMaterialParameterBool, GetMaterialParameterBool, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "GetMaterialParameterInteger", dispidGetMaterialParameterInteger, GetMaterialParameterInteger, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "GetSceneMaterialNamesScript", dispidGetSceneMaterialNamesScript, GetSceneMaterialNamesScript, VT_EMPTY, VTS_PVARIANT
 "SetMaterialParameterCompTransform", dispidSetMaterialParameterCompTransform, SetMaterialParameterCompTransform, VT_BOOL, VTS_BSTR VTS_BSTR VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4
 "GetMaterialParameterCompTransform", dispidGetMaterialParameterCompTransform, GetMaterialParameterCompTransform, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT

 "SetLightParameterFloat", dispidSetLightParameterFloat, SetLightParameterFloat, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_R4 
 "SetLightParameterBool", dispidSetLightParameterBool, SetLightParameterBool, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_BOOL 
 "SetLightParameterInteger", dispidSetLightParameterInteger, SetLightParameterInteger, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_I4 
 "GetLightParameterFloat", dispidGetLightParameterFloat, GetLightParameterFloat, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "GetLightParameterBool", dispidGetLightParameterBool, GetLightParameterBool, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "GetLightParameterInteger", dispidGetLightParameterInteger, GetLightParameterInteger, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "SetLightParameterCompTransform", dispidSetLightParameterCompTransform, SetLightParameterCompTransform, VT_BOOL, VTS_BSTR VTS_BSTR VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4
 "GetLightParameterCompTransform", dispidGetLightParameterCompTransform, GetLightParameterCompTransform, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT
 "SetLightParameterString", dispidSetLightParameterString, SetLightParameterString, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR
 "GetLightParameterString", dispidGetLightParameterString, GetLightParameterString, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_PVARIANT
 "SetMaterialParameterString", dispidSetMaterialParameterString, SetMaterialParameterString, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR
 "GetMaterialParameterString", dispidGetMaterialParameterString, GetMaterialParameterString, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_PVARIANT
 "SetSettingsParameterFloat", dispidSetSettingsParameterFloat, SetSettingsParameterFloat, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_R4 
 "SetSettingsParameterBool", dispidSetSettingsParameterBool, SetSettingsParameterBool, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_BOOL 
 "SetSettingsParameterInteger", dispidSetSettingsParameterInteger, SetSettingsParameterInteger, VT_EMPTY, VTS_BSTR VTS_BSTR VTS_I4 
 "GetSettingsParameterFloat", dispidGetSettingsParameterFloat, GetSettingsParameterFloat, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "GetSettingsParameterBool", dispidGetSettingsParameterBool, GetSettingsParameterBool, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "GetSettingsParameterInteger", dispidGetSettingsParameterInteger, GetSettingsParameterInteger, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT 
 "SetSettingsParameterString", dispidSetSettingsParameterString, SetSettingsParameterString, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR
 "GetSettingsParameterString", dispidGetSettingsParameterString, GetSettingsParameterString, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_PVARIANT
 "SetSettingsParameterCompTransform", dispidSetSettingsParameterCompTransform, SetSettingsParameterCompTransform, VT_BOOL, VTS_BSTR VTS_BSTR VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4 VTS_R4
 "GetSettingsParameterCompTransform", dispidGetSettingsParameterCompTransform, GetSettingsParameterCompTransform, VT_BOOL, VTS_BSTR VTS_BSTR VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT
 "SetMaterialParameterAColor", dispidSetMaterialParameterAColor, SetMaterialParameterAColor, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_R4 VTS_R4 VTS_R4 VTS_R4
 "GetMaterialParameterAColor", dispidGetMaterialParameterAColor, GetMaterialParameterAColor, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT
 "SetMaterialParameterColor", dispidSetMaterialParameterColor, SetMaterialParameterColor, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_R4 VTS_R4 VTS_R4
 "GetMaterialParameterColor", dispidGetMaterialParameterColor, GetMaterialParameterColor, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT
 "SetSettingsParameterAColor", dispidSetSettingsParameterAColor, SetSettingsParameterAColor, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_R4 VTS_R4 VTS_R4 VTS_R4
 "GetSettingsParameterAColor", dispidGetSettingsParameterAColor, GetSettingsParameterAColor, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT
 "SetSettingsParameterColor", dispidSetSettingsParameterColor, SetSettingsParameterColor, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_R4 VTS_R4 VTS_R4
 "GetSettingsParameterColor", dispidGetSettingsParameterColor, GetSettingsParameterColor, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT

There is also a .NET interface dll in C:\ProgramData\ASGVIS\VfR564\VRayForRhinoNETInterface.dll. The DLL can be used with C Sharp or Python to access various functions in V-Ray.

great, thanks Matt!

–jarek

Hi Daniel,

So far with no method or command line option to save Vray Meshes from Rhino I don’t know how to implement the process you described (as soon as we have the method available, it should work well). But maybe you can use the semi-automated way. See attached script. The workflow could be like this:

  1. In Rhino, select the objects you want to update / export as Vray Mesh
  2. Run the script - it will extract the render meshes and join them per-layer (with this script, you should not worry about selecting only meshable geometry, you can just select all on the layers you need to update) - then you will be prompted for the Export file – use OBJ format with the settings below – the script names meshes per layer name. It will export and delete the temporary joined meshes
  3. In Max - import OBJ objects and export them as individual Vray meshes. If you did that step before and auto-created proxies, just overwrite the meshes in the previous folder. In that case, it is better to start this is a new MAX file.

This could be tweaked for smoother workflow both on Rhino and MAX end, but hope it is a start.

–jarek

JoinRenderMeshByLayerAndExport.rvb (2.2 KB)

If exporting the mesh is an option, you can use the exe install in c:\ProgramData\ASGVIS\Tools\x64\ply2vrmesh to convert the obj to vrmesh. With a simple rhinoscript you could export .obj and convert to a vrmesh with one button click.

It would be interesting to know what kind of project that is requiring a large number of vrmesh files.

Know this is an old topic but is there an updated list of rhino script functions for vray?

Yeah, I want to revive this thread and ask were to find the list of method for python scripting.

Thanks!

There isn’t a complete list that I know of, but depending on what you want to achieve I might be able to send you some sample scripts. All scene parameters and material parameters for example can be accessed through python. You might also take a look at the V-Ray scripts I placed on my github to get an idea how it works.

There is a object model documentation that comes with V-Ray:
C:\Program Files\Chaos Group\V-Ray\V-Ray for Rhinoceros\VRayForRhinoObjectModel.html

in general python has reflection methods, so you can get a list of callables of a given object with code:

import rhVRay as vray

d = vray.__dict__
c = [ m for m in d if callable(d[m])]
print(c)

There are other such methods to determine if a member is an object, function, type, etc
I strongly advice against using that methods since we have docs.
This is how I usually proceed if I don’t have docs

1 Like