Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QtnProperty in AwesomeBump. #71

Closed
kmkolasinski opened this issue Jan 12, 2016 · 78 comments
Closed

QtnProperty in AwesomeBump. #71

kmkolasinski opened this issue Jan 12, 2016 · 78 comments
Assignees

Comments

@kmkolasinski
Copy link
Owner

This issue may interesting for you guy's: @ppiecuch , @CapsAdmin , @Hevedy , @DaOnlyOwner

After short conversation with @ppiecuch we decided to include the QtnProperty library to AB. However I've have tuned manually some features in that library, which I include in the Source code in the Sources/utils folder.

We are going to replace manually created sliders and checkboxes by QtnProperties classes such that the GUI should became more flexible for further modifications. The current version of Source does not do the job correctly only the hue parameter works, for now, but I will slowly try to replace all the scrollbars there. Note, that in my opinion it will be better if certain tool remain unchanged, for example the BasemapToOthers tool will be much easier to control with the form it is now. I would like to ask @orthographic-pedant at the end of migration process to check all the grammar mistakes ;) since now almost all the GUI controls can be found here: Sources/properties.

Steps:

  • Clone AB repository with --recursive option, this will clone additional QtnProperty submodule:
 git clone --recursive https://github.com/kmkolasinski/AwesomeBump.git
  • In order to run AB QtnProperty project must be compiled first. It will produce libraries which are used by AB project during compilation. Probably you will have to setup properly the path to libraries in order to make it work with AB. I managed to build AB on Ubuntu and Win7 using just the QtCreator, but It would be nice to have cmake prepared. @CodePhase could you try to make cmake script for current configuration? However QtnProperty requires two additional libraries
Flex 2.5.37 and Bison 2.7, 

( Flex 2.5.37 and Bison 2.7 for Windows can be found here)

  • Having QtnCompiled you must point in AB project where are the compiled libraries for linker. Then you can compile AB.
  • Maybe you have some better idea how it could be automatize ???
  • That is how AB are going to look like: only hue is working for now.

Image

  • I've added possibility to customize 3D rendering output with different post-processing parameters:
    Image
  • In the bottom there is a tool which allows you to use your own shader
    Image
  • This shader has to be located in Core/Render folder and has to follow proper rules which are explained in the Template.frag file. It is recommended to copy this file and follow the rules inside. The AwesomeBump.frag file contains AB PBR engine.
    Image
  • Inside you can declare up to 20, specially formatted, float/int uniforms which will be then parsed and generated in the "Rendering settings" widget:
    Image
    In the bottom you can see that there is a refresh button which allows you for run-time compilation of the fragment shader.
  • You may try to write your own frag shader, so that we will be able to create a library of shaders for other users :)
@ppiecuch
Copy link
Collaborator

I have my fork of QtnProperty that does not require a separate building -
you only need to include "QtnProperty.pri" in AwesomeBump.pro - I will
include this as a submodule later with linux binaries of PEG tool.

Regards
Pawel

On Tue, Jan 12, 2016 at 11:52 PM, Krzysztof Kolasinski <
notifications@github.com> wrote:

Assigned #71 #71 to
@ppiecuch https://github.com/ppiecuch.


Reply to this email directly or view it on GitHub
#71 (comment).

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@CodePhase
Copy link
Collaborator

I'd be happy to work to keep this new development compatible with the cmake builds. I'll add those two libraries as requirements and get it working. Which branch will be used for this effort?

@kmkolasinski
Copy link
Owner Author

master branch :P

@CodePhase
Copy link
Collaborator

Ha ha, ok. I'll dig into it.

@CodePhase
Copy link
Collaborator

One thought though. Instead of tweaking the base library and having to do multiple compile passes, can't you just override the classes that need to be changed in the default QtnProperty libraries? I think that would be a better approach. Of course knowing nothing about the library or the changes that need to be made, maybe it's easier/better to do it this way. Just wanted to make that suggestion.

@kmkolasinski
Copy link
Owner Author

