Scaling materials?

(bigkahuna) #1

Is there another way to scale a Blender material? The only ways I know of are:

  1. If the materials is using textures, then go to “map input” and change each of the “sizeX, sizeY, and sizeZ” one by one. Unfortunately, if there are multiple textures, this can be time consuming.

  2. If the object is UV mapped, then re-scale the UV’s. Unfortunately, this doesn’t rescale the material, just the texture map, so it can cause obvious “tiling” issues.

Is there a third way? Some way that will resize all the material settings at once?

Thanks!

0 Likes

(Alltaken) #2

you can scale the texture space AFAIK, i’ve never done it myself, but I think you do it via an Empty.

0 Likes

(the blenderizer) #3

well. there might be better ways than mine. but i scale the mesh in edit mode, this allows the texture to maintain its original size. after that i scale the mesh in object mode to give it its original size back . now the texture ís bigger\smaller

0 Likes

(IamInnocent) #4

Well,
scaling down all the concerned objects, using Ctrl+A on them and then scaling them up to original size would give the appearance of scaling up the texture but I find it messy at best.
Mapping coordinates defined by an object, usually an empty for all the textures to rescale would mean that one would have to resize just that empty to resize all the textures but what if we need to map to UV or global rather?
If all the objects are linked to a same texture then scaling the texture itself, which is usually possible one way or another, seems to be the ticket.
Controlling the SizeX…Y…Z with an IPO and linking to that IPO for all other objects should be easy enough to script although I haven’t checked if the right methods and attributes exist for that.

Something I missed?

Jean

0 Likes

(bigkahuna) #5

Well, scaling down all the concerned objects, using Ctrl+A on them and then scaling them up to original size would give the appearance of scaling up the texture but I find it messy at best.

What exactly does Ctrl+A do? When I try this, it seems that some textures in my material are re-scaled, while others are not.

Controlling the SizeX…Y…Z with an IPO and linking to that IPO for all other objects should be easy enough to script although I haven’t checked if the right methods and attributes exist for that.

Interesting idea, but I have no idea how to implement this.

My scene has a dozen or so objects, each with their own materials and separate UV maps. Once the materials are created and scaled for each I hope to bake the materials to textures, then assign the textures to the objects.

0 Likes

(IamInnocent) #6

It resets Sizes to 1 and re-align the local space of the object on the global space. Texture mapping depends on the scale value and the rotation value of the moment for a mapping like Orco. I some of your objects were scaled up or down and/or if they were rotated relative to the global space then their textures will move after Ctrl+A.

Interesting idea, but I have no idea how to implement this.

Thinking of it a bit further, no Python’s necessary.
If you have multiple objects and you want to be able to resize their material all in one shot by the same amount then you could select them all, go in the material buttons with your mouse pointer, hit Ikey, choose Size and in the IPO window, Material IPO type, you’ll find a set of 3 IPOs for SizeX…Y…Z to which all your objects are linked.
Since you have only one key on that IPO, moving it up and down in Object mode (for the IPO) will scale up and down the material for all your objects at the same time. Of course you could make the IPO single user to tweak one particular object or add some more keys and animate the materials…

My scene has a dozen or so objects, each with their own materials and separate UV maps. Once the materials are created and scaled for each I hope to bake the materials to textures, then assign the textures to the objects.

The baking process implies that you already have UVcoordinates to your objects and that they all have an Image affected to them: assigning the textures to the objects is done automatically and all you need to do is to pack your data (or save all those images if you don’t want to pack)

Jean

0 Likes

(bigkahuna) #7

If you have multiple objects and you want to be able to resize their material all in one shot by the same amount then you could select them all, go in the material buttons with your mouse pointer, hit Ikey, choose Size and in the IPO window, Material IPO type, you’ll find a set of 3 IPOs for SizeX…Y…Z to which all your objects are linked.
I must be doing something wrong. To start I’m working with one object that has one material. I want to scale the material to the object without changing the object’s size or UV map. If I select the object, go to the material buttons and press the I key it inserts a keyframe in the object X,Y,Z scale, not the material’s X,Y,Z scale. What do I have to do to insert a key in the material’s IPO not the object’s IPO?

Edit: I think I figured out what you are talking about. I need to keep the mouse cursor over the material buttons window when I press the “I” key, then select “size”. Then it shows options for animating material properties. Problem is that its not inserting a keyframe when I do this?

0 Likes

(IamInnocent) #8

For multiple objects to be controlled with just one IPO the materials of those objects must be linked to the same texture block…

Otherwise there only a script that could help…

Sorry that the best I can think of.

Jean

0 Likes

(bigkahuna) #9

I think I may be misunderstanding you or you are misunderstanding me. :wink:

Following your idea I would like to control a material’s sizeX, sizeY and sizeZ with IPO’s. I selected the object, put the cursor over the materials button window and pressed the “i” key. I then selected “size” from the pop up menu. Nothing happens.

I tried the same process for all the other material properties (RGB, etc.) and they all work except “Ofs”, “Size” and “All mapping”. Is this a bug? Am I doing something wrong? Or are these functions not operating? Anyone?

0 Likes

(IamInnocent) #10

Did that material have a texture linked to it?
Size, Of(set) and mapping all address textures.

Jean

0 Likes

(Orinoco) #11

I think you need to link to an object. Blender doesn’t actually allow animation of attributes, but will let you link an attribute to an object, then you can animate the object. In the IPO curve window, after the “size” x y z lables light up, open the transform properties panel by typing n. Click on one of the xyz lables. The transform properties panel should now have a button called “Add Driver.” Click on the Add Driver button, and you can designate an object (usually an empty, but it can be anything) to drive the size parameter. Once you enter the object name, you can use the objects scale, location or rotation as the driver. After choosing which quality of the driver objext to affect the material attribute, type I in the IPO window, and you’ll get to create an ipo curve. The curve starts off 1 to 1, but you can change that if you want.

It’s a lot of set up, but it actually takes less time to do than to read about.

0 Likes

(IamInnocent) #12

Wow, this is becoming confusing…
Pydrivers are fine but what do you mean by attribute. If you mean color, Size or Offset of texture then you can animate them directly… and of course they should be linked to an object otherwise how could you select them…

J.

0 Likes

(bigkahuna) #13

I’m not sure if this relates to the method Orinoco just described (I’ll have to study this and give it a go) but I did learn why I wasn’t able to insert a keyframe for sizeX,Y,Z: apparently this -only- works for the first texture slot. If the material has more than one texture slot, the IPO will only modify/animate the first one. If I select the second texture slot in the material and press the “i” key, nothing happens. If I select the first texture slot it saves a keyframe.

What I’d like to do (and perhaps Orinoco’s technique does this, I’ll have to see) is to scale -all- the material texture sizes together. If the object only has one texture, it’s fairly easy to rescale it manually. But many of my materials have 5 or more textures and rescaling them manually is pretty time consuming…

0 Likes