ERROR : 'tuple' object has no attribute

 
 
 
 # ERROR : Traceback (most recent call last):
#   File "<Script Block >", line 14, in ?
#     app.LogMessage( "old source: " + prevsrc.FullName )
# AttributeError: 'tuple' object has no attribute 'FullName'
#  - [line 14]

Possible Cause

This is a message that appears when you have provided a single variable for assignment from a method that supports output arguments and return values:

myvar = surface.ConnectFromFile( "Blinn", "Material Shaders" )

In this case, ConnectFromFile returns both the new shader source and provides the old disconnected shader in the PrevDataSource output argument, so the myvar variable is being interpreted as a tuple by Python.

Suggested Solution

Use the tuple-style syntax as explained in Getting Output Arguments from Methods.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License