Jump to content

Leaderboard


Popular Content

Showing most liked content on 08/23/2021 in all areas

  1. 1 point
  2. 1 point
    Hey Ultraman! Thank you for your response. The thing is that I just got the alembic to work on, the simulation was done by another artist. I figured out a way to reduce the polygons and it works perfectly! I'll leave it here so you can take a look. Cheers. T. PD: in the Compile_end node is a must to use the Multithread option.
  3. 1 point
    It's something like this: class SimpleWidget(QtWidgets.QWidget): def __init__(self, parent, x, y, w, h): QtWidgets.QWidget.__init__(self, parent, QtGui.Qt.WindowStaysOnTopHint) self.initialize(x, y, w, h) def initialize(self, x, y, w, h): self.setGeometry(x, y, w, h) self.setMask(QtGui.QRegion(0, 0, w, h)) p = self.palette() p.setColor(QtGui.QPalette.Window, QtGui.Qt.red) self.setPalette(p) def drawViewportOutline(thickness): if hasattr(hou.session, "viewportOutlineWindows"): for w in hou.session.viewportOutlineWindows: w.close() hou.session.viewportOutlineWindows = [] p = hou.session.overlayviewpos s = hou.session.overlayviewsize w = s.width() - thickness h = s.height() - thickness outlineWindows = [] w1 = SimpleWidget(hou.ui.mainQtWindow(), p.x(), p.y(), thickness, h) w1.setParent(hou.qt.floatingPanelWindow(None), QtGui.Qt.Window) outlineWindows.append(w1) w1.show() w2 = SimpleWidget(hou.ui.mainQtWindow(), p.x(), p.y(), w, thickness) w2.setParent(hou.qt.floatingPanelWindow(None), QtGui.Qt.Window) outlineWindows.append(w2) w2.show() w3 = SimpleWidget(hou.ui.mainQtWindow(), p.x() + w, p.y(), thickness, h) w3.setParent(hou.qt.floatingPanelWindow(None), QtGui.Qt.Window) outlineWindows.append(w3) w3.show() w4 = SimpleWidget(hou.ui.mainQtWindow(), p.x(), p.y() + h, w, thickness) w4.setParent(hou.qt.floatingPanelWindow(None), QtGui.Qt.Window) outlineWindows.append(w4) w4.show() hou.session.viewportOutlineWindows = outlineWindows def drawViewportOutline(): # Draw red outline if viewport is camera-locked sceneviewer = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer) currentViewport = sceneviewer.curViewport() if hasattr(hou.session, "viewportOutlineWindows"): if currentViewport.isCameraLockedToView() and currentViewport.camera(): if len(hou.session.viewportOutlineWindows) == 0: drawViewportOutline(2) else: if len(hou.session.viewportOutlineWindows) > 0: for w in hou.session.viewportOutlineWindows: w.close() hou.session.viewportOutlineWindows = [] hou.ui.addEventLoopCallback(drawViewportOutline) The callback function is described here: https://www.sidefx.com/docs/houdini/hom/hou/ui.html Register a Python callback to be called whenever Houdini’s event loop is idle. This callback is called approximately every 50ms, unless Houdini is busy processing events. Basically you can do anything in this function and that means if you can query if the viewport is set to a camera and it's locked then you can toggle the viewport outline.
  4. 1 point
    Hi, in addition here is another simple approach using ids for connected primtives to join them together. All primitives with same id will have the same level. stair_example.hipnc
  5. 1 point
    I'm not an UV expert, but I made this quick hip file. Take a look, maybe it will help. VDB_rock_autoUVs.hip
  6. 1 point
    // Detail wrangle. #define PI 3.1415926535897932384 vector a = point(0, "P", 0); vector b = point(0, "P", 1); vector c = point(0, "P", 2); vector ac = c - a; vector ab = b - a; vector ab_x_ac = cross(ab, ac); vector a_center = (cross(ab_x_ac, ab) * length2(ac) + cross(ac, ab_x_ac) * length2(ab)) / (2.0 * length2(ab_x_ac)); float radius = length(a_center); vector normal = normalize(ab_x_ac); vector center = a + a_center; // Test. vector x, y, z=normal; makebasis(x, y, z); matrix3 r = set(x, y, z); int count = 50; for (int i = 0; i < count; i++) { float angle = 2 * PI / count * i; vector pos = set(sin(angle), cos(angle), 0) * radius; addpoint(0, pos * r + center); } addpoint(0, center); Here is working stuff found there. Add degeneracy testing if you need it. circumcircle.hipnc
×