zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
115 stars 23 forks source link

Please: Make new release w/ animconvertwin.h changes. #46

Closed m-7761 closed 5 years ago

m-7761 commented 5 years ago

Since you're not working on MM3D presently, can you please prepare an up-to-date release with your changes from here (https://github.com/zturtleman/mm3d/commit/65449c9423eb7e50c151c0cb1b712913f557d738#diff-e5071f507ed38e0720688b3e26ae0bb9) and any others, so I can be able to use them for a comparison on Windows?

Background: I'm in the process of rewriting all of the UI code right now, to switch it to a new system (new project) so I don't have Qt set up for development... doing away with Qt is my prime motivation since I can do in 100 lines of code what the Qt oriented sources do with 4 or 5 files and a thousand lines!!! exhibits A, B:

#ifndef __ALIGNWIN_H__
#define __ALIGNWIN_H__

struct AlignWin : Win
{   
    void submit(int);

    AlignWin(class Model *model)
        :
    Win("Align Selection"),
    model(model),
        x(main,"Align &X Now"),f1(main),
    y(main.inl,"Align &Y Now"),
    z(main.inl,"Align &Z Now"),ok_cancel(main)
    {
        active_callback = &AlignWin::submit;
    }

    Model *model;

    typedef char align_label[sizeof("Align &X Now")];

    struct align_group
    {
        align_group(node *main, align_label l)
            :
        nav(main,""),
        m(1),mult(nav,"",&m),
        v(),value(nav,"",&v),submit(nav,l,l[7])
        {   
            l[6] = l[7]; l[7] = '\0'; //"Align X"
            nav.name(l);            
            mult.add_item("Align minimum").add_item("Align center");
            mult.add_item("Align maximum"); 
            value.expand();
        }

        //NOTE: m/v aren't required. It's just a
        //lot more code to specify the data type
        //as it stands.
        panel nav;
        int m;
        multiple mult;
        double v;
        textbox value; 
        button submit;      
    };
    align_group x; f1_titlebar f1;
    align_group y;
    align_group z; ok_cancel_panel ok_cancel;
};

#endif // __ALIGNWIN_H__
#include "alignwin.h"

#include "model.h"
#include "log.h"
#include "modelstatus.h"
#include "decalmgr.h"

void AlignWin::submit(int i)
{   
    switch(i)
    {
    case 'X': case 'Y': case 'Z':
    {
        align_group *g = &x+i-'X';      
        log_debug("aligning %c on %g\n",i,g->v); //%f       
        extern void align_selected(int,Model*,int,double); //align.cc
        align_selected(i,model,g->m,g->v);
        DecalManager::getInstance()->modelUpdated(model);
        model_status(model,StatusNormal,STATUSTIME_SHORT,::tr("Align %c"),i);
        return;
    }
    case id_ok:

        log_debug("Alignment complete\n");
        model->operationComplete(::tr("Align Selected","operation complete"));      
        break;

    case id_cancel:

        log_debug("Alignment canceled\n");
        model->undoCurrent();
        DecalManager::getInstance()->modelUpdated(model);       
        break;
    }
    basic_submit(i);
}

FWIW this code is using https://sourceforge.net/projects/widgets-95 that is a new UI module I've developed for some cross-platform projects, including a COLLADA native 3D modeling software that I'm basing off MM3D for a start. It has one internal file that makes use of wxWidgets.

zturtleman commented 5 years ago

I can't easily build for Maverick for Windows at the moment due to a PC failure (or just too lazy to get Qt for Windows set up with current temporary PC). The Qt Windows installer takes ~40 GB so I don't blame you for not wanting it. I'll hopefully make a new Maverick release by the end of the year.

Image of animconvertwin dialog: Columns 2/3 are editable and clicking them automatically selects all the text. Column 3 has up/down buttons at right side when it is selected (printscreen deselects it...). Screenshot from 2019-07-03 18-48-34--cropped

m-7761 commented 5 years ago

Thanks. Here (https://sourceforge.net/projects/daedalus-3d/) is a project URL I reserved just now. I will be working on this for hundreds of hours most likely. So when I'm done I will pass along a rewritten version if you're interested in dispensing with Qt. It's actually an interesting exercise since I wouldn't want to use Qt (I've done a lot of preliminary research going into this project) but by virtue of porting Qt code I'm getting exposure to Qt. Between working with it and wxWidgets it's insightful into cross-platform development, which is something new to me.

EDITED: To be blunt, I think the rewritten code might well compress down to a small fraction of the existing code. So in theory it should be of interest to improving on MM3D. But I know that the trend for open-source code is to treat it more like hospice than a way to actually develop life-improving software.

m-7761 commented 5 years ago

P.S. Maybe you have a new #include "animconvertwin.base.h" file handy? I figured out on day 1 that these base.h files are derived from the qtui folder's ui files. I could not find Windows resources on the Qt company website, but I realized Cygwin must have a package with its uic compiler inside. I'm not using the MM3D program as reference, though I usually am hunting down the relevant screen to see it. On the other hand the base.h files don't offer much information either (despite their ample code) but they help a little.

Below is a script for converting the ui files. I might try to build it with Cygwin, I don't know. But I think it can be done with a lot less than 40GB. From the looks of Qt it's a monster, and not a well designed one at that. It seems to want its own IDE and the works. I was surprised to learn that KDE uses Qt exclusively for its native applications. wxWidgets has a budding project to wrap itself around Qt, that might be an option for KDE if its users expect to have Qt or bust.

for file in `ls *.ui` 
do
    ~/uic -o ${file%%.*}.base.h ${file} 
done
m-7761 commented 5 years ago

Related bug: AnimSetWin::convertClicked() doesn't reset its list after using AnimConvertWin.

EDITED: Seems this is the only way to access it.

EDITED: Never mind... I think... I think the old animations aren't deleted by convertAnimToFrame. Sorry.

zturtleman commented 5 years ago

Qt 5.10 taking 40 GB was due to the Windows installer not asking what platforms/targets and installing 14 different ones (mingw.org, MSVC versions, android versions, etc). I don't know if they have improved this.

.base.h files generated by Qt uic 5.7.1 on Debian Stretch from mm3d f0208fc920dc7a9467a62213b907fe4df275e856: allyourbase.zip