Skatter models not found after moving model from Mac to Windows

SketchUp version : 2018
Skatter version (Skatter dialog > Options > About) : 1.4.5
OS : WIndows 10
Description of the issue : Skatter can’t find thea models for proxies on Windows, it’s looking for them in the Mac file locations
Are you able to reproduce the issue every time? (If yes, how?) : yes. any skatter group I add with grass.
Error in Ruby Console? (Window > Ruby Console) :
Thea Render console error:
Warning - An external model not found:/Library/Application Support/Skatter/Library/skatter_short_grass_01_large.mod.thea
Warning - An external model not found:/Library/Application Support/Skatter/Library/skatter_short_grass_01_small.mod.thea

Note that this does not occur on new models, just on the model I migrated from my Mac to Windows. It’s a complex model with hundreds of hours invested, recreating is not an option. How can I force Skatter to update all the proxy model paths?

This is expected behavior. Unfortunately there is no way to handle this gracefully.
I can make a small script that will replace all Mac paths to Windows paths. But I am currently in vacation, can you wait until next week?

1 Like

this would be a fantastic addition.

Hi Thomas, thank you for the response, and offering to write the script. I would have done this myself, but I didn’t see an obvious way to modify the sketchup model (strings didn’t report any of the paths, I assume the model is some kind of compressed format). I ended up deleting all the Skatter components and then copy and pasting pieces of the model into a new SketchUp file. Then regenerated the skatter elements. This “worked”. I’d like to point out that Laubwerk didn’t have any problems with this, and found all the high res models backing the Laubwerk proxies in the Windows filesystem, so it appears to be possible to ensure the paths to the high res models backing the proxies is looked up at runtime instead of hard coding OS specific paths into a SketchUp model (or even user specific paths).

Laubwerk works very differently. The hi-res files are generated at render-time, so the paths are obviously also generated at that time. Thus they are automatically OS-specific.
In the case of Skatter, the paths are written when you load the presets from the library, then never touched again. I guess Skatter could scan the paths all the time and change them on the fly, but does the user really expects the model to be changed without them knowing?
Some people may not want the paths to change when they switch computers.

I’m not sure that there is an easy way to do this. The best I can think of, is a script accessible in the Skatter menu.

1 Like

As a software developer, I fell into the trap of trying to suggest fixes instead of reporting on my usage as a user. As a user, I think it is reasonable to expect that a SketchUp model is self contained. If I use plugins, I expect those plugins to manage their implementation data and present me with an abstracted interface. I think it’s fair to require that those plugins be installed in order to get the benefit from them. So as a user, my expectation is that I create a Skatter group and the plugin handles it from there. When I use “Short Grass” from the Library, I didn’t specify a path, I just selected “Short Grass” from the tiles it presented me, so there is no connection from the user perspective between “Short Grass” and the underlying high-res model. That’s an implementation detail that Skatter should handle. What I would expect to happen is that the Skatter plugin interprets “Short Grass” to do the right thing when the time comes to export the scene for rendering, by, for example, storing the high res model filename in sketchup model, and prepending $SKATTER_LIBRARY_PATH at render time. You could also use a unique identifier which is not the filename, but we already established that the model itself is not visible to the user, so that name is encapsulated within the Skatter implementation and should be safe to use.

I’ll provide another scenario. I had Skatter installed on an external drive in my eGPU enclosure. The drive failed. When I replaced the drive and reinstalled Skatter, I installed it into a different location - either intentionally, or because I forgot where I installed it last time. My models are now broken.

Archival is another good example. Systems change and we expect to be able to archive and restore files and have them continue to work.

From Skatter’s perspective, using an alias instead of a hard coded filename path also provides the plugin with more flexibility to independently change the implementation, version the models, etc. without exposing those details to the user.

I am not a particularly advanced Skatter user, I use it for grass, creating hedges and filling spaces with Laubwerk models. That said, I’ve given this some thought, and I cannot envision a scenario where a user would prefer to have the model path hardcoded into the Sketchup model. Can you think of one which wouldn’t be equally well served by the approach above?

And if that isn’t convincing, and Skatter maintains the position that the user is responsible for managing the file paths to the underlying high res models of the Skatter library, then please at least provide us with a way to do so via the Skatter UI instead of leaving us with broken models. Note that even after deleting all skatter objects in the outliner, creating new Skatter groups still fails because the path to the grass model never gets updated.

2 Likes

That would indeed be ideal. Unfortunately, there is no way for Skatter to know when a render is started.
Laubwerk does, because they worked with the render engines developers to have the render engines call Laubwerk at render time. We would have to do the same thing: ask each company to do what we need.
This has been difficult enough to convince every one of them to implement the “Render Only” feature, I don’t think any of them would be willing to spend time on such a minor feature for which they wouldn’t benefit.
Frankly, I prefer them to work on supporting new major features in Skatter v2 (random materials).

This is actually implemented in the render engines UI themselves, as they each have a different way of linking to external files.
For instance, you can do it in the Thea browser > Model Info > External dependencies > Models

I have created the script and released version 1.4.6 that you can download here : Lindalë
The script is accessible in the Extensions menu > Skatter > Convert Library Paths
Obviously this will only convert paths for the default library presets, not custom presets that you saved yourself in the library. Let me know if it works fine for you.

1 Like

Thomas, thanks for taking the time to provide context around the implementation, and the framework you have to work within. Very helpful in understanding the problem better. The script you added sounds like the most practical immediate solution - and is along the lines of what I was going to recommend (I was going to suggest making sure the “Re-Generate” button used the new path rather than whatever was stored in the model previously). I’ll try this on an older version of my model with the old paths and report back. Point about custom presets is understood.

Sorry for the delay. I’m having trouble getting Skatter to work at all now, so I can’t test this fix. Following your advice on another post here, I started a new sketchup file, opened the ruby console, opened the skatter library, and see the following:

Error: #<NoMethodError: undefined method []=' for nil:NilClass> C:/ProgramData/SketchUp/SketchUp 2018/SketchUp/Plugins/jbb_skatter/rb/library.rb:194:inblock (3 levels) in start_lib_dialog’
C:/ProgramData/SketchUp/SketchUp 2018/SketchUp/Plugins/jbb_skatter/rb/library.rb:187:in foreach' C:/ProgramData/SketchUp/SketchUp 2018/SketchUp/Plugins/jbb_skatter/rb/library.rb:187:inblock (2 levels) in start_lib_dialog’
C:/ProgramData/SketchUp/SketchUp 2018/SketchUp/Plugins/jbb_skatter/rb/library.rb:185:in each' C:/ProgramData/SketchUp/SketchUp 2018/SketchUp/Plugins/jbb_skatter/rb/library.rb:185:inblock in start_lib_dialog’
C:/ProgramData/SketchUp/SketchUp 2018/SketchUp/Plugins/jbb_skatter/rb/dialog.rb:20:in call' C:/ProgramData/SketchUp/SketchUp 2018/SketchUp/Plugins/jbb_skatter/rb/dialog.rb:20:inblock in add_bridge_callback’
SketchUp:1:in `call’

---- Skatter 1.4.6----
Regenerate render instances from attributes : 0.0 s
---- End ----

Clicking on the red “Load” buttons in the library doesn’t seem to do anything. I have tried uninstalling and reinstalling skatter, but it behaves the same.

Looking at the code, I wonder if it could be related to some special character in the name of a .sklib file that Skatter is trying to load.
Is it possible?

Right you are. I removed the custom library path from options, and it started working again. I checked the contents of the path and found some files prefixed with “._”:

dvhart@DESKTOP-HTJV785:~/Documents/Sketchup/Skatter$ ls -la
total 1580
drwxrwxrwx 0 root root 512 Jun 13 23:07 .
drwxrwxrwx 0 root root 512 Jun 13 23:07 …
-rwxrwxrwx 1 root root 4096 Jun 13 20:50 ._arborvitae-line1.skp
-rwxrwxrwx 1 root root 137280 Mar 31 15:46 arborvitae-line1.skp
-rwxrwxrwx 1 root root 4096 Jun 13 20:50 ._arborvitae-line.sklib
-rwxrwxrwx 1 root root 2439 Mar 31 15:46 arborvitae-line.sklib
-rwxrwxrwx 1 root root 4096 Jun 13 20:50 ._flower-bed1.skp
-rwxrwxrwx 1 root root 298590 Jun 10 16:44 flower-bed1.skp
-rwxrwxrwx 1 root root 4096 Jun 13 20:50 ._flower-bed2.skp
-rwxrwxrwx 1 root root 426945 Jun 10 16:44 flower-bed2.skp
-rwxrwxrwx 1 root root 4096 Jun 13 20:50 ._flower-bed3.skp
-rwxrwxrwx 1 root root 290431 Jun 10 16:44 flower-bed3.skp
-rwxrwxrwx 1 root root 4096 Jun 13 20:50 ._flower-bed4.skp
-rwxrwxrwx 1 root root 420244 Jun 10 16:44 flower-bed4.skp
-rwxrwxrwx 1 root root 4096 Jun 13 20:50 ._flower-bed.sklib
-rwxrwxrwx 1 root root 2529 Jun 10 16:44 flower-bed.sklib

I removed the ._* files and added the library path back and it is working correctly again. Thanks Thomas. OK, now back to testing the fix in 1.4.6…

I have confirmed that with 1.4.6, a model previously issuing the following warnings in the Thea Render console:

Warning - An external model not found:/Library/Application Support/Skatter/Library/skatter_short_grass_01_small.mod.thea
Warning - An external model not found:/Library/Application Support/Skatter/Library/skatter_short_grass_01_large.mod.thea

now renders successfully after executing the Skatter->Convert Library paths->OSX > Windows.

Thank you Thomas, I understand you’re working within a number of constraints not of your own making with SketchUp and the various renderers, I appreciate the fix very much.

Thanks for the feedback, I’ll look into reproducing the issue and fixing it.

1 Like