WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 02-17-2015, 07:30 AM
fordprefect fordprefect is offline
Join Date: Oct 2012
Location: Vienna, Austria, Europe
Posts: 39
Exclamation <node3d>.color() [and others] and the node parameter

Today I stumbled over a problem of the quasi-polymorphism approach of <node3d>.color() command, also found in specular(), ambient(), emissive() and others.

These are generous in that they accept the three RGB color values as separate parameters or as a tuple. But watch out, this is paid for by abandoning the keyword argument feature for the node parameter.
So while this works
node.color(1,0,0, node='left')
using an RGB tuple does not work
node.color([1,0,0], node='left')
and requires omission of the keyword to work properly:
node.color([1,0,0], 'left')
While this is weakly documented in Vizard help, the method signature or doc string does not really hint you to that.

Furthermore, the documentation does not tell you about the mode parameter of color() and it's possible values.

I don't have a pretty neat solution to this issue, but maybe there exist a Python guru out there who has. So far my post is mainly to raise awareness.
BTW, similar things apply to setPosition(), setEuler() and several other positional and orientation commands.
21 is only half the truth.
Reply With Quote

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 03:57 PM.

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