shiboken.getCppPointer() crashes Maya

249 views
Skip to first unread message

Danny Wynne

unread,
Mar 6, 2014, 12:45:51 PM3/6/14
to python_in...@googlegroups.com
I'm wondering if anyone else has experienced this and has a work around? Maybe I need to recompile shiboken? 
thanks,
example

import PySide.QtGui as QtGui
import shiboken
orig = QtGui.QWidget() #Generic QWidget we want to cast
as_ptr = long(shiboken.getCppPointer(orig))
casted = shiboken.wrapInstance(as_ptr, QtGui.QLineEdit)

thanks,

Justin Israel

unread,
Mar 6, 2014, 2:51:42 PM3/6/14
to python_in...@googlegroups.com
I had to correct the syntax to:

as_ptr = long(shiboken.getCppPointer(orig)[0])

But it didn't crash for me. This is with the latest brew install of PySide on osx



--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/91a83722-eb6e-4fe3-a1b8-2b05f5ac78c2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Daniel Wynne

unread,
Mar 6, 2014, 8:12:51 PM3/6/14
to python_in...@googlegroups.com
dang. 
It seems to work in vanilla Maya, so it must be our setup here. Thats too bad. 
Thanks,
(Im on windows 7, maya 2014)

Danny Wynne
www.dannywynne.com


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xq-q3EybUIg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0%3DbwLUBYcS4c24ndMf387Tt2G4Fao%2BG-AmzX5TFQ%2B-Vw%40mail.gmail.com.

Justin Israel

unread,
Mar 6, 2014, 8:42:04 PM3/6/14
to python_in...@googlegroups.com

I don't have a Maya 2014 handy but I can check again on Monday  
I tested in a shell.

Geordie Martinez

unread,
Mar 6, 2014, 11:40:34 PM3/6/14
to python_inside_maya
I seem to remember this post by Nathan Horne says you have to modify the shiboken method to get the right pointer ( to get the equivalent of what sip would return to you):
http://nathanhorne.com/?p=485


Justin Israel

unread,
Mar 6, 2014, 11:57:41 PM3/6/14
to python_in...@googlegroups.com

This has more to do with the wrapinstance() differences as opposed to the getCppPointer(), which is called unwrapinstance() in sip.
I think Danny was saying the problem was in the getCppPointer call?

Daniel Wynne

unread,
Mar 10, 2014, 6:21:34 PM3/10/14
to python_in...@googlegroups.com
I think its a problem with our setup. Vanilla Maya works, but it doesnt when it's launched in our environment. We are trying to find the problem. 
Thanks,



Reply all
Reply to author
Forward
0 new messages