Relink Bitmaps

Tagged with terms:
31
points
Date Updated: 
04/03/2008
Author Name: 
Colin Senner
Version: 
1.15

This script relinks missing bitmaps in scenes. It searches directories recursively unlike the Bitmaps/Photometric utility. Also features "Interactive Mode", which allows you to easily see which object is missing the bitmap. If you have missing bitmaps in your scene, this will be your best friend.

After being frustrated with Max's Photometic/Bitmap path plugin, I decided to write my own. Some features of mine that are not included in the plugin are:

1. Fast Recursive Directory searching (searches my c:\ drive for missing bitmaps in less than a minute)

2. Find Bitmaps - by name or path

     Allows the user to type in any part of the filename or path (case-insensitive)
     and populates the Material editor with the materials dependent on the seach string.

     Instructions:
     1. Type all or part of a filename or path and press find
     2. Check the material editor for all materials that are dependent on your search string

     For example: typing "Brick.jpg" will populate the material editor with all the materials with "Brick.jpg" in the filename or path

     For example: typing "bri" will populate the material editor with a file or pathname containing "bri" including
                         "brick.jpg", "redbrick.jpg", "brick_bump.jpg", etc

     For example: typing "c:\" will populate the material editor with all bitmaps that have "c:\" in their path allowing
                         allowing you to isolate and change them manually.

3. Interactive Mode - allows the user to isolate just the objects with missing bitmaps and more

4. Undo toggle and other speed enhancements

 

If you like this script please add a point!

Update 1.15 - Added  support for finding individual maps based on path/name
                    More user Feedback
                    Support for finding hidden bitmaps in Unwrap_UVW modifiers (thanks Brittnell!)

Update 1.14 - Added support for finding missing bitmaps in the Viewport Background Image. 

Update 1.13 - Added an Ignore Case option for ignoring a filename's case --Note using ignore case will result in slower script execution.

Added "USER EDITABLE VARIABLES" for customizing to suit your needs better, read the script's beginning for more info

Update 1.12 - Added more user feedback to Interactive Mode

Update 1.11 - Small bug in version 1.10 from yesterday concerning undo mode. It's correct now, my apologies.

Update 1.10 - Cosmetic fixes, more compact, hid undo mode so it is automatically off, read the script header to enable it on again if desired, added an output button to output a list of missing maps

Update 1.09 - Fixed some small bugs regarding interactive mode

Update 1.08 - Additional Feedback provided to the user

Update 1.07 - Now includes Customizable QuickPaths for saving paths you use most often!

Update 1.06 - Fixed a crash found by Gravey @ CGTalk

 

If you find this useful drop me an email, if you find a bug, please also drop me a line.
Colin Senner

Additional Info: 

1. Run script

2. In Max goto "Customize->Customize User Interface...->Toolbars tab->Category: ColinScripts->Relink Bitmaps" and drag "Relink Bitmaps" to a toolbar, click to run.

3. Select a path you'd like to search by pressing the "..." browse button

4. Press "Relink"

 

optional: Interactive Mode

1. Run script

2. In Max goto "Customize->Customize User Interface...->Toolbars
tab->Category: ColinScripts->Relink Bitmaps
" and drag "Relink
Bitmaps" to a toolbar, click to run.

3. Press "Turn Interactive Mode ON", and wait a moment for it to load bitmaps

4. Select a missing map in the "Missing Maps" listbox to select the object it is attached to in the viewport

5. Double-click a missing map in the "Missing Maps" listbox to isolate the object it is assigned to

Version Requirement: 
3ds max 7+
AttachmentSize
Relink Bitmaps v1.15.ms29.57 KB

brittnell's picture

Thanks for this.  It's

Thanks for this. 

It's nice to know I'm not alone in despising the functionality of Max's Bitmap/Photmetric Path tool.  Seems like I need to use it way too often, and when I do, it takes FOR-EVER to open.

I'm anxiously hoping this will be a decent solution.

Cheers!

colinsenner's picture

Absolutely, I hope this tool

Absolutely, I hope this tool helps you in your pipeline. Please check out version 1.03 as it's functionality has been improved! and let me know your frustrations and successes with this script!

Cheer,
Colin

spot's picture

what a godsend! it worked

what a godsend! it worked perfectly here (3dsmax 9).

--
spot - www.nothing.ch

themaxxer's picture

great script, thanks for

great script, thanks for this.

 

