WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   <multimedia:image>.getSize (https://forum.worldviz.com/showthread.php?t=991)

AlyssaK 02-01-2007 07:28 PM

<multimedia:image>.getSize
 
Hi everyone,

I'm using the example from the documentation .getSize

import viz
viz.go()

tex = viz.add('box.wrl')

size = tex.getSize()

print 'The texture is',size[0],'x',size[1]

and i recieve the following error:

Traceback (most recent call last):
File "", line 11, in ?
File "testing.py", line 8, in ?
size = tex.getSize()
AttributeError: 'VizChild' object has no attribute 'getSize'

I must be overlooking something if you can help please post a response. My intention is to make sure that all images are scaled to a certain size.

Thanks, Alyssa.

farshizzo 02-02-2007 09:30 AM

The getSize() command only works on texture objects. The tex object in your sample code is actually a node3d object, since box.wrl is a VRML file, not an image file.

AlyssaK 02-13-2007 10:02 PM

Is there anyway to get the dimensions of an vrml file's object? My intention is to make sure these are scaled to a certain size.

Thanks, Alyssa

farshizzo 02-14-2007 09:34 AM

Sure, here is some sample code that gets the bounding box of a vrml object and prints the dimensions:
Code:

model = viz.add('model.wrl')
bb = model.getBoundingBox()
print bb.size



All times are GMT -7. The time now is 08:19 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC