Asset editor

Works in progress and technical screen shots.

Moderator: joepal

Asset editor

Postby joepal » Mon Dec 05, 2016 9:57 am

Me and Aranuvir have been working on a new plugin: the asset editor.

The goal of this editor is to allow the user to edit asset metadata and settings via the GUI rather than having to manually edit the asset text files. Further, the editor will ensure correct file encoding, correct line endings, and give best practice recommendations.

asseteditor_wip.png


asseteditor_wip2.png


To test this, download the repo at https://github.com/makehumancommunity/community-plugins and then copy everything from the makehuman dir (https://github.com/makehumancommunity/c ... /makehuman) to your plugins directory.

Note that this is a first test version. You may want to manually backup asset files before editing them, in case something gets messed up.

A known limitation is that all added fields will end up at the bottom of the asset file. This doesn't make any functional difference, but for readability reasons it might be better if the settings were collected at the top. Also, the best practice recommendations are still pretty few and rather crude.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 3942
Joined: Wed Jun 04, 2008 11:20 am

Re: Asset editor

Postby CallHarvey3d » Mon Dec 05, 2016 1:41 pm

this is cool. can i test this with 1.1.0 or do i need to be using something fancy? can it show poly count?
CallHarvey3d
 
Posts: 246
Joined: Wed Mar 09, 2016 3:33 pm

Re: Asset editor

Postby RobBaer » Mon Dec 05, 2016 2:24 pm

Congratulations to you and Aranuvir. This could be incredibly useful.

My first quick try at this caused exceptions to occur when I clicked on an asset.

Code: Select all
Exception during event onFileSelected
Traceback (most recent call last):
  File "./core\events3d.py", line 211, in callEvent
    method(event)
  File "plugins/8_asseteditor\asseteditor.py", line 195, in onFileSelected
    assetInfo = mhapi.assets.openAssetFile(filename)
AttributeError: 'API' object has no attribute 'assets'

I guess the mhapi folder has been updated because reinstalling the latest version of mhapi fixed the problem. Guess I should learn to read, "copy everything " :)
User avatar
RobBaer
 
Posts: 1070
Joined: Sat Jul 13, 2013 3:30 pm
Location: Kirksville, MO USA

Re: Asset editor

Postby RobBaer » Mon Dec 05, 2016 2:30 pm

CallHarvey3d wrote:this is cool. can i test this with 1.1.0 or do i need to be using something fancy? can it show poly count?


Currently (12-5-2016) , this works with the bitbucket Mercurial version (on Windows at least), but not the release version of MH 1.1.0 where it produces an exception:
Code: Select all
Could not load 8_asseteditor
Traceback (most recent call last):
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\mhmain", line 528, in loadPlugin
  File "plugins/8_asseteditor\__init__.py", line 29, in <module>
    from asseteditor import AssetEditorTaskView
  File "plugins/8_asseteditor\asseteditor.py", line 33, in <module>
    import uuid
ImportError: No module named uuid

I'm sure this will be fixed shortly.
User avatar
RobBaer
 
Posts: 1070
Joined: Sat Jul 13, 2013 3:30 pm
Location: Kirksville, MO USA

Re: Asset editor

Postby Aranuvir » Mon Dec 05, 2016 2:45 pm

The editor is still under heavy development and it shouldn't be used for productive things, yet.
@Rob: The uuid error you are reporting is interesting. Are you on Linux or Windows? I thought the uuid module is a common module and can't remember to have installed it separately.

Edit: maybe we should have an extra bug tracker for plug-ins.
Aranuvir
 
Posts: 1249
Joined: Sun Oct 12, 2014 2:12 pm

Re: Asset editor

Postby RobBaer » Mon Dec 05, 2016 2:54 pm

Aranuvir wrote:The editor is still under heavy development and it shouldn't be used for productive things, yet.
@Rob: The uuid error you are reporting is interesting. Are you on Linux or Windows? I thought the uuid module is a common module and can't remember to have installed it separately.


This was a quick test on Windows 10. Haven't had much free time lately so I haven't gotten to Linux yet. Worked fine with the Hg version, but I haven't had time to find out what's happening to cause the uuid exception on plugin loading with the install version. I can only gather that this python module is not included with the build version.
User avatar
RobBaer
 
Posts: 1070
Joined: Sat Jul 13, 2013 3:30 pm
Location: Kirksville, MO USA

Re: Asset editor

Postby joepal » Mon Dec 05, 2016 3:46 pm

RobBaer wrote:Currently (12-5-2016) , this works with the bitbucket Mercurial version (on Windows at least), but not the release version of MH 1.1.0 where it produces an exception:
Code: Select all
Could not load 8_asseteditor
Traceback (most recent call last):
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\mhmain", line 528, in loadPlugin
  File "plugins/8_asseteditor\__init__.py", line 29, in <module>
    from asseteditor import AssetEditorTaskView
  File "plugins/8_asseteditor\asseteditor.py", line 33, in <module>
    import uuid
ImportError: No module named uuid

I'm sure this will be fixed shortly.


Huh.

Yeah, I can see why that happens with the build. The pyinstaller compiler only includes stuff actually used, and it seems the rest of the MH code only uses home-brewed uuid routines.

I've pushed a fix I think temporarily "solves" this. The uuid module will now only be imported if you push the "generate uuid" button. So the rest should work even if uuid isn't available.

Any chance you could test this?
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 3942
Joined: Wed Jun 04, 2008 11:20 am

Re: Asset editor

Postby joepal » Mon Dec 05, 2016 3:49 pm

CallHarvey3d wrote:this is cool. can i test this with 1.1.0 or do i need to be using something fancy? can it show poly count?


With the fix I pushed just now, you should just have to copy stuff from the repo to your plugins directory. Nothing fancy needed, and the stable 1.1.0 release should suffice on any platform.

No, the editor only works on the text files (mhclo, mhmat etc). It doesn't edit or analyze any binary assets (ie for example obj files).
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 3942
Joined: Wed Jun 04, 2008 11:20 am

Re: Asset editor

Postby joepal » Mon Dec 05, 2016 3:50 pm

Aranuvir wrote:Edit: maybe we should have an extra bug tracker for plug-ins.


There is an issue tracker on github we can use for the community plugins, if the main bugtracker isn't applicable.

https://github.com/makehumancommunity/c ... ins/issues
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 3942
Joined: Wed Jun 04, 2008 11:20 am

Re: Asset editor

Postby Aranuvir » Tue Dec 06, 2016 11:08 am

On Windows uuid4.py from makeclothes is used now on my development branch. @Rob: Could you clone my branch (https://github.com/makehumancommunity/c ... e/Aranuvir) and check if the uuid generator works on windows? uuid4.py creates errors on my Linux system.
Aranuvir
 
Posts: 1249
Joined: Sun Oct 12, 2014 2:12 pm

Next

Return to WIP (Work In Progress)

Who is online

Users browsing this forum: No registered users and 1 guest