Yep. Another scene editor...

Regarding the saving out of unnamed nodes:

I’m not entirely clear on what you’re saving for each node – I imagine that you’re saving out the name of the model file (if any) and any changes made to the nodes within its hierarchy (including things attached to it, etc.).

If so, could you not save the model by structure, rather than name? That is to say, given the following node:

 node
(named "someNode")
   |
---------------
|             |
node         node
(unnamed)    (unnamed)
                |
             --------------------
             |                  |
           node               node
          (named "kitten")    (named "cat")

Could you not save out something like this:

<NodeEntry>
<name> someNode </name>

    <NodeEntry>
    <name> </name>
    </NodeEntry>

    <NodeEntry>
    <name> </name>

        <NodeEntry>
        <name> kitten </name>
        </NodeEntry>

        <NodeEntry>
        <name> cat </name>
        </NodeEntry>

    </NodeEntry>
</NodeEntry>

This means that the object should be restored just as it was saved, and thus references to its children should be intact: instead of matching by name, we match by position in the hierarchy.

(While such positions may change during run-time, they shouldn’t change between saving and loading, it seems to me: as long as the state of the program is loaded faithfully, it shouldn’t matter overmuch that the program was shut down between one point and the next.)

If the problem is references to a given node, then I’m inclined to suggest giving each sub-node a unique identifier which is saved with the node, and if the model is changed first attempt to resolve the changes and, if that fails, allow it to break and warn the user.

Hi
Could you help me with the installation stuff then.
Having upgraded to windows 8 I have installed panda 1.72 rather than 1.8
I have installed python 2.7 and panda is running as before. I need to install wx python somewhere.
Is this technically anywhere will do and then you need to edit Panda to use wx python.
Is that instead of python 2.7 or can it use both?

I think its probably worth explaining the detail here as I probably won’t be the only person who installs the right software, but doesn’t get things to work.

Thanks.

Ok, more specifically.
I have panda installed on the C drive.
In the python folder
python/lib/site packages I have installed wx.
Opening main with wingide and running provides this:

Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more information.
[evaluate main.py]
Failed to find wx module
Traceback (most recent call last):
  File "F:\Wing IDE 101 4.1\src\debug\tserver\_sandbox.py", line 4, in <module>
    #print 'Exiting sandbox process'
  File "F:\panda3d-editor-master\panda3d-editor-master\src\pandaEditor\__init__.py", line 12, in <module>
    from selection import Selection
  File "F:\panda3d-editor-master\panda3d-editor-master\src\pandaEditor\selection.py", line 4, in <module>
    import editor
  File "F:\panda3d-editor-master\panda3d-editor-master\src\pandaEditor\editor\__init__.py", line 5, in <module>
    import nodes
  File "F:\panda3d-editor-master\panda3d-editor-master\src\pandaEditor\editor\nodes\__init__.py", line 10, in <module>
    import nodePath
  File "F:\panda3d-editor-master\panda3d-editor-master\src\pandaEditor\editor\nodes\nodePath.py", line 7, in <module>
    from pandaEditor import commands as cmds
  File "F:\panda3d-editor-master\panda3d-editor-master\src\pandaEditor\commands.py", line 1, in <module>
    import wx
  File "C:\Panda3D-1.7.2\python\Lib\site-packages\wx-2.9.4-msw\wx\__init__.py", line 45, in <module>
    from wx._core import *
  File "C:\Panda3D-1.7.2\python\Lib\site-packages\wx-2.9.4-msw\wx\_core.py", line 4, in <module>
    import _core_
ImportError: DLL load failed: The specified module could not be found.

In wingide I have tried choosing the ppython.exe in the panda/python folder. I’m not sure how you’d set the path there. Is it necessary to set the path via windows?

Hi!

Looking into panda c sources looks like its a way it treats “keep” tag on model (polyset and descend is just a modificators and “keep” is a boss which tell to generate collisions from visible geometry and keep both geometry and colnode).

    // A collision group: create collision geometry.
    node = new CollisionNode(egg_group->get_name());

    make_collision_solids(egg_group, egg_group, (CollisionNode *)node.p());
    if ((egg_group->get_collide_flags() & EggGroup::CF_keep) != 0) {
      // If we also specified to keep the geometry, continue the
      // traversal.  In this case, we create a new PandaNode to be the
      // parent of the visible geometry and the collision geometry.
      PandaNode *combined = new PandaNode("");
      parent->add_child(combined);
      combined->add_child(node);
      node = combined;
      
      EggGroup::const_iterator ci;
      for (ci = egg_group->begin(); ci != egg_group->end(); ++ci) {
        make_node(*ci, combined);
      }
    }

So panda creates empty node as parent for both colnode (which hold right name!) and geometry. Think whats a reason of those unnamed nodes in a scene graph. Not sure, why they create unnamed nodes instead of named one, is it to keep some BC? Maybe rdb know?

I think easiest way to run panda with wx is to install wxpython into panda builtin python. Whats how I did it:

  1. uninstall standalone python installations if any
  2. install panda 1.8, update paths if neccesary (if you on Win add path to panda/python to Path variable; also it may be needed to add path to panda lib)
  3. after this you must be able to run panda samples with panda builting python; if not - try run any sample and add path libs it want to Path var
  4. install wxpython in panda/python/Lib/site-packages;
    make sure it installed directly under site-packages, like site-packages/wxpython-blahblah
  5. try to run editor

I think its will better for you to place such questions in Scripting issues subforum.

I’ll try that. But I have strangely got it going up to that point. Presumably you can use the default python if installed correctly as the choice in wingide. I’m not sure how people run these things. But I’ll carry this on in the other thread I started rather then there being two.
thanks

@JamesR - Sorry for not replying to your post earlier. I’m not sure how Wing IDE works to be honest. I use Komodo or Pype and just run things from the command line. Make sure you can start the editor with “ppython main.py” from the command line and get that working - then we’ll worry about getting it working with your IDE. Also - you’ll need to use Panda 1.8 for the editor to run as it uses Bullet classes.

I had a suspicion that might be the case. Not sure if drwr or rbd are tracking this thread and can give us an idea of how this works, otherwise I can do some tests (might not be for a week or so, things are pretty busy IRL).

@Nemesis#13 - This works until the number of unnamed nodes changes in the hierarchy, so if an artist reexports an asset and names an previously unnamed node, or removes a node then all edits below that node will be lost.

@Thaumaturge - I had considered this approach but decided against it as it involves saving a lot of duplicate data (ie, the entire hierarchy) for even a small tweak to one node. This could result in a lot of redundant data being saved.

I’m still leaning towards going by name, if only there was a way to ensure models were properly named. Maybe I can do that during asset import time and alert the user if a model doesn’t comply. Crolli - what program are you making your models in?

Do you get an import publisher error for not having the files in the wx folder path? As I have passed the no wx error to a publisher name error.

I can elaborate the terminology if needed, but I just wanted to drop the issue in.

Hmm… Do you really often have that many duplicated hierarchies, or am I missing something?

Additionally, I’m inclined to suggest keeping the system flexible in its pipeline: a pipeline with strict requirements may make life more difficult for the artists when they come to use the editor.

Another thought, perhaps: start with my hierarchy suggestion, but for each copy, instead of replicating the entire structure, store a reference to the original and a list of changes made to it. While more complex and potentially more error-prone, this might reduce the redundancy, it seems to me.

I am using Blender 2.6 + YABEE exporter. And as I remembder Blender also assign names to each shape created, so all nodes must be named in exported egg file.

If its a just visual presentation “feature” of “keep” tag, can it be solved in presentation layer of editor also? So, while processing tree for scene graph you can check for this special case - unnamed parent node with first child be named collision node - and just grab name from colnode and display it? No need to rename unnamed nodes, only display name changes; panda internals stays the same.

But if it affects more than just visual look of scene graph panel, then I am stuck since I dont understand what the problem with assets reimports etc., sorry.

Just committed a bunch of changes, mostly to clean up some atrocious code and fix a few bugs. I have added something which is fun to play with however: you can now run physics simulations inside the editor. Create a bullet world some rigid bodies and shapes, connect them up and hit the ‘P’ button on the modify toolbar to start the simulation. Yay physics!

I’ve just downloaded the latest code and tried to run it. The GUI opens and the Panda3D view also opens up. But the Log Pane shows this:

Using plugins path:  /home/n1nsun/down/panda3d-editor-master/src/userPlugins
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 14665, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "/home/n1nsun/down/panda3d-editor-master/src/pandaEditor/app.py", line 110, in FinishInit
    self.game.OnInit()
  File "/home/n1nsun/down/panda3d-editor-master/src/pandaEditor/game/base.py", line 16, in OnInit
    self.pluginMgr.Load()
  File "/home/n1nsun/down/panda3d-editor-master/src/pandaEditor/game/plugins/manager.py", line 50, in Load
    plugin = self.LoadPlugin( fileName )
  File "/home/n1nsun/down/panda3d-editor-master/src/pandaEditor/editor/plugins/manager.py", line 12, in LoadPlugin
    temp = __import__( fileName, globals(), locals(), ['editorPlugin'], -1 )
  File "/home/n1nsun/down/panda3d-editor-master/src/userPlugins/primitives/__init__.py", line 1, in <module>
    import gamePlugin
  File "/home/n1nsun/down/panda3d-editor-master/src/userPlugins/primitives/gamePlugin/__init__.py", line 2, in <module>
    from gamePlugin import GamePlugin
  File "/home/n1nsun/down/panda3d-editor-master/src/userPlugins/primitives/gamePlugin/gamePlugin.py", line 4, in <module>
    from sphere import Sphere
  File "/home/n1nsun/down/panda3d-editor-master/src/userPlugins/primitives/gamePlugin/sphere.py", line 6, in <module>
    from primitiveNPO import PrimitiveNPO
ImportError: No module named primitiveNPO

Importing an egg file also fails and gives errors, as does closing the window. (had to terminate it from outside)

Hi Nemesis,

Sorry about that - submitted something I shouldn’t have. Try it again now.

Ok, looking like that one is fixed.

When trying to start a new project, this is what i get:

Using plugins path:  /home/n1nsun/down/panda3d-editor-master/src/userPlugins
Traceback (most recent call last):
  File "/home/n1nsun/down/panda3d-editor-master/src/pandaEditor/ui/mainFrame.py", line 263, in OnFileNewProject
    self.SetProjectPath( dirPath )
  File "/home/n1nsun/down/panda3d-editor-master/src/pandaEditor/ui/mainFrame.py", line 554, in SetProjectPath
    self.app.project.Set( dirPath )
  File "/home/n1nsun/down/panda3d-editor-master/src/pandaEditor/project.py", line 124, in Set
    self.dirWatcher.setDirectory( self.path )
  File "/home/n1nsun/down/panda3d-editor-master/src/utils/directoryWatcher.py", line 49, in setDirectory
    self.before = self._recurse( self.dirPath )
  File "/home/n1nsun/down/panda3d-editor-master/src/utils/directoryWatcher.py", line 41, in _recurse
    for path, dirs, files in os.walk( dirPath, True )
  File "/home/n1nsun/down/panda3d-editor-master/src/utils/directoryWatcher.py", line 29, in setDict
    fDict[key] = os.path.getmtime( key )
  File "/usr/lib/python2.7/genericpath.py", line 54, in getmtime
    return os.stat(filename).st_mtime
OSError: [Errno 2] No such file or directory: '/home/n1nsun/down/panda3d-editor-master/src/proj2\\project.xml'

Looks like a hardcoded backslash.

Also the gizmos don’t turn off the view panning for me. Every time I click on an arrow or rotation circle the camera view changes along with the modified object. If there is some state checking, it seems to not work for me.

Should be fixed now. Thanks for pointing this out.

I’ll have a look into this. It might be a bit hard because I can’t get a repro on win7. Some of the state checking is a bit dodgy, I seem to remember - so maybe a clean up will fix the issue.

Are you able to use the editor if you switch to no gizmo (Q or cursor)?

EDIT: @Crolli - Just did a few tests with polyset keep descend. Using that flag does indeed cause the unnamed nodes to appear - the unnamed node is the geom node and the node with the original name becomes the collision node under it. There’s not much I can do unless we can detect a node tagged in this way using getTag() or getPythonTag().

However, I’ve just hacked together a plugin based on this code: [url]GeomNode vs CollisionPolygon] which would take a nodepath and convert it to a collision solid without having to use polyset keep descend. Doing it this way would give you better control over how the hierarchy ends up.

EDIT2: I’ve just tried the same trick with BulletTriangleMeshShape and it works quite well. It seems like this part of the pipeline closely resembles the existing Blender pipeline, ie you tag geometry in your editor and parse the model game-side and turn NodePaths into the nodes you need. Hopefully this should make it easier for those considering using the editor who are coming from the Blender pipeline.

Ok, I think wx python is installed correctly now. This is the error I have got.
Currently I have copied and pasted the two folders from the panda3d editor folder to the site packages folder as well. Is this the wrong place for them to be on the python path?

more information.
[evaluate main.py]
Traceback (most recent call last):
  File "F:\Wing IDE 101 4.1\src\debug\tserver\_sandbox.py", line 4, in <module>
    #print 'Exiting sandbox process'
  File "F:\panda3d-editor\panda3d-editor-master\src\pandaEditor\__init__.py", line 13, in <module>
    from project import Project
  File "F:\panda3d-editor\panda3d-editor-master\src\pandaEditor\project.py", line 8, in <module>
    from wx.lib.pubsub import Publisher as pub
ImportError: cannot import name Publisher

Ok, this stumps me. As far as I’m aware the publisher should come with wx as default.

A few suggestions:

  • What version of wx widgets are you using?
  • Can you run a simple script with “import wx”?
  • Do you get the same result when not running from wings?

I have successfully run one of the wxwidget .exe programs to show a simple gui. Presumably that uses the import function.

I’m using wx version 2.9.4 where in the pubsub folder it has the file pub.
Presumably it isn’t workable to have ‘import pub’ There is a point to that, that they haven’t altered Publisher to pub and it cannot import Publisher??
(I.e. the correct interpretation of the code isn’t actually to import the file ‘Publisher’ but refer to it as ‘pub’.
The simplest thing would be to know which version of wx are you using?

Anyway, I did try to alter the references and eventually got an error.

 File "F:\panda3d-editor\panda3d-editor-master\src\wxExtra\customTreeCtrl.py", line 13, in __init__
    self.SetFirstGradientColour( wx.Color(46, 46, 46) )
AttributeError: 'module' object has no attribute 'Color

Its not funny being this ignorant, I’m trying to learn pi3d for the raspberry pi as well, but Panda3d will be far more developed.

This is very odd. I’m using wx v2.8, but unless they have made major revisions I doubt they would have re / moved the wx.Color and publisher classes.

Can you try wx v2.8?

I will do. I tried installing Pandemonium yesterday (I’m not sure if you’ve had a chance to look through some of the features there.) That gave me any number of problems until I completely uninstalled things and reinstalled wx.
Including not using the packaged version of wx, but I’m quite sure it was all a messed up installation.

Anyway, that’s on Panda 1.7.1 and wx 2.8.

Really it would be useful to be able to control separate installations. But just getting things to run would be nice, but at least we’ll have a better idea of the incompatible versions, though it can still be a installation problem even with the correct versions.

I’ll let you know how I get on.