# Vray Bitmap Scripts

**URL:** <https://forums.chaos.com/t/vray-bitmap-scripts/106170>\
**Category:** General\
**Created:** [August 17, 2021, 1:36pm UTC](https://forums.chaos.com/t/vray-bitmap-scripts/106170 "2021-08-17T13:36:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![busseynova](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@busseynova](https://forums.chaos.com/u/busseynova)\
**Post date:** [August 17, 2021, 1:36pm UTC](https://forums.chaos.com/t/vray-bitmap-scripts/106170/1 "2021-08-17T13:36:33Z")

</div>

I really need to learn scripting, but in the meantime has anyone come across a script to

1. batch load textures in to SME as Vray bitmap

or

2. rename Vraybitmap nodes according to their filename

?

​​​​​​​Thanks.

---

<div class="post-metadata">

**Author:** ![busseynova](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@busseynova](https://forums.chaos.com/u/busseynova)\
**Post date:** [August 17, 2021, 1:38pm UTC](https://forums.chaos.com/t/vray-bitmap-scripts/106170/2 "2021-08-17T13:38:51Z")

</div>

I did find this for regular bitmaps, it can probably be adapted but I couldn’t guess at which bits to change

```auto
 SelMat = medit.GetCurMtl()
nSbMats = SelMat.numsubs
for j = 1 to nSbmats do
(
bitmp = getFilenameFile SelMat[j].diffusemap.filename
SelMat[j].name = bitmp
SelMat.names[j] =bitmp
SelMat.material[j].diffusemap.name=bitmp
)

```

---

<div class="post-metadata">

**Author:** ![\_Lele](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/_lele/32/49986_2.png) [@\_Lele](https://forums.chaos.com/u/_Lele)\
**Post date:** [August 19, 2021, 10:59am UTC](https://forums.chaos.com/t/vray-bitmap-scripts/106170/3 "2021-08-19T10:59:00Z")

</div>

See if this floats your boat.

Details: it’s lazy in that _ **it won’t enumerate files on folder pick** _, but just as the “Go!” button is pressed.  
This is to avoid deep recursing through a location which may be shared and suffering from traffic.  
_ **It will try and reuse the SME view** _ with the same name if it finds it (i.e. “vrayBitmap Loaders”), but _ **it will not** _ _ **delete an SME view or node** _ under any circumstance: that’s up to the user.  
_ **Gamma will be set automatically** _: use the particles in the filename to force one (“\_raw”, “\_srgb” and so on). When in doubt, gamma will be set to “from 3DSMax”.  
_ **It will name the loaders with the filename of the loaded texture** _, without extension. Edit line 40 to suit your needs.  
_**It will optionally (and by default) name the SME view with the \*root\* folder used in the file search**_.  
_ **It will lay out the maps based on the number of rows chosen** _ (see attached image). Pressing L will still re-layout all the contents of the SME view.

As usual, it comes without any official sanctioning or support from Chaos: _ **use at your own risk, feel free to modify it to better suit your workflow** _.

 ![UI.png](https://europe1.discourse-cdn.com/chaosprd/original/3X/a/9/a948824eec713cff4131d8c161b14ba4672384b3.png)  
[MBL\_003.zip](https://forums.chaos.com/uploads/short-url/jpTayGUyVr9c9O65iMUWNjHzCfS.zip) (1.3 KB)

---

<div class="post-metadata">

**Author:** ![busseynova](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@busseynova](https://forums.chaos.com/u/busseynova)\
**Post date:** [August 25, 2021, 8:28am UTC](https://forums.chaos.com/t/vray-bitmap-scripts/106170/4 "2021-08-25T08:28:22Z")

</div>

Thanks a lot, I’ll give that a go
