how to force karma (cpu) to update textures?

   4755   12   3
User Avatar
Member
1737 posts
Joined: May 2006
Online
XPU seems to update when I restart the renderer from the viewport menu, but CPU stubbornly holds onto the textures. I've tried:

-bypass/unbypass the usduvtexture node
-disconnect/reconnect the wires to the usduvtexture node
-bypass/unbypass the material library
-use the render menu at the top, render->update textures
-restart the render

If I close and restart houdini then the textures are updated, but that's not great if I'm trying to do rapid lookdev.
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
12457 posts
Joined: July 2005
Online
I think you can do it from the Cache Manager, clear the viewport Textures.
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
1737 posts
Joined: May 2006
Online
Hmm, this worked sometimes, but not all times. The only surfire way is to restart, which if lops is gonna push more into lookdev, isn't really gonna cut it.

Please sidefx? More explicit control over how textures (and geometry for that matter) get refreshed in lops?
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
Render > Update Textures, then Restart Render works for me every time... If that doesn't work for you, it's probably worth logging a bug with your OS/system info (which is probably a good idea anyway, if we don't happen to catch the forum threads, or if lots of fires pop up, forum posts can slip from our radar...)

We are working to improve this area, the feedback is much appreciated
I'm o.d.d.
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
Houdini 19.0.442 - When restarting Karma renders in the Solaris viewport, we now run "texcache -n" to update any new texture maps.
I'm o.d.d.
User Avatar
Member
9 posts
Joined: May 2017
Offline
Hello

Somewhat related, but I've noticed that it's not possible to overwrite texture files when it's being read in Karma.(Both MaterialX and PrincipleShader, and I'm on 19.0.444)

The only workaround I've found is to click on Render > Update Textures. Then it's possible to replace or delete the texture file on disk. But once we "restart render", it's not possible to do so anymore.

Wonder if there's any reason for this? Cause I've tried on Arnold and it doesn't seem to have the same problem.
Would it be a good idea to implement so that every time we restart a render, it also starts the "update textures" command to? So that we can overwrite texture anytime.
Edited by FoamFX - Nov. 22, 2021 10:19:32
User Avatar
Member
169 posts
Joined: Nov. 2013
Offline
Something like this could work in the meantime Matt. Just map it to a hotkey or something:

panes = hou.ui.paneTabs()
sceneviewers = []
curDesktop = hou.ui.curDesktop()
desktopName = curDesktop.name()
#####identify scene viewers####
for p in panes:
    if p.type() == hou.paneTabType.SceneViewer: 
        sceneviewers.append(p)
              
for v in sceneviewers:
    hou.hscript("texcache -n")
    a = v.restartRenderer()
Edited by Hamilton Meathouse - Nov. 23, 2021 20:48:05
User Avatar
Member
1737 posts
Joined: May 2006
Online
Thanks!

Sounds like the update Goldleaf mentioned earlier does that too, but I'm mainly concerned about the times when no amount of texcache forcing or viewport restarts will clear text caches. It happens 5% of the time on a good day, 50% of the time on a bad day. Lucky for me I've finished my lookdev tasks for now, hoping this'll all be more reliable the next time I take a look.

-matt
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
169 posts
Joined: Nov. 2013
Offline
I have found that destroying the sceneviewer and putting a new one down sometimes fixes stuff like that (and there is a script from Dan Finnegan floating around odforce somewhere that does that (which is where I stole parts of my code above from). But yeah, still annoying to have to do.

You'll need to edit it to deal with LOPs viewers though, if it's something you're interested in.

*EDIT: linky https://forums.odforce.net/topic/22465-shelf-tool-solution-to-certain-houdini-viewport-bugs/?do=findComment&comment=134239 [forums.odforce.net]
Edited by Hamilton Meathouse - Nov. 23, 2021 22:15:02
User Avatar
Member
438 posts
Joined: Aug. 2019
Offline
This problem still happens from time to time for me. "Restart Render" doesn't help. On 19.0.451.

Making a new scene viewer does fix it.
Edited by raincole - Nov. 30, 2021 03:40:16
User Avatar
Member
1737 posts
Joined: May 2006
Online
Semi-related, Karma seems super aggressive in holding locks on textures on disk, so other processes can't update or delete them.

In this case I'm using tops to pull in a variety of images in various formats, ffmpeg/imagemagick to conform them to png's that are 512x512, then tops/lops to create materials that use those images.

Several times now once Karma has generated a render, the images are locked. Swapping to HoudiniGL, restart the render, move to a node before the materials are created etc.. all the usual drills, windows can't delete the textures, tops can't update or delete the textures.

Now and then I'll have luck making another lopnet, display that context, now the textures are unlocked, but again, this isn't a viable solution in the long term.
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Staff
4438 posts
Joined: July 2005
Offline
Possibly a slight improvement over creating a new scene viewer, if you switch to Houdini GL you can now "Reset Karma" (the menu item right above Restart Render) which should effectively kill karma which _might_ unlock the texture files. I'd be interested to hear if this does or does not work...
User Avatar
Member
40 posts
Joined: March 2018
Offline
Hi, sorry to revive this old thread but there still seems to be a lot of issues with reloading textures. It really slows down the workflow.
It would be nice if op:// paths to cops reloaded automatically, but even an overwritten image file will not update reliably.
The hscript and python commands usually mentioned don't seem to work either, and I followed advice in another thread using a USD preview and collect node in combination with a MaterialX shader in the hopes the GL view would work.

Any more advice on getting live texture updates on image save would be great. I was hoping some post-render command would do it but alas

edit: Update Textures works better in a 'main' viewport, but not in one that's been split off.
Edited by shareware - Dec. 24, 2023 05:07:12
  • Quick Links