Yep. Another scene editor...

The handle is not available until after the panel is shown. The initialization doesn’t have to do much with that. Even after initialization, but without Show() the handle is None.
That’s why I bind an event to the top most window (GetTopLevelParent), so that it calls panda as soon as it shows up. This works on Linux and probably Mac. Windows needs a little tick more of time. That’s why it’s delayed a short time using CallAfter. There are probably better ways, but this worked for me every time on Windows and Linux.

Thanks kurohyou, works now, but on start it write to log “Failed to load plugins.”; not sure is it error, because controls looks all working.

So, I dropped a ball in scene, setup camera, played with gizmos a bit and build a project.
Looking at console I see checks for latest updates from cmu site and some notices on build:

Failed to load plugins.
:AppRunner: Total Panda3D disk space used: 280 MB
:AppRunner: Configured max usage is: 2048 MB
:Packager: Reading build.pdef
There are some missing modules: ['game']
:loader: Reading /d/2x/qx/models/light.bam
Generating qx.p3d

And when I run p3d file it just opens panda window and close in a second, nothing more. Something wrong with how I build a project?

Thanks for hard work and your time!

@crolli - the Plugins message is fine for the moment but I’ll look into that missing modules issue. Can you run the p3d file from the command prompt just the verify for me? Thanks!

@nem - thanks mate, I’ll give that a shot. Could you test it for me if I send you the fix (I’m assuming you’re running Linux)?

[EDIT] - Crolli, I’ve just submitted a fix for that builder problem. Please get latest and let me know if you still have issues.

Sorry, thats my fault - didnt noticed line on test.xml in readme and saved under another name.
With last update from github I got notices about missing modules userPlugins and xml.etree.cElementTree.

If I run p3d from console, it still open and close in a second. But all run fine by hand (main.py from folder generated by build process) if I add editor/src to python path or append to sys.path.

Hope this helps :slight_smile:

You should be able to save your scene file as any name you like, so long as you change the name in main.py.

If you want to launch from main.py (without building) putting p3d and game on sys.path should be enough. I’m not sure if putting editor on sys.path will make it work - even if it does, it’s not really designed for it and may break in the future!

When you run the built p3d file from the command line what output does it give you? p3d and game are the only real dependencies and the building should make sure to include those. Send me the output and I’ll see what I can do.

Seems I have run p3d with panda3dw.exe, which is window version and thus shows no errors at all. Running with panda3d.exe from runtime, I got wx and xml.etree missing:

:ShowBase: Successfully opened window of type wglGraphicsWindow (OpenGL)
AL lib: dsound.c:85: Failed to load dsound.dll
Failed to find wx module
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "main.py", line 3, in <module>
  File "VFSImporter", line 153, in load_module
  File "D:/1x/panda3d-editor/src/pandaEditor\game\__init__.py", line 3, in <module>
    from base import Base
  File "VFSImporter", line 153, in load_module
  File "D:/1x/panda3d-editor/src/pandaEditor\game\base.py", line 3, in <module>
    from sceneParser import SceneParser
  File "VFSImporter", line 153, in load_module
  File "D:/1x/panda3d-editor/src/pandaEditor\game\sceneParser.py", line 1, in <module>
    import xml.etree.cElementTree as et
ImportError: No module named cElementTree
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 638, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 502, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 460, in step
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "main.py", line 3, in <module>
  File "VFSImporter", line 153, in load_module
  File "D:/1x/panda3d-editor/src/pandaEditor\game\__init__.py", line 3, in <module>
    from base import Base
  File "VFSImporter", line 153, in load_module
  File "D:/1x/panda3d-editor/src/pandaEditor\game\base.py", line 3, in <module>
    from sceneParser import SceneParser
  File "VFSImporter", line 153, in load_module
  File "D:/1x/panda3d-editor/src/pandaEditor\game\sceneParser.py", line 1, in <module>
    import xml.etree.cElementTree as et
ImportError: No module named cElementTree

I am running python coming with panda3d sdk, wx is installed in panda python lib/site-packages because I dont have separate python installation. Can it be a problem?
I think wx is not required to run built game script?

Can runtime be installed incorrectly or conflict with sdk? But I have checked runtime on your site, it works with sample from Full Pipeline Test topic.

This is just a warning as I haven’t separated my wxPanda stuff from the rest of my libs. It shouldn’t stop the p3d file from opening.

I’ve had this before but I thought I fixed it. I think this happens because this is the C++ implementation of the xml parser, which uses a dll instead of the pure python version. If you want to test this, open src\pandaEditor\game\sceneParser.py and change

import xml.etree.cElementTree as et

to

import xml.etree.ElementTree as et

Let me know if that works. I’d like to get the C++ version of this working however, as it will speed up the loading of larger scenes. It’s probably just a matter of telling ppackage to include it.

Yes, xml.etree.ElementTree fixes this issue, thank you!

