kleer001 Posted August 9, 2015 Share Posted August 9, 2015 (edited) I have a scene with 300+ imported FBX chunks of geometry. There are an associated 200+ unique materials. What I want is to be able to scatter points on that geometry and have those points get the proper color from the texture map. I do get the shop_materialpath on the prims, which is a first step. And they do have proper UVs which is great. But I've been banging my head against the wall trying to figure out how to procedurally get to the texture path from the shop_materialpath attribute. Say the shader is /obj/fbx_import/SHOPS/material_1234 inside there is node /obj/fbx_import/SHOPS/material_1234/t7_pplastic with the attribute map1 (that's what I want). It's the same simple structure for every material except the node with the texture changes name. Thankfully it's not the node named "shader output", and they're all of node type "v_fbx" if that helps. Edited August 10, 2015 by kleer001 Quote Link to comment Share on other sites More sharing options...
anim Posted August 9, 2015 Share Posted August 9, 2015 (edited) if it's not easy to assume the v_fbx node name based on shader name or something, then you would probably have to go with Python SOP and for example get node from first input of material's suboutput node and get it's texture (if the material was more complex, which I doubt as you are importing fbx, you would need to recursively follow that input till you find one or all v_fbx nodes and get one of their map1 ) or you can just use Python to rename surface shaders to correspond to SHOP nodes (which I think FBX exported from houdini already does) and then simply get textures in VEX Edited August 9, 2015 by anim Quote Link to comment Share on other sites More sharing options...
kleer001 Posted August 10, 2015 Author Share Posted August 10, 2015 Thanks Tomas, The shader names are based on the material name. Kicker is that the material names are repeated sometimes with numbers, sometimes without. The important part of the cliff notes go something like: import re re.sub("_materail*\\d*","_material_shader", shop_path) Thats importing the regular expressions , then finding string matches with 0 or more digits behind them and replacing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.