Is it possible in the App SDK to export a material from a Houdini path similar to vray.utils.exportMaterial("") in VRay for Maya's Post Translate?
Announcement
Collapse
No announcement yet.
AppSDK: Export Material
Collapse
X
-
AppSDK could export anything.
https://docs.chaosgroup.com/vray_app...on27/vray.html
There is an export() method which accepts "pluginExportList" argument to export only particular plugins.
-
But how would I export a material that isn't assigned to anything in Houdini for later doing the assignments in the App SDK?
In Maya I would:
import vray.utils as vr
mat = vr.exportMaterial('myMaterial') ## export material from Maya to VRay, that isnt assigned to anything in the scene
node.set('material', mat) ## assign that material to a Node in the VRay sceneJacob Børsting
Head of Pipeline @ Ghost VFX
Comment
-
Ah, so you don't need to export it to the vrscene file?
> But how would I export a material that isn't assigned to anything in Houdini
There is Object -> Force Materials list.
Then you can get plugin by name, it's usually just the node path with / converted to | (like /mat/vrayMtl1 -> |mat|vrayMtl1).
We could add such API at some point...
Comment
-
But unfortunately this:
Code:node.set('material', mat) ## assign that material to a Node in the VRay scene
We heavily use Instancer2 plugin and material is set via Instancer2 "instances" list item...
Comment
-
I've added exportMaterial() API to the next nightly build...
The only difference will be material assignment (regarding the info the in previous post):
Code:import vray r = vray.VRayRenderer() matPluginName = self.exportMaterial("/mat/vrayMaterialBuilder") objNode = r.plugins["|obj|box1|node"] objNode.geometry.instances_material_override = r.plugins[matPluginName]
Code:self.exportMaterial("/path/to/mat")
Code:_vfh_ipr.exportMaterial(rop="/path/to/this/rop", mat="/path/to/mat")
Last edited by bdancer; 17-08-2020, 07:27 AM.
Comment
-
> How do you duplicate a Plugin node in the App SDK?
If there is no such method here https://docs.chaosgroup.com/vray_app...n27/index.html then probably no....
Comment
-
Hi jbvfx,
We have plans to add utility functions to copy/clone/duplicate plugin instances from one renderer instance to another but that would work in the same renderer too. But we haven't done it so far. So currently the solution would be to write a helper method yourself. it's pretty straightforward if you don't use animated/interpolated params but it's not very hard even if you do. Here is a sample function which duplicates a plugin in the simples case when there are no animated params:
Code:def duplicatePlugin(plugin, newPluginName): newPlugin = plugin.getClass()(newPluginName) for propName in newPlugin: if plugin.getMeta(propName)['runtimeType'] != 'Unspecified': # skip unset properties propValue = plugin[propName] if propValue != plugin.getReference(propName): # alternative plugin outputs are read as referencing themselves; skip them newPlugin[propName] = propValue return newPlugin
Best regards,
Stan and the AppSDK team
Comment
Comment