I had a conversation with author of the library, he said that will update his code to fulfil my requirements, so maybe in future there will be no needs to modify the source code.

@CodePhase
Copy link
Collaborator

To me this would be all the more reason to adopt an inheritance model and overriding the necessary classes. It would make reverting your code easier in the future when the base library is updated because you could just drop your inherited classes and replace them with the default ones. Further, if the original author doesn't change it in all the ways you need you'll have to modify the base code again. It'll also be harder to maintain your version of that library while including new changes from the base version in the future. I think being able to inherit and override classes is one of the most powerful features of object oriented languages for these types of reasons. However, I'm fine with either approach but just wanted to mention it so you'd at least have it in your mind.

@kmkolasinski
Copy link
Owner Author

You are right, but lets, wait for the QtnProperty update, then we can do as you said. I don't know what exactly he is going to change, so it will be better to wait till this moment. I'm going to update today more properties in the left panel.

@CodePhase
Copy link
Collaborator

Ok, sounds like a plan. I'll try to get rolling on keeping the cmake compatibility soon.

@ppiecuch
Copy link
Collaborator

Hi All

I would like to integrate with AB (as a submodule) my fork of qtproperty:
https://github.com/ppiecuch/QtnProperty

My fork is self-contained: you can only include
https://github.com/ppiecuch/QtnProperty/blob/master/QtnProperty.pri
in .pro file - no separate compilation is necessary.

I think it is quite easy to convert QtnProperty.pri into cmake file.

I will include in my repo PEG tools for win/linux/osx (currently only OS X
is available - linux is on its way).

Btw: my fork is always up-to-date with upstream repo.

Regards
Pawel

On Wed, Jan 13, 2016 at 1:59 PM, Krzysztof Kolasinski <
notifications@github.com> wrote:

I had a conversation with author of the library, he said that will update
his code to fulfil my requirements, so maybe in future there will be no
needs to modify the source code.


Reply to this email directly or view it on GitHub
#71 (comment)
.

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@kmkolasinski
Copy link
Owner Author

Thanks,
So in that case all the changes in QtnProperty will happen on your fork?

@ppiecuch
Copy link
Collaborator

Yes - I am heavy user of this library - it is always up to date + I am
working on some extensions like some custom-types, keyboard shortcuts etc.

Regards
P.

On Wed, Jan 13, 2016 at 4:07 PM, Krzysztof Kolasinski <
notifications@github.com> wrote:

Thanks,
So in that case all the changes in QtnProperty will happen on your fork?


Reply to this email directly or view it on GitHub
#71 (comment)
.

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@kmkolasinski
Copy link
Owner Author

Ok!
I decided that it will be better to keep all properties like in your example, mixing normal buttons with QtnProperty will demand a lot of work, and will be hard to add some extensions in future.

@kmkolasinski
Copy link
Owner Author

Could you remove qtnproperty submodule from my repo and replace by yours?

@ppiecuch
Copy link
Collaborator

replaced

P.

On Wed, Jan 13, 2016 at 4:19 PM, Krzysztof Kolasinski <
notifications@github.com> wrote:

Could you remove qtnproperty submodule from my repo and replace by yours?


Reply to this email directly or view it on GitHub
#71 (comment)
.

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@kmkolasinski
Copy link
Owner Author

Ok, thanks.
I need an advice, putting everything to QtnProperty will require huge amount of work, basically I started to write new class - images container. I don't see any better solution for now, by better I mean easier to implement.
So since I have to write new container for images and textures maybe this is a good point to start thinking about background rendering of textures... I have to rewrite at least half of the code :/

@kmkolasinski
Copy link
Owner Author

I have to think about this, otherwise it will take months to make it work... It will be much easier if tabs will stay as they are, so logic will be the same only parameters management will be different

@ppiecuch
Copy link
Collaborator

For me tabs are ok - it is the content of tabs, that is the problem. In my
opinion, cleanup the content is important. Also, we may later replace tabs
with stacked widget + combobox for selection (like I did in my fork) - it
solves the problem of too many tabs displayed on the screen.

Regards
P.

