This worked for me:

from sipyutils import si
xsiApp = si()
n = xsiApp.ActiveSceneRoot.FindChild("null")
blob = n.Properties("nulldata")

def dispFix( badDispatch ):
    import win32com.client.dynamic
    # Re-Wraps a bad dispatch into a working one:
    return win32com.client.dynamic.Dispatch(badDispatch)

print dispFix(blob).Value


Without the dispfix I was getting

# ERROR : Traceback (most recent call last):
#   File "<Script Block >", line 6, in <module>
#     print blob.Value
#   File "C:\Program Files\Autodesk\Softimage 2014
SP2\Application\python\Lib\site-packages\win32com\client\__init__.py", line
465, in __getattr__
#     raise AttributeError("'%s' object has no attribute '%s'" %
(repr(self), attr))
# AttributeError: '<win32com.gen_py.Softimage|XSI Object Model Library
v1.5.Property instance at 0x588864968>' object has no attribute 'Value'
#  - [line 6]


On Thu, Jun 19, 2014 at 1:38 PM, Marc-Andre Carbonneau <
[email protected]> wrote:

>  Hi yall,
>
>
>
> How do you retrieve the value of a userdatablob in Python in XSI?
>
>
>
> My problem is that this works :
>
>
>
> Application.ActiveSceneRoot.FindChild("monModel").Properties("userdataBlobName").Value
>
>
>
> But this doesn’t:
>
>
>
> from sipyutils import si
> xsiApp = si()
>
> xsiApp.ActiveSceneRoot.FindChild("monModel").Properties("userdataBlobName").Value
>
>
>
> So in the main script Application it’s defined but if you are using a
> module Application it’s not defined anymore?
>
>
>
> Thanks
>
> MAC
>
>
>
>
>
> [image: passenger_email_logo]
>
> *Marc-André Carbonneau*
>
> Product Specialist
>
>
>
>
>
>
>

Reply via email to