WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-01-2007, 07:28 PM
AlyssaK AlyssaK is offline
Member
 
Join Date: Dec 2006
Posts: 16
<multimedia:image>.getSize

Hi everyone,

I'm using the example from the documentation <multimedia:image>.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 "<string>", 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.
Reply With Quote
  #2  
Old 02-02-2007, 09:30 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #3  
Old 02-13-2007, 10:02 PM
AlyssaK AlyssaK is offline
Member
 
Join Date: Dec 2006
Posts: 16
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

Last edited by AlyssaK; 02-13-2007 at 10:03 PM. Reason: update
Reply With Quote
  #4  
Old 02-14-2007, 09:34 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:46 PM.


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