tws0002 / blur-dev

Automatically exported from code.google.com/p/blur-dev
0 stars 0 forks source link

RuntimeError: underlying C/C++ object has been deleted #51

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I start by doing this from the qt getting started:
===================================================================
IDE Tool Wizard
Instead of forcing a developer to remember everything that goes into a Tool, it 
was much easier to build a Wizard that we could reuse.

With that in mind, we built a robust and extensible wizard system into the IDE 
Editor.

We have wizards for creating more Wizards, creating tools Environments, gui 
components, and for Tools.

This time, right click on your _Examples folder and choose New From Wizard

This will bring up the Wizard chooser dialog. Since right now we're creating a 
new tool, lets choose:

User Interface and then Tool

The Wizard you'll see will give you a couple of options.

The button on the left will let you choose the icon for your tool
Name field will be the name of your tool
Choosing simple script will build the tool with no GUI, and just register code 
to run within your main.pyw
Base Class field lets you choose from the 3 basic Tools UI options 
(Dialog,Window,Wizard)
Create Ui File will alter whether or not to create a Qt Designer file for you 
GUI, or if you want to define it programmatically
Description is just the tooltip for your new tool
ToolTypes registers where this tool can be run from. As we'll show, you can 
actually develop a single tool that can run in 3dsMax, Softimage and External 
applications. Extensions for Maya and Houdini are easily created, we just don't 
support them at Blur.
For now, lets set:

name SampleTool
toolTypes External, Studiomax, Softimage
description Sample tool for learning the IDE
We'll leave the other settings as they are by default (if you want to choose an 
icon, go ahead and do so).

Click Continue
The next page you'll see will outline the files and folders that will be 
created for your wizard. You'll see this as the last page for all IDE Wizards, 
so you can always preview your files before you create them.

Only checked files will be created, so if for whatever reason you don't need or 
want certain files or folders, you can disable them through this view.

If you want to see the difference between what gets created, you can click back 
and toggle the simple script and/or create ui file fields, and this will alter 
the template for the tool that gets created.

For now, we'll just create with the standard settings, so click Done

You'll then be prompted if you want to change projects - when a tool gets 
created, it actually makes a new IDE Project specifically for that tool.

For now, click no - we'll just stay in the current project.

Running the Tool
If you expand the _Examples folder, you'll now see your SampleTool tool folder, 
and all the files from the Wizard are setup for you.

If you right click on the main.pyw file and choose any of the three:

Run
Run (Standalone)
Run (Debug)
=================================================================

I then get an warning when I run main.pyw as above and the log out puts this:

=================================================================
=================================================================

>>> loading addon blurdev.ide.addons
Addon SVN Support loaded:  False
Addon Smart Highlighter loaded:  True
Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\blurdev\ide\ideeditor.py", line 1195, in runCurrentScript
    blurdev.core.runScript( filename )
  File "C:\Python26\lib\site-packages\blurdev\cores\studiomaxcore.py", line 222, in runScript
    return Core.runScript( self, filename, scope, argv, toolType )
  File "C:\Python26\lib\site-packages\blurdev\cores\core.py", line 657, in runScript
    execfile(filename, scope)
  File "C:/blur/dev/CarScriptTest\main.pyw", line 26, in <module>
    blurdev.launch( CarScriptTestDialog )
  File "C:\Python26\lib\site-packages\blurdev\__init__.py", line 128, in launch
    widget = ctor( None )
  File "c:\blur\dev\CarScriptTest\carscripttestdialog.py", line 16, in __init__
    super(CarScriptTestDialog,self).__init__( self, parent )
  File "C:\Python26\lib\site-packages\blurdev\gui\dialog.py", line 29, in __init__
    QDialog.__init__( self, parent )
RuntimeError: underlying C/C++ object has been deleted

=================================================================
=================================================================

this is 3dsmax 2012 on windows 7.

I'm presuming something is not installed that should be, but I can't work out 
what I'm missing. A list of things to check would be a good place for me to 
start trouble shooting I guess (unless you know what this is from experience)

Original issue reported on code.google.com by d...@bossalien.com on 15 Jun 2012 at 10:47

GoogleCodeExporter commented 9 years ago
I also don't have this file and directory.

Navigate to BlurOffline/python/tools/General_Use_Tools/_Examples/SampleTool/ui
Double-click on `sampletooldialog.ui'

Original comment by d...@bossalien.com on 18 Jun 2012 at 11:49

GoogleCodeExporter commented 9 years ago
Hello,

I broke the code down into smaller components to see what might be causing the 
error.

Here is the code I wrote:
_______________________________
from blurdev.gui import Dialog

class SampleTool2Dialog( Dialog ):
    def __init__( self, parent = None ):
        super(SampleTool2Dialog,self).__init__( self, parent )
        # load the ui
        import blurdev
        blurdev.gui.loadUi( 'C:/blur/dev/SampleTool2/sampletool2dialog.ui', self )
blurdev.launch( SampleTool2Dialog )
_______________________________
I get similar errors as the above when using:
"super(SampleTool2Dialog,self).__init__( self, parent )"

So I made some revision like so:
_______________________________
from blurdev.gui import Dialog
import blurdev
class SampleTool2Dialog( Dialog ):
    def __init__( self, parent = None ):
        Dialog.__init__( self, parent )
        # load the ui
        blurdev.gui.loadUi( 'C:/blur/dev/SampleTool2/sampletool2dialog.ui', self )
blurdev.launch( SampleTool2Dialog )
_______________________________

I also noticed if I put the  actual location of the ui folder, I get an error.
Actual file location:
C:/blur/dev/SampleTool2/ui/sampletool2dialog.ui
Error:
IOError: [Errno 2] No such file or directory: 
'C:/blur/dev/SampleTool2/ui/ui/sampletool2dialog.ui'
It puts an extra "ui" folder name before the ui file name automatically, so I 
needed to get rid of it. 
Is this the correct functionality?

Thank you.

Original comment by tak7yosh...@gmail.com on 11 Sep 2012 at 4:31

GoogleCodeExporter commented 9 years ago
Changing
super(SampleTool2Dialog,self).__init__( self, parent )
To this
super(SampleTool2Dialog,self).__init__()
Also solved my problem.

But still would like to hear a response in regards to the double ui.

Thanks again.

Original comment by tak7yosh...@gmail.com on 11 Sep 2012 at 4:50

GoogleCodeExporter commented 9 years ago
After further review, this worked too.
super(SampleTool2Dialog,self).__init__( parent )

Since this generated by the wizard, do you think it need a change.
Or am I using this incorrectly.

Best

Original comment by tak7yosh...@gmail.com on 11 Sep 2012 at 9:10

GoogleCodeExporter commented 9 years ago
I'm encountering this the same as the original Poster.

"Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\blurdev\ide\ideeditor.py", line 489, in documentExec
    doc.exec_()
  File "C:\Python26\lib\site-packages\blurdev\ide\documenteditor.py", line 213, in exec_
    blurdev.core.runScript( self.filename() )
  File "C:\Python26\lib\site-packages\blurdev\cores\core.py", line 657, in runScript
    execfile(filename, scope)
  File "C:\Users\ahosking\Dropbox\Git\LightBake\Python\Examples\Text\AlpexTest\main.pyw", line 26, in <module>
    blurdev.launch( AlpexTestDialog )
  File "C:\Python26\lib\site-packages\blurdev\__init__.py", line 128, in launch
    widget = ctor( None )
  File "c:\users\ahosking\dropbox\git\lightbake\python\examples\text\AlpexTest\alpextestdialog.py", line 16, in __init__
    super(AlpexTestDialog,self).__init__( self, parent )
  File "C:\Python26\lib\site-packages\blurdev\gui\dialog.py", line 29, in __init__
    QDialog.__init__( self, parent )
RuntimeError: underlying C/C++ object has been deleted"

Fresh installs on two separate machines.
Both Windows 7 pro (x64)
This crash happens in the IDE standalone and when contained in 3ds Max.

Original comment by ahosk...@arcestra.com on 24 Oct 2012 at 3:40