Also, while playing with point light “point” control group got this exception in log:

Traceback (most recent call last):
  File "D:\1x\panda3d-editor\src\pandaEditor\ui\propertiesPanel.py", line 273, in OnPgChanged
    cmds.SetAttribute( nps, attr, prop.GetValue() )
  File "D:\1x\panda3d-editor\src\pandaEditor\commands.py", line 73, in SetAttribute
    actn()
  File "D:\1x\panda3d-editor\src\pandaEditor\actions\base.py", line 8, in __call__
    self.Redo()
  File "D:\1x\panda3d-editor\src\pandaEditor\actions\setAttribute.py", line 28, in Redo
    self.attr.Set( np, self.val )
  File "D:\1x\panda3d-editor\src\pandaEditor\game\nodes\attributes.py", line 43, in Set
    return self.SetFn( *args )
TypeError: PointLight.set_point() argument 1 must be LPoint3f, not LVector3f

Looks like line 17 in games/nodes/pointLight.py must be

                Attr( 'Point', pm.Point3, PL.getPoint, PL.setPoint ),

?

Awesome, I’ll change the scene parser to use the python version for the time being.

I’ll take a look at the issue you’ve described. It might just be a case of changing the value type. Let me know what else you come up against. I’ve got some more changes to go in soon, more properties exposed, etc: I’ll be interested to know what you think.

Wow, am waiting :slight_smile:

Have noticed some issues (I understand what this is a early build and this functionality may be missed):

  1. Properties panel work in one way now, i.e. changes made by gizmos not reflected by panel values; but think this simply missed now
  2. Color selector for light better to be rendered with some type of color picker? I am sure wxPython has one
  3. Looks like resulting image can differ from one inside editor - the one I got is slighly darker than in editor. I think because editor uses bright ambient light, but not sure; still looking for code to understand what involved
    4.Working with lights (esp. directional/spotlight) can be tricky thing as its current direction isnt visible. Having small arrow pointing in direction will be real helper.
  4. Looks like resulting code has mouse/camera setuped, so I can fly around world; but Game tab in editor is static instead.
    I think p3d module is responsible for mouse/camera setup and looking into it!

Again, thank for your effort, I think panda3d really need this

Igor

Which properties specifically? As I remember there are no xform values listed in the properties panel currently, so nothing you do with the gizmos will be shown.

This is something I’ve tried already, but opted not to go with. You can set Panda’s lights to have a value past 1 (or 255, according to to the wx colour picker) so you would need two controls - one to pick the desired colour, then one for the intensity. I might revisit this problem again in the future, but I’m open to suggestions.

That sounds odd. Do you mean the built p3d file looks different from the way it looks in the editor? They should look identical unless something is very, very wrong!

There will be a plugin available soon that will fix this issue and allow better interaction with invisible nodes.

I’ve disabled the default camera / mouse setup in the game view tab currently. I’ll think about putting it back in.

No problem! I’m glad you seem to be enjoying the editor, and I really appreciate the feedback and testing. :slight_smile:

Ah, it was a lights “Point” property; as I understand this is light position and thought it must be changed according to current gizmos position.

1 color picker and 1 intensity multiplier sounds much better than 3 up-down controls for me. Really, how many users can get color they want only looking at 3 digits? I simply want some red, but I dont know its code (even more - should I put 0.5, 128, or 0x80 in input field?). So think some color picking is a must have for light colors/model materials.

I did some tests and think problem in light removal - lights are deleted from graph (or at least disappeared from left panel), but they still affects scene lighting - actual light nodes are still here.
Repropduce:
drop model to scene, add light, move it closer so model is lighted, then remove light - model is still lighted. Reloading scene will show correct image.

As I understand it, a point light has a position that comes from the NodePath itself but also has a local position which can be set via the “point” property. I’m not really sure why you would want to move the point off its origin, but there might be instances where you want the light to come from a position offset to where the node actually is in the scene. Maybe someone else can elaborate.

Yes, I agree that the current system isn’t great. It works for the time being and that’s the main thing. I’ll look at this issue again soon.

That’s true. Deleting lights doesn’t work properly at the moment because I wasn’t unlinking the light relationship first. I think I know how to do that now, so I’ll get a fix in soon for that.

In addition - I’ve made another commit which speeds up the UI redraw and reduces flicker, exposes more properties and adds a few more buttons to the gui. Check it out when you get a chance :slight_smile:

Thats was my mistake; when I saw this property first time and changed its value, light it moved - so I decided its a position :frowning: But now I understand its a local offset for light;

Great, just checked updates and found minor bug:
Changing rotation of node changes its position, looks like a typo in editor/nodes/nodePath.py, line 30 should be

attr = Attr( 'Rotation', pm.Vec3, NP.getHpr, NP.setHpr, w=False )

