Best way to implement JobPreLoad.py

Hello. I have a simple script that deletes the Optix cache files before rendering a blender scene. I’m using JobPreLoad.py to do this and installed it to the repository plugin.

However, I don’t really like installing custom scripts in the main plugin directory, and I’d prefer not to just copy the unmodified repository plugin wholesale into the custom plugin directory. I definitely don’t want to pollute my GlobalJobPreLoad with a bunch of conditionals.

ideally I’d like to somehow run the JobPreLoad from the custom plugin but the main blender plug-in from the repository.

I’m guessing that I’ll need to write a dummy plugin that doesn’t do anything other than references the main repository plugin. Is there a more eloquent way to accomplish this?

You’ll have to get over one of the two discomforts. Either put your code into the default folder or put the untouched code into the custom directory. Coming up with dummy plugin is asking for more trouble than I’d recommend.

My choice would be to duplicate the Blender plugin into the custom directory and put the JobPreLoad.py file there. I’d also add a file in that directory that calls out that the Blender.py file hasn’t been customized, with a name and date. That way you’ll have a stamp that proves the file hasn’t been touched without having to diff the two Blender.py files.

However I’m the only one that touches my Repository so that might not scale for having other folks working on the system. :slight_smile:

thank you @Justin_B! So if I have a custom blender script in the custom scripts folder it will take priority over the one that comes with the repository?

@Shawn_kearney Yes, that is correct. Any script that lives under [repo]/custom takes precedence over the corresponding script under [repo]/