Jump to content
[[Template core/front/profile/profileHeader is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Community Reputation

0 Neutral

About marwan131

  • Rank
    Peon

Personal Information

  • Name
    marwan marwan
  1. i have little problem with randomizing material with instancing , i have a tree that has 2 materials 1 for bark and 1 for leaf the problem is to randomize a material with instancing is to apply the material after instancing and if i have multiple materials for each group or if i have multi geo with different materials and sub materials it will be a huge complex to randomize the materials and assigning them , i already tried material stylesheets but i failed to make it work , my main goal is to assign the materials for objects before instancing them. in 3ds max vray there is a node called vray multisub tex and there is forest color i can apply them materials and sub materials to make sure to have different color per element per instance so i dont have to assign the materials after instancing i need only to assign the materials for objects before instancing . im trying to achieve the same thing in houdini in in this pic i have select_attribute i want to randomize it to have random number per instance if anyone can help me using material stylesheets and thank you. random tree leaf before instancing.hipnc EDIT: my idea is to have random value per element and per instance and most importantly to apply the materials before instancing and packing in case i have multi objects (buildings ,trees ) or in case i have multi material per object (tree: leaves and bark, or building : windows , walls, roof), i dont think this is possible to do without material stylesheets
  2. hello , it's my first time i use python in houdini fx i know python from before but i never used it in houdini fx and it seems it's easier than vex to achieve the same task, my problem is i have an fbx file with shop_materialpath and there are different name in shop_materialpath i want to create a string channel for each unique name , that string channel it will be a path for ue4 material for example if i have 2 different name in shop_material the first one is TS_02 and the second is Roof_01 i want to create 2 string channel to expose it later to ue4 using hda first string pathmat1 and the second one is pathmat2 and they will be applied in an attribute name unreal_material or path , i want to automate this process because i want it to work on random asset if i dont know the name of the shop_materialpath the python script should loop in each primitive and see how many name there are in shop_material path and create string channels for them . i already made a script to store the name of the shop_materialpath in a dictionary and then i lost from where should i continue idk how to access primnum in python and idk how to create string channel like in vex using chs() here is my python code # Run a generator Box SOP Verb def grp_n(grp): myDict={} for mat in grp: if mat in myDict: myDict[mat]=1 else: myDict[mat]=1 return myDict node = hou.pwd() geo = node.geometry() dict={} list=[] for pri in geo.prims(): list.append(pri.attribValue("shop_materialpath")) l=grp_n(list) print l and i made a simple code in vex but in this case i already know the shop_material names and im testing using if conditions and applying string to the unreal_material , i want to automate this process to check how many names there are in shop_material path and then creating string channels for each one, sorry i dont know how to explain this in an easy way but my english is not too good string id1=chs("uemat1"); string id2=chs("uemat2"); string id3=chs("uemat3"); // testing conditions comparing the groups name if(s@shop_materialpath=="TS_02"){ s@unreal_material=id1; } else{ s@unreal_material=id2; } if(s@shop_materialpath=="Emissive_01"){ s@unreal_material=id3; }
×