it would be nice, if you could add a favorit list to save links. I ever have to point the same drive or folder. is this possible?

 

best regards

themaxxer 

colinsenner's picture

only for themaxxer on the

only for themaxxer on the vray forums :)

Absolutely, I'll update this in the next few days with some saved quick paths

themaxxer's picture

wow, that's nice. :) best

wow, that's nice. :)

best regards

themaxxer 

chriszone's picture

Thank you, this one is

Thank you, this one is really great. I only suggest to add the possible to link the script to a max UI button.

best regards.

colinsenner's picture

themaxxer, please check for

themaxxer, please check for version 1.07 :)

colinsenner's picture

This functionality is easy

This functionality is easy to do. Simply open via->Maxscript->Open script. Highlight the entire script with ctrl-A, and drag the highlit text to a button in max. Hope this helps.

overseastom's picture

This script is

This script is super-awesome! It just saved me a bunch of time rerouting stuff thru the standard editor so cheers mate!!!! I dunno if you're taking suggestions for the next version (if you make one) but I have two thoughts:

1. Include IES and environment map paths
2. How about being able to print a list of the missing maps or better yet, showing a window to copy the text from?

Thanks again, you rock!

tripclaw's picture

Thanks! I was getting fed up

Thanks! I was getting fed up with the shotty version max comes with. With the file I had, that had lots of network paths that were on a slow link in our network, it could take up to 45 mins for the max resource collector to open !! your script took a few seconds to open and only a few minutes to fix all my problems and relink to my side of the network.

You > Discreet.

pStar's picture

very handy script. thank

very handy script. thank you.
one issue though: i have to deal with really long directories/filenames. would it be possible to make the windows resizeable, so i could see the whole pathname? currently it's a kind of guesswork ;)
regards

colinsenner's picture

pStar, Glad to hear my

pStar,
Glad to hear my Relink Bitmaps script could help you. I also have to deal with really long directories/filenames so I incorporated the path text field at the bottom of the "Maps" rollout, by double-clicking any missing map, it will paste the file it's looking for in the textbox below.

But thinking about it, it would be nice to see the whole path at once, so in the next version the window will be resizeable. Many thanks for the great suggestion.

-Colin

colinsenner's picture

overseastom, I am

overseastom,
I am certainly taking suggestions. As suggested above, the windows will be resizeable for easier reading. I am curious as to what you mean by environment map paths though. Do you mean maps in the 3dsmax environment slot (default hotkey:"8")? Because if a bitmap is in there, then it is already supported. If it's an hdri then it is not.

-Colin

colinsenner's picture

Tripclaw, Thank you for

Tripclaw,
Thank you for your kind words. I truly appreciate it.

-Colin

overseastom's picture

Hi Colin - thanks for the

Hi Colin - thanks for the reply :) With regards to the window resizing, I think it's a great idea for ease-of-use but it wasn't what I meant. I was talking about the ability to copy and paste the missing maps' path list into an email to let other collaborators know the maps that are missing and their locations. I know I can do it one path at a time, I just had a lot of paths to copy was all...
I did mean the environment slot, because a map was missing from there in the scene I used your script with. It must have been an HDRI map, that explains it's absence from your script's listing. Is it a nightmare to include HDRI relinking in your script too? :)
I want to say thanks again for all your work on this - it's sooooo much better than the Max standard path editor and it's obviously saving a fair few of us Max users quite a bit of time and sanity. Cheers Colin!!
-Tom

colinsenner's picture

Tom, Well implementing

Tom,
Well implementing something that sounds as simple as window resizing is actually quite complicated. I will update the script today with version 1.10, that has minor cosmetic fixes, is a bit more compact, and has the ability to output all missing maps to a file for easy emailing/checking/cross-referencing, I think it's a great idea.

Cheers,
Colin

colinsenner's picture

Updated with output list and

Updated with output list and cosmetic fixes, more compact.

Tom, what kind of IES files are you using? How are you adding them? Personally I've never used them, but with a decent explanation of where to create them and edit them I will add support for them as well.

-Colin

overseastom's picture

Wow man - thanks for the

