Error on running script

Error on running script

Craig_Lamorte
Advocate Advocate
2,278 Views
5 Replies
Message 1 of 6

Error on running script

Craig_Lamorte
Advocate
Advocate
AttributeError: 'NoneType' object has no attribute 'unityArt'
Exception TypeError: "'NoneType' object is not callable" in <bound method ArnoldAOVCallbacks.__del__ of <mtoa.cmds.rendererCallbacks.ArnoldAOVCallbacks object at 0x0000018ED5C89710>> ignored

For the second part not sure what that error means about nonetype is not callable in ____ looks like arnold??  Not sure if that is relating to my issue or not

0 Likes
2,279 Views
5 Replies
Replies (5)
Message 2 of 6

robotProdigy
Advocate
Advocate

I'm not sure what code you're running, but the variable you (or other code) thinks is an object is actually assigned None. Look at this snippet and it'll make sense.

 

import pymel.core as pm

# WORKS ------------------------------------------------------------------------
# be sure there actually is a sphere called pSphere1
sphere = pm.PyNode('pSphere1')
sphere.tx.set(3.333)

# DOESN'T WORK -----------------------------------------------------------------
def get_sphere_function_that_doesnt_work():
    # programmer thinks I'm returning a sphere, but I'm actually returning None
    # because I am buggy
    return None

sphere2 = get_sphere_function_that_doesnt_work()
sphere2.tx.set(3.333)

# AttributeError: 'NoneType' object has no attribute 'tx' # 

 

Actually, after re-reading your post, my example is a different flavor of your error, but I can't remove my post. Oh well. 🙂

 

0 Likes
Message 3 of 6

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

Could you please share a sample your script? It looks like accessing something from Arnold.

 

Yours,

Li

0 Likes
Message 4 of 6

Anonymous
Not applicable

Hi ! I'm working on a script to export fur from maya/yeti in batch ( with mayapy ). I've got exactly the same error when the script arrives to the command from Yeti plug-in : cmds.pgYetiCommand ( used to export fur cache ). With a classic maya, in the script editor the same command works perfectly, but not in mayapy... I load mtoa.mll and pgYetiMaya.mll at the beginning of the script.

If you can help me !!! 

 

the error : Exception AttributeError: "'NoneType' object has no attribute 'MMessage'" in <bound method ArnolAOVCallbacks.__del__ of <mtoa.cmds.renderCallbacks object at 0x0000024DD4992828>> ignored

 

Thanks,

Brunel Léo, MegaComputeur

 

 

0 Likes
Message 5 of 6

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

I've talked with Arnold supports and we both think that it is very hard to figure out this issue without a reproducible script or code. If anyone could provide a script or code to reproduce the issue could help us to find out what's going on.

 

BTW: There is an Arnold forum here, you could try it:

https://answers.arnoldrenderer.com/index.html

 

Yours,

Li

 

 

0 Likes
Message 6 of 6

Anonymous
Not applicable

Hi ! Thanks for your quick answer !! I have the solution ! ( At least for my script ). Here's a script that create this error : 

 

import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
from sys import argv

 

try:cmds.loadPlugin( 'pgYetiMaya.mll' )
except:pass
try:cmds.loadPlugin( 'mtoa.mll' )
except:pass

 

cmds.file('D:/yetiFile.mb', i=1)

 

file = argv[1]

inFrames = argv[2].split('-')[0]
outFrames = argv[2].split('-')[-1]

 

cmds.pgYetiCommand('pgYetiMaya1Shape', writeCache=file, range=(inFrames,outFrames))

 

maya.standalone.uninitialize()
os._exit(0);

 

Launched in subprocess with this command : 

 

import subprocess
subprocess.call(['C:/Program Files/Autodesk/Maya2018/bin/mayapy.exe', 'D:/autodeskForum.py', 'D:/yetiCache.%04d.fur', '5-50'])

 

The cmd log report the error with this script, but it seems to come from Yeti, not Arnold.

I think it's my bad, in the range flag of the pgYetiCommand I was sending this : argv[2].split('-')[0] , so a string... I fixed it with a int()

 

 

I join the script and the file I import in batch !

 

Thanks for all ! And sorry for disturbing !

Brunel Léo, MegaComputeur

 

 

0 Likes