Showing posts with label instancefile. Show all posts
Showing posts with label instancefile. Show all posts

Tuesday 9 April 2024

instance ass files (not paths)

use instancefile to access geo saved somewhere...

in a point wrangle - 


  s@instancefile=chs("path");


now with the geo node, you gotta add the instance tab and turn on fast instancing.





Monday 2 September 2019

Checking if your instancefile files exist

Checking if your instancefile files actually exist...Cos sometimes...they don't! Stolen from MikeB

Paste this into a Python node:



import os

node = hou.pwd()
geo = node.geometry()

geo.addAttrib(hou.attribType.Point,'exists',0)

for pt in geo.points():
    file = pt.attribValue('instancefile')
   
    if os.path.isfile(file):
        pt.setAttribValue('exists',1)
    else:
        pt.setAttribValue('exists',0)