Wow man - thanks for the speedy update!! Regarding the IES files, they are specific light "webs" that you can download that cast beautiful (but render-intensive) light patterns onto walls. In Max, you load them by creating a Light>>Photometric. Then under the Intensity/Color/Distribution rollout change the Distribution box from Diffuse to Web. That will open a Web Parameters rollout where there's a web file button that you can load the IES file into. The light in the viewport will now display the shape of the IES light cone.
Writing all that, it sounds like it may be a pain in the arse to update your script. I myself would have no problem using your script for just finding maps and using the Max one for IES files because you never really have many different types of IES in one scene and i understand if you can't be bothered with all the trouble... Anyway Colin, thanks again and good luck if you decide to tackle it :) All the best,
Tom

colinsenner's picture

Updated, there was a small

Updated, there was a small bug in version 1.10, if you downloaded it yesterday, please re-download the newest version 1.11

eric_domingo's picture

5 star!!

5 star!! <<< you rock!!

colinsenner's picture

Many many thanks Eric. I

Many many thanks Eric. I hope it saves you time and enriches your life somehow.

colinsenner's picture

Update: Version 1.12, Added

Update: Version 1.12,
Added user feedback concerning Interactive Mode

brittnell's picture

Hey there, Thanks again for

Hey there,

Thanks again for this great script, I'm pretty sure I use it every day.

One quick request:  Is it possible to have it ignore letter casing?  For example, I often encounter situations where Max is looking for file "aaaa.jpg", and does not recognize the existing file "AAAA.jpg" (or "aaaa.JPG"). 

I'm not how so many of our scenes scenes developed this issue, but if there were an easy way to use Relink Bitmaps to correct it, that would be awesome.

Cool cool! 

colinsenner's picture

Brittnell, I will update

Brittnell,
I will update the script with your request sometime this week. Please check back.

-Colin

colinsenner's picture

Brittnell, Added support

Brittnell,
Added support for ignoring case in the script, please note due to max not including a native toUppercase function until Max2008 enabling it will result in a bit slower execution, however other enhancements were done with regards to speed.

Note: I've also added USER EDITABLE VARIABLES for users like you and me who use this script alot. It allows you to easily change your default options for script execution
Things like:
Defaulting Recursive Searching off / on
Defaulting Ignore Case off / on
Changing the default Browsing Directory to your main resource of maps etc.

To edit these variables open the script and edit the values under the section entitled "USER EDITABLE VARIABLES".

Enjoy,
Colin

brittnell's picture

AWESOME... Thanks! Now I

AWESOME... Thanks!

Now I just wish I could add more points for this script.

Cool

Ps. We are using Max2008 if that makes any difference.

colinsenner's picture

Brittnell, For now to

Brittnell,
For now to keep compatibility with users that haven't switched over yet it will work with max versions 7+. Thanks for the point! Tell your co-workers. Please revisit the installation instructions for any install confusion as it's changed in the past 2 versions.

Best,
Colin

S-ed's picture

It's not see path marked as

It's not see path marked as "found"? I can't send to network render with such maps.

I have 2 maps with same bitmap, but one - "ok", other - "found". Script can't see it. =(

colinsenner's picture

Are you saying that

Are you saying that relink-bitmaps can't find a bitmap in your scene but you know it's missing? Please let me know.

-Colin

S-ed's picture

I't not missing, it's

I't not missing, it's "found" (when it cant be found by it's primary path, but found in one of project's paths). Network render cant assign render to server when one of those maps in scene.

p.s.: Sorry 4 my eng.

colinsenner's picture

I still don't understand,

I still don't understand, relink-bitmaps script if it finds a missing bitmap and you tell it where to look it will search for the missing bitmap and when it finds it, it will re-assign it.

-Colin

Hope this helps, I'll need more information if you are having a problem. Maybe you could step-by-step me through your problem?

brittnell's picture

Sorry to butt-in, but maybe

Sorry to butt-in, but maybe it's about files that are mapped to a local drive and thus "found" when opened on the same machine where they reside (and consequently not displayed as "missing" by Relink Bitmaps), however, when the scene is sent to network render, Max fails to find the file(s) (since it is still expecting them to be local, and not on the network drive)... ?

If that is the issue, then it should just be a matter of deleting all local directories listed under Max's "Customize/Configure User Paths/External Files" prior to opening the scene and running the Relink Bitmap script.

Dunno... Seems a bit unrelated to the script itself, but I figure it's worth a shot.

Good luck!

colinsenner's picture

Good call Britt! Following

Good call Britt! Following Britt's instructions (of removing User Paths/External Files) before you open the scene should make them missing. Of course renaming the root folder of the maps to something from like

"C:\Maps\" to "C:\MapsZ" should also break the connection and make them go missing, in which case you could copy the maps to the network directory and relink them there.

Hopefully you are right Britt.

Also: I'm planning on updating this script providing a bit more functionality (I've written a separate script that will plugin to this one which when given a bitmap name will populate the material editor with all materials it is assigned to and help you track down missing maps which I'm thinking of incorporating, what do you think britt?)

-Colin

brittnell's picture

That new functionality

That new functionality sounds great.  A really good idea. 

You know, that reminds me of something (slightly related)... I've found one "sneaky" spot where bitmaps can "hide", and not be found using any means other than manual hunting (even Relink Bitmaps doesn't catch them)... If a bitmap is loaded into an "Unwrap UVW" modifier, it effectively runs in "stealth mode", and doesn't show up in any of the regular spots.  If missing/moved/etc, it can still cause network rendering issues.

Collapsing modifier stacks seems to be the easiest way to remedy the situation.

...

Took about a day of hair pulling to corner that one. Yell

colinsenner's picture

Yuck, I'll look into that

Yuck, I'll look into that and look forward to the update sometime next week. Always looking for great new ideas!

S-ed's picture

Yep, that's it, thanks

Yep, that's it, thanks Britt. =P

Maybe add, show "dependend objects" function. Its useful when open someones scene, and there is no one(or some) bitmap.
Like:
Missing: C:\Textures\proj001\test_a.jpg
Object: Tree_01_trunk
Missing: C:\Textures\proj001\bla-bla_x.jpg
Object: Tree_01_leaf_045
It's hard to find it though mat browser, sometimes scene consist of hundred mats.

colinsenner's picture

Upon next update S-ed you

Upon next update S-ed you will be able to find the bitmaps very easily by using the functionality I'll be adding that lets you type in a map name "bla-bla_x.jpg" or type in a path name "C:\" and it will populate your material editor with the materials the map is assigned to or dependent on!

I've been using it in production for a few days now and its really helped me fix map issues quickly and efficiently.

Hopefully this will solve your woes, also I'll check on Britt's hidden map stealth "feature" and do my best to address that.

Best,
-Colin

colinsenner's picture

Updated with your suggestion

Updated with your suggestion Britt and hopefully the new find tool will help you as well S-ed!

-Colin

brittnell's picture

AWESOME! Thanks again

AWESOME!

Laughing

Thanks again Colin.

colinsenner's picture

Always Britt, let me know if

Always Britt, let me know if you run into anything problematic, or have any ideas for enhancing your workflow.

-Colin

dandg's picture

Hi Colin, First off thanks

Hi Colin,

First off thanks for giving the script away it solves a problem that allot of studios have. One thing that could be quite good would be to unify all those functions that are currently in global space into a single struct so that only it was in global space. Just my two cents..

Cheers
Dave

colinsenner's picture

Good idea and certainly

Good idea and certainly better form! Many thanks.

brittnell's picture

Hey Colin, I've got another

Hey Colin,

I've got another "weird" place for you to look for those sneaky bitmaps...  

Today we encountered a scene where local (c:) bitmaps were used by an artist in a PFlow Particle Age shader.  Had to open up Particle View in order to find them.

Just like the Unwrap UVW issue, they post a "missing" notificacation on scene-open, but are not visble to Relink Bitmaps.

How come I always get the "fun" ones?  ;)

Cheers,

Britt

colinsenner's picture

I haven't used pflow much,

I haven't used pflow much, I'll investigate. Thanks Britt!

vsai's picture

Colin, If you do go the way

Colin, If you do go the way of  a struct, could it be possible to add a way to use the script without the UI.. for example.

relink_bitmaps=relink_bitmaps()

relink_bitmaps.replace_maps dir:"\\path\" recursive:true

That would allow using it in a semi 'automatic' fashion. I've sort of rigged this up in an older version you had posted that i'm using here as a 'post-open' script for catalogging a bunch of maxfiles.(But in the process pretty much destroyed the ui hehe)

I know thats a bit of a pain though, requiring changing all of the rlt_Search.Chk's and whatnot into variables that are passed into the function instead of how they are now

On the plus side! I'm Learning a fair amount from taking apart your code bits, thanks for sharing :D

colinsenner's picture

oh yuck that would be

oh yuck that would be painful, I'll definitely add a command line option, besides the current variables do you need any more functionality?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.