Also, one, hmm, suggestion: can gizmos keys be changed? Like T for translate, S for scale, R for rotate? I understand its a kind of personal habit/taste, but TSR sounds easy to remember because of actions start characters?

How it is going with plugins/behaviours? expecting them with hurry :slight_smile:

Nice catch. Fixed.

There are no user preferences at this stage except for the window layout. This will be a feature in the future however. It shouldn’t be too hard to rebind the keys by hacking the source, if you’re so inclined. Check out src\pandaEditor\app.py line 127.

I’ve got most of this stuff working but I still have some bugs / design to iron out. Then there’s the issue of priorities: what features do users want first? I still don’t have support to add half the default node types and there’s basic functionality still missing (like user prefs, for example). I still have to fix the issue to get it running on Linux too :slight_smile:

Ok, as possible user I think such tool must have this features to became really usefull:

  1. Scene operations - adding/removing nodes, adjusting basic props, store and recreate scene in game - thats already done as I know

  2. Script integration - ability to attach custom scripts to nodes/scene and execute them; override some parts of game classes if required (like custom mouse/camera tracking, shaders/filters setups etc.); We are programmers, so scripting on second place :slight_smile: But I dont even know how I want it to work!

  3. Some material editor, from simplest one to more complex
    3.a Simplest version with ability to modify nodes colors - think no problems here
    3.b Assiging textures to nodes (including support for several texture slots)
    3.c Simple shaders management: for startpanda builtin shaders would be enough, having proper textures assigned to diffuse/normal/gloss channels can give good results.

I know lots of models come with assigned materials/textures, but still think its a must have feature.

Material management brings another small question - resource tracking and updating on changes. Right now imported models converted to bam; if model is changed,I need to store scene, reimport model file and then reload scene to catch updates? I am not talking about tracking original models files changes, but having something to compare date/size for egg/resulting bam and then reloading scene on single user click can be good.

Patched and commited for the time being while I figure out why I can’t use cElementTree.

Yep, got the type wrong. Fixed.

Fixed. I need to put some more work into a light linking as these don’t get saved and don’t work with undo or duplicate. I’ll take a look at that soon.

There’s still a lot of stuff to do here - working with non-NodePath objects (like light relationships) for one. I should probably give this priority as it would be considered base functionality.

I’ll bring what I have online and you can give it a test soon.

This is a big can of worms. I’m pretty sure someone (Craig?) has come up with a solution to this already, but I’ve got a lot on my plate already and this sounds like a huge job. I might look around for another solution I can bundle with the editor before tackling it myself. Do you mean creating shaders (cg) or just dropping textures onto NodePaths (like using setTexture() )?

I’ve already got some directory watchers in place so it wouldn’t be too hard to reload a model in the scene. There’s the question of workflow though, I suppose. If I’m working in Blender and export - do I just export over the top of the .bam in my project folder or do I create a link between the imported .bam and the source file it came from?

Linux users - I’ve got a potential fix for you if anyone is interested - drop me a line if you can test it out for me :slight_smile:

Yes, I mean just dropping textures on node and settings its properties, like wrapping, texture mode (modulate/normal/gloss etc.). All those supported by panda shader generator. I think it can be done with texture stages and their props. Plus materials and may be setShaderAuto on/off per node. For start it should be more than sufficient.
More complex solutions with custom shaders/shader inputs can wait :slight_smile:

I’ve just added a light linker panel which should allow you to edit the relationships of lights in your scene. Give it a go if you can and let me know how it works for you. I’ve also made a start on creating a few editor meshes for invisible nodes like lights and cameras. Hopefully I’ll get the art for the rest of these done soon.

Do you have a list of properties specifically? If it’s just a matter of exposing a few additional values then that should be easy to implement.

I’m using Ubuntu with panda3d 1.8. I tried running main.py but I got an error:

Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py”, line 14636, in
lambda event: event.callable(*event.args, **event.kw) )
File “/home/hapdrop/python/panda3d/panda3d-editor-master/src/pandaEditor/app.py”, line 44, in FinishInit
base.FinishInit()
File “/home/hapdrop/python/panda3d/panda3d-editor-master/src/pandaEditor/showBase.py”, line 19, in FinishInit
self.SetupEdWindow( self.wxGameWin, self.wxEdWin )
File “/home/hapdrop/python/panda3d/panda3d-editor-master/src/pandaEditor/showBase.py”, line 70, in SetupEdWindow
wxGameWin.Initialize()
File “/home/hapdrop/python/panda3d/panda3d-editor-master/src/p3d/wxPanda.py”, line 80, in Initialize
assert self.GetHandle() != 0
AssertionError

Then trying to create a new project (File->Project->New) would give error:

/pandaEditor/ui/mainFrame.py", line 256, in OnFileNewProject
self.app.project.New( dirPath )
AttributeError: ‘App’ object has no attribute ‘project’