On Wed, Jan 13, 2016 at 5:10 PM, Krzysztof Kolasinski <
notifications@github.com> wrote:

I have to think about this, otherwise it will take months to make it
work... It will be much easier if tabs will stay as they are, so logic will
be the same only parameters management will be different


Reply to this email directly or view it on GitHub
#71 (comment)
.

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@CodePhase
Copy link
Collaborator

@ppiecuch, I'm trying to compile the Core submodule you included in your commit 2f11c52 but I'm getting errors on both the CLI (with cmake and/or gnu compilers directly) and also with QT Creator. It seems that there are some variables that are not declared:

[  9%] Building CXX object CMakeFiles/QtnPropertyCore.dir/PropertyBase.cpp.o
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp: In function ‘void qtnScriptRegisterPropertyTypes(QScriptEngine*)’:
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp:72:37: error: ‘qtnPropertyIdToScriptValue’ was not declared in this scope
     qScriptRegisterMetaType(engine, qtnPropertyIdToScriptValue, qtnPropertyIdFrom
                                     ^
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp:72:65: error: ‘qtnPropertyIdFromScriptValue’ was not declared in this scope
     qScriptRegisterMetaType(engine, qtnPropertyIdToScriptValue, qtnPropertyIdFrom
                                                                 ^
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp:73:37: error: ‘qtnPropertyStateToScriptValue’ was not declared in this scope
     qScriptRegisterMetaType(engine, qtnPropertyStateToScriptValue, qtnPropertySta
                                     ^
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp:73:68: error: ‘qtnPropertyStateFromScriptValue’ was not declared in this scope
     qScriptRegisterMetaType(engine, qtnPropertyStateToScriptValue, qtnPropertySta
                                                                    ^
CMakeFiles/QtnPropertyCore.dir/build.make:62: recipe for target 'CMakeFiles/QtnPropertyCore.dir/PropertyBase.cpp.o' failed
make[2]: *** [CMakeFiles/QtnPropertyCore.dir/PropertyBase.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/QtnPropertyCore.dir/all' failed
make[1]: *** [CMakeFiles/QtnPropertyCore.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Is there a specific library I need to install to get this to work? I have QT Strings, Core, GUI, etc already installed. Are these undefined variables specific to your code? I tried Google to find if they were part of another library but had no success.

@kmkolasinski
Copy link
Owner Author

Did you try to compile oryginal library?

@ppiecuch
Copy link
Collaborator

Hi

No - library is self-contained. I am just building linux binaries right now
and will commit all changes tomorrow.

Regards
Pawel

On Wed, Jan 13, 2016 at 8:32 PM, CodePhase notifications@github.com wrote:

@ppiecuch https://github.com/ppiecuch, I'm trying to compile the Core
submodule you included in your commit 2f11c52
2f11c52
but I'm getting errors on both the CLI (with cmake and/or gnu compilers
directly) and also with QT Creator. It seems that there are some variables
that are not declared:

[ 9%] Building CXX object CMakeFiles/QtnPropertyCore.dir/PropertyBase.cpp.o
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp: In function ‘void qtnScriptRegisterPropertyTypes(QScriptEngine_)’:
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp:72:37: error: ‘qtnPropertyIdToScriptValue’ was not declared in this scope
qScriptRegisterMetaType(engine, qtnPropertyIdToScriptValue, qtnPropertyIdFrom
^
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp:72:65: error: ‘qtnPropertyIdFromScriptValue’ was not declared in this scope
qScriptRegisterMetaType(engine, qtnPropertyIdToScriptValue, qtnPropertyIdFrom
^
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp:73:37: error: ‘qtnPropertyStateToScriptValue’ was not declared in this scope
qScriptRegisterMetaType(engine, qtnPropertyStateToScriptValue, qtnPropertySta
^
/home/CodePhase/code/AwesomeBump/Sources/utils/QtnProperty/Core/PropertyBase.cpp:73:68: error: ‘qtnPropertyStateFromScriptValue’ was not declared in this scope
qScriptRegisterMetaType(engine, qtnPropertyStateToScriptValue, qtnPropertySta
^
CMakeFiles/QtnPropertyCore.dir/build.make:62: recipe for target 'CMakeFiles/QtnPropertyCore.dir/PropertyBase.cpp.o' failed
make[2]: *_* [CMakeFiles/QtnPropertyCore.dir/PropertyBase.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/QtnPropertyCore.dir/all' failed
make[1]: *** [CMakeFiles/QtnPropertyCore.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Is there a specific library I need to install to get this to work? I have
QT Strings, Core, GUI, etc already installed. Are these undefined variables
specific to your code? I tried Google to find if they were part of another
library but had no success.


Reply to this email directly or view it on GitHub
#71 (comment)
.

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@CodePhase
Copy link
Collaborator

Yes, I tried your original @kmkolasinski and was able to get that to compile. Thanks for looking at it @ppiecuch. I probably should have mentioned I'm using Linux as my platform.

@kmkolasinski
Copy link
Owner Author

For me it seems to be problem related to include paths, since compilator does not see declarations for classes which actually are in the same project.

@CodePhase
Copy link
Collaborator

Could be, but I'm not sure. I did a search on all instances of the variable qtnPropertyIdToScriptValue and couldn't find the declaration statement (or any other instance of that variable name) anywhere in the code base, other than where the compile error occurred: https://github.com/ppiecuch/QtnProperty/blob/abcd02e4cd33124e92032f1c70871f957d626a56/Core/PropertyBase.cpp#L72. You guys are smart though so I'm sure you'll figure it out :-)

@CodePhase CodePhase reopened this Jan 13, 2016
@CodePhase
Copy link
Collaborator

Opps, wrong button. Didn't mean to close this.

@kmkolasinski
Copy link
Owner Author

Wow, I don't have this in my code, maybe this appear because of the @ppiecuch modification of the library?

@kmkolasinski
Copy link
Owner Author

I don't see any images.

@ppiecuch
Copy link
Collaborator

[image: Inline image 1]

On Mon, Jan 18, 2016 at 10:40 PM, Krzysztof Kolasinski <
notifications@github.com> wrote:

I don't see any images.


Reply to this email directly or view it on GitHub
#71 (comment)
.

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@lexxmark
Copy link
Contributor

@kmkolasinski
I'm working on hot editing now. First draft is ready. See my comments here

@kmkolasinski
Copy link
Owner Author

Ok, so I moved almost everything to QtnProperty. Just did a commit with my changes. Now I will wait for the of changing Float and Int or Double with mouse like horizontal scrollBar. Currently when you have to change parameter with keyboard or mouse wheel is very annoying, in my opinion. Since user does not know where is the min and max value.

@lexxmark
Copy link
Contributor

@kmkolasinski please see answer here

@brothermechanic
Copy link

Hello
I want to try your programm but i have a building problem
$ git clone --recursive https://github.com/kmkolasinski/AwesomeBump.git
$ cd AwesomeBump/Sources
$ /usr/lib64/qt5/bin/qmake
$ make
build log http://www.pasteall.org/63816
Please help me to compile

@kmkolasinski
Copy link
Owner Author

Hi, did you try to build it with QtCreator? and do you really want to work with this unstable version?

@brothermechanic
Copy link

No, i don't. But do it matter?
The latest release is very old. Yes, it will be cool to see latest git version.

@kmkolasinski
Copy link
Owner Author

It should not, however I have sometimes problems with linker during compilation using Qt Creator, which seems to be similar to your. Then after I click "run qmake" in GUI then everything compiles and program runs. Additionally I'm not used to compile AB from command line, other people are doing this, so they can help you.
There were not significant changes since last release, so I would suggest you to try the old one, if you just want to use AB. Current master contains significant changes in GUI nothing else.

@brothermechanic
Copy link

Ok! I will use release version for now.
Thank you for reply!

@brothermechanic
Copy link

Hello, agane
I susses compile 4.0.0, but have segfault

[456841.031079] AwesomeBump[14270]: segfault at 0 ip 00000000004186d9 sp 00007ffe0e71c700 error 4 in AwesomeBump[400000+28f000]
[456848.519756] AwesomeBump[14282]: segfault at 0 ip 00000000004186d9 sp 00007fff2d9d1850 error 4 in AwesomeBump[400000+28f000]

$ AwesomeBump.sh
QIODevice::write (QFile, "log.txt"): device not open
/usr/bin/AwesomeBump.sh: line 4: 14338 Segmentation fault ./AwesomeBump

@kmkolasinski
Copy link
Owner Author

Check your read write permissions:

QIODevice::write (QFile, "log.txt"): device not open

It is very strange that even log.txt does not want to be created.
Did you try to use binary package?

@brothermechanic
Copy link

Now i build master git commit f6ac321
And AwesomeBump works! (Not much tested yet)
ps: But there is another issue!)

@kmkolasinski
Copy link
Owner Author

Great! What kind of issue?

@kmkolasinski
Copy link
Owner Author

@lexxmark After your last commit AB crashes during initialization with assert:

ASSERT: "jt != createItem.createFunctions.end()" in file ../AwesomeBump/Sources/utils/QtnProperty/PropertyWidget/Delegates/PropertyDelegateFactory.cpp, line 51
The program has unexpectedly finished.

Yesterday, I had no problem with it. I commited current version of source code.

@lexxmark
Copy link
Contributor

@kmkolasinski - You should call void regABSliderFloatDelegate(); somewhere in your code.
Just uncomment some lines in main.cpp

@kmkolasinski
Copy link
Owner Author

I'm not using the ABSlider anymore, so I commented the regABSliderFloatDelegate function.
Note that ABSlider is no more in use: ImageProperties.pef

@lexxmark
Copy link
Contributor

You are using it later here and in two more places :o).

@kmkolasinski
Copy link
Owner Author

Oh sorry, a bad day :/ I completely forgot about these guys :( I will fix it tomorrow. Thanks!

@kmkolasinski
Copy link
Owner Author

Ok, shame on me! Now, it works :)
I will spend few days to finish slider then I will play with Buttons and Colors.
However I have question: Where this is done in code?

grab  0x0  -  0xece0030
release  0xece0030  -  0xece0030

It should be commented :)

@lexxmark
Copy link
Contributor

grab 0x0 - 0xece0030
release 0xece0030 - 0xece0030

Well I don't see this debug output in my last master commit.
Anyway I've cleaned up the code and will commit soon.

Also @kmkolasinski and @ppiecuch - we can create hybrid delegate factory function for Button which will create Link delegate undex OSX and Button delegate otherwise.

I must remind that I'm doing some files reorganizations in QtnProperty so excuse me for possible compile errors in your code (missing includes).

@kmkolasinski
Copy link
Owner Author

Hmm, maybe it is in AwesomeBump source, but I did not write this... I will search for this in my code later.
For me simple button is OK.

@lexxmark
Copy link
Contributor

Hmm, maybe it is in AwesomeBump source, but I did not write this

Actually I did it but removed in last master commit

@PoULkY
Copy link

PoULkY commented Jan 28, 2016

hello
I already clone this repo but when git cloning QtnProperty, it comes error

fatal: reference is not a tree: d7140711e148ce3259f6817459fdbe6b10b3435d

Unable to checkout 'd7140711e148ce3259f6817459fdbe6b10b3435d' in submodule path 'Sources/utils/QtnProperty'

Is there something wrong ?

@kmkolasinski
Copy link
Owner Author

Dear all,
finally me and @lexxmark have managed to make QtnPoperty working with AB!
I pushed today a large commit with many changes. Now, I think new GUI should work fine, however for sure there still will be some minor BUGs.
In next step, I will try to fix some other issues reported by users, and during this time it would be nice to have a nice script for AB compilation.

I'm closing this long issue and in case of any problems please set up a new one.

@CodePhase
Copy link
Collaborator

Very good news and congratulations! I'll try and find some time for an updated cmake compile script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants