THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/03/2011 at 06:03, xxxxxxxx wrote:
I want to get the pixel size of textures used in the scene.
"BaseChan-> GetBitmap ()" I found it looking like functionality.
To do a similar thing can I do?
On 26/03/2011 at 06:32, xxxxxxxx wrote:
def main() :
mat = op.GetTag(c4d.Ttexture)[c4d.TEXTURETAG_MATERIAL]
if not mat:
print "No Tag"
print "No Texture"
I hope this snippet helps you.
On 26/03/2011 at 15:01, xxxxxxxx wrote:
However, "mat" is "c4d.BaseList2D object" so "GetSize ()"function does not seem to have.
def main() : mat = doc.GetActiveMaterial() print mat[c4d.MATERIAL_LUMINANCE_SHADER].GetSize()
"GetSize ()" function when l is a good idea to use should I do?
On 27/03/2011 at 16:04, xxxxxxxx wrote:
You can't get the pixelsize of shaders since they do not have such one.
On 28/03/2011 at 16:33, xxxxxxxx wrote:
Here's an example of using the BaseBitmap class to get the size of an image:
from c4d import gui, bitmaps
def main() :
path = os.path.join("/Users", "user", "Desktop", "MyImage.jpg")# <-- Use you own path here
bmp = bitmaps.BaseBitmap(path)
x, y = bmp.GetSize() #Gets the X and Y dimensions of the image
On 29/03/2011 at 04:23, xxxxxxxx wrote:
I was able to get the pixel size !