Aller au contenu
zules

Remplacer des fichiers dans max

Recommended Posts

Salut à tous,

j'ai beau chercher je ne trouve pas la réponse...

J'ai un nombre élevé de proxy étant texturé avec des .TGA méga HD trop lourds... j'ai fais un batch convert pour mettre tous ces fichiers en .jpg normaux. Mais bien sûr Max ne les retrouve pas car le nom est identique, mais l'extension a changé (tga>jpg).

Une tactique pour mettre à jour tout ça d'un coup ? j'ai beau bidouiller avec RelinkBitmap, Zoa Path editor et l'Asset Tracking, je trouve pas l'astuce.

Merci !

Share this post


Link to post
Share on other sites
(
    -- Script to change all bitmaps from *.jpg to *.tga

    local a_bitmaps = getClassInstances bitmapTexture
    local i_filecount = 0

    for o_bitmap in a_bitmaps do
    (
        local s_filename = o_bitmap.filename
        local s_extension = substring s_filename (s_filename.count - 2) 3
    
        format "\nExtension = %" s_extension

        if (matchPattern s_extension pattern:"jpg" ignoreCase:true) then
        (
            format "\tReplacing % with " s_filename
            s_filename = replace s_filename (s_filename.count - 2) 3 "tga"
            format "%" s_filename
            o_bitmap.filename = s_filename
            o_bitmap.reload
            i_filecount = i_filecount + 1
        )
    )

    messagebox ("Completed. " + (i_filecount as string) + " filenames changed.")
)

Juste à inverser .jpg et .tga dans le script, puisqu'il avait été créé pour faire l'inverse de ce que tu veux ;)

Share this post


Link to post
Share on other sites
7 minutes ago, NicolasC said:

(
    -- Script to change all bitmaps from *.jpg to *.tga

    local a_bitmaps = getClassInstances bitmapTexture
    local i_filecount = 0

    for o_bitmap in a_bitmaps do
    (
        local s_filename = o_bitmap.filename
        local s_extension = substring s_filename (s_filename.count - 2) 3
    
        format "\nExtension = %" s_extension

        if (matchPattern s_extension pattern:"jpg" ignoreCase:true) then
        (
            format "\tReplacing % with " s_filename
            s_filename = replace s_filename (s_filename.count - 2) 3 "tga"
            format "%" s_filename
            o_bitmap.filename = s_filename
            o_bitmap.reload
            i_filecount = i_filecount + 1
        )
    )

    messagebox ("Completed. " + (i_filecount as string) + " filenames changed.")
)

Juste à inverser .jpg et .tga dans le script, puisqu'il avait été créé pour faire l'inverse de ce que tu veux ;)

Top !!!!!!!

Sauf que.... ahahah j'ai trouvé !

Dans RelinkBitmap, il y a une case Ignore Extension... Gros bêta que je suis ! Je suis passé devant 1500x je pense...

 

Merci Niko ça pourra toujours servir, et je mets le lien vers RelinkBitmap ici pour les visiteurs :

http://www.colinsenner.com/scripts/relink-bitmaps

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Invité
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Chargement

  • Who's Online   0 Members, 0 Anonymous, 286 Guests (See full list)

    There are no registered users currently online

×
×
  • Créer...