As the title says…how would I do this?
This might be what you’re looking for.
-Kevin
That’s maybe part of it but I can’t figure out how to get from an object to its specific mapping parameters, that just seems to be how to access “materials” separate from objects, I don’t know if the objects even have materials assigned nevermind what they are–and after a bit of checking more often than not they’ll start out without a material.
You’ll need the following methods
Yes I found those, but have no idea what to actually do with them. How do I actually get or set the repeat from a TextureMapping object? Do I have to interpret it from the UVWTransform matrix?
Most of the objects I’m processing initially have no mapping, how do I actually apply mapping to them?
First you get the texture channels with GetTextureChannels(). Then you can loop over the ids you get and with each call GetTextureMapping(). This gives you a TextureMapping.
Now repeat, offset and rotation are actually not part of these texture mappings, rather they are specified in the RenderTexture. To access these you can check my sample on retrieving and tweaking render textures: https://jesterking.github.io/rhipy/select_object_tweak_texture_mapping.html .
So trying to follow that example, my objects have materials assigned by Iray or nothing yet explicitly applied, in either case object.RenderMaterial returns null. It only works on geometry with “Rhino” materials applied. How is this the way to get to the per-object mapping settings?? I’m trying go get to this stuff:
Perhaps the GetTextureMapping method that has out Transform xform
. I don’t know how to help with this. Hopefully @andy can.
Yeah the UvwTransform property seems to correspond to those settings…okay making progress…it’s just figuring out the matrix math.