newPeak Posted August 19, 2016 Share Posted August 19, 2016 How to create black box asset use python ? Thanks in advance Quote Link to comment Share on other sites More sharing options...
MirrorSword Posted August 19, 2016 Share Posted August 19, 2016 If you put this in a python sop it will give you a black box. node = hou.pwd() geo = node.geometry() points = [] geo.addAttrib(hou.attribType.Point, "Cd",(0.02,0.02,0.02)) geo.addAttrib(hou.attribType.Vertex, "N",(-1.0,0.0,0.0),True) #create points for x in (-1,1): for y in (-1,1): for z in (-1,1): new_point = geo.createPoint() new_point.setPosition((x,y,z)) points.append(new_point) #create faces polygons = [ (2,3,1,0), (1,3,7,5), (5,7,6,4), (4,6,2,0), (7,3,2,6), (1,5,4,0), ] for point_numbers in polygons: poly_points = [points[x] for x in point_numbers] v1 = poly_points[0].position() - poly_points[1].position() v2 = poly_points[1].position() - poly_points[2].position() normal = (v2.cross(v1)).normalized() new_poly = geo.createPolygon() for point in poly_points: new_vertex = new_poly.addVertex(point) new_vertex.setAttribValue("N",normal) 1 Quote Link to comment Share on other sites More sharing options...
kgmcnamara Posted March 13, 2018 Share Posted March 13, 2018 (edited) Funny but he's asking how to create a Black Boxed Asset (what you make by using the "Assets > Create Black Boxed Asset from Section" menu) I have the same question - is there any way to trigger this "Create Black Boxed Asset" from code, either python or vex? I don't see anything under hou.hda EDIT: Found the answer here: Edited March 14, 2018 by kgmcnamara 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.