Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Change the bitmap properties using maxcript

osukas
Advocate
Advocate

Change the bitmap properties using maxcript

osukas
Advocate
Advocate

osukas_0-1730982789958.png

Im importing a texture from Plantfactory, and im getting all this ON, the texture looks good in my viewport but not in the render, if I manually deactivate the two checks in TILE works great. I noticed that trying to activate all these 4 manually is impossible, if you activae mirror deactivates Tile, and the same way if i do it backwards. So im trying to make a max script to automate that if MIRROR is active, deactivates the TILE, but i cant get the "name" to edit that data

https://help.autodesk.com/view/MAXDEV/2024/ENU/?guid=GUID-F31D331A-D62B-4E31-8579-24911D35CD3D

when googling the name of the properties, I get the name of the properties of a general bitmap (clipU, clipV, filtering, filename) but nothing about the properties in coordinates, that is what i need to start making the script.
Where i can find this data? 

I google trying to find how to modify "offsetU" or "angleU" but nothing

0 Likes
Reply
176 Views
2 Replies
Replies (2)

osukas
Advocate
Advocate

FIXED, I used ZORB tools to get the names of what I was looking for
https://www.scriptspot.com/3ds-max/scripts/modifier-modifier-zorb

worked it with chat gpt to get a working script to fix my issue, sharing it here in case is useful for someone

for b in getClassInstances bitmaptex do
(
    local coords = b.coords
    if coords != undefined do
    (
        if coords.U_Mirror == true and coords.U_Tile == true then
        (
            coords.U_Mirror = true
            coords.U_Tile = false
            print ("Updated: " + b.name + " U_Mirror: true, U_Tile: false")
        )
        if coords.V_Mirror == true and coords.V_Tile == true then
        (
            coords.V_Mirror = true
            coords.V_Tile = false
            print ("Updated: " + b.name + " V_Mirror: true, V_Tile: false")
        )
    )
)






0 Likes

MartinBeh
Collaborator
Collaborator

You can ask MAXScript itself for the names/properties:

 

m = Bitmaptexture()
Bitmaptexture:Bitmap
show m
  .clipu (Clip_U_Offset) : float
  .clipv (Clip_V_Offset) : float
  .clipw (Clip_U_Width) : float
  .cliph (Clip_V_Width) : float
  .jitter (Jitter_Placement) : float
  .useJitter : boolean
  .apply : boolean
  .cropPlace : integer
  .filtering : integer
  .monoOutput : integer
  .rgbOutput : integer
  .alphaSource : integer
  .preMultAlpha : boolean
  .bitmap : bitmap
  .coords (Coordinates) : maxObject
  .output : maxObject
  .fileName : filename
  .startTime : time
  .playBackRate : float
  .endCondition : integer
  .tieTimeToMatIDs : boolean

and

show m.coords
  .blur : float
  .mapping
  .mapChannel : integer
  .mappingType : integer
  .UVW_Type : integer
  .U_Mirror : boolean
  .V_Mirror : boolean
  .U_Tile : boolean
  .V_Tile : boolean
  .showMapOnBack : boolean
  .Noise_On : boolean
  .Noise_Animate : boolean
  .UVTransform
  .realWorldScale : boolean
  .realWorldHeight : float
  .realWorldWidth : float
  .phase : float
  .U_Offset : float
  .V_Offset : float
  .U_Tiling : float
  .V_Tiling : float
  .U_Angle : angle
  .V_Angle : angle
  .W_Angle : angle
  .Noise_Amount : float
  .Noise_Size : float
  .Noise_Levels : integer
  .Blur_Offset : float

 

So for your case, you would use m.coords.U_Tile = false, for example. 

 

Martin Breidt

http://scripts.breidt.net

EESignature

→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.