Perspective is still available ...

Discussions about MHX2 and other plugins that are developed outside the scope of MakeHuman. Note that bug reports should go to the respective code projects and might go unseen here.

Moderator: joepal

Perspective is still available ...

Postby punkduck » Sun Mar 26, 2017 7:52 pm

A lot of users requested something like a perspective view. My proposal is an additional viewer, maybe in the end combined with the render module of MH ...

But I put that to the animation module, which was meant to show different frames of a bvh file. So I changed plugins/3_libraries_animation.py to reach this goal again.

It will only work with one small change in the library, since the code of MH 1.1 got some changes in camera.py which lead to clipping problems (at least on my box ...)

For all those who are interrested and able to understand the structure of MH please read this article, my answer to a user request. I uploaded the plugin I'm using and wrote about the small change in camera.py, which is really a hack, I guess there must be a better solution but until now I'm still to stupid to figure out what is happening internally.

http://www.makehumancommunity.org/forum/viewtopic.php?f=3&t=13969

The plugin could be changed, so that it always switches back to orthogonal view when you leave it. Consider this as a proposal.
User avatar
punkduck
 
Posts: 1218
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Perspective is still available ...

Postby jujube » Mon Mar 27, 2017 12:08 am

I was one of the people that wanted perspective back then, and was inexplicably told "that's how the pros do it", and to this I say, yes please!! I'm sick of having to export to blender every time I want to take a tiny peek at a character in perspective. And it matters doubly so since this is a program for designing humans; even minor changes make a big difference in how we perceive a face.

The plugin doesn't seem to work for me, though. The human vanishes when I click "perspective".
jujube
 
Posts: 404
Joined: Fri Aug 14, 2015 10:46 pm

Re: Perspective is still available ...

Postby joepal » Mon Mar 27, 2017 12:46 pm

As said in the linked thread:

The opinion about the perspective thing was something of a discussion way back when, and most of the people participating in that discussion have left. I see no reason for why there couldn't be a toggle or something.

However, if this requires a change in the core code, it is a feature which has to be dealt with in the same manner as all other bugs and feature requests, and that might take time.

It'd be easier if someone interested enough in the question wrote the fix as a standalone plugin that could be updated outside the normal release cycle.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4474
Joined: Wed Jun 04, 2008 11:20 am

Re: Perspective is still available ...

Postby punkduck » Mon Mar 27, 2017 6:52 pm

jujube wrote:The plugin doesn't seem to work for me, though. The human vanishes when I click "perspective".


Jujube: Did you also make the change in lib/camera.py (I wrote that in the other thread).

The human vanishes because of clipping problems. In camera.py in updateCamera a bounding box of the human is calculated for the radius of the camera. This was a change from 1.0 to 1.1 MH version.

Approximately at line 568 of camera.py I just overwrite the result of the calculation (which is normally a value around 11.1 for the standard MH toon) and set that radius to 15.

Code: Select all
...
       distances = -np.sum(verts ** 2 , axis=-1)
        maxDistance = math.sqrt( -distances[ np.argsort(distances)[0] ] )

        # Set radius as max distance from bounding box
        self.radius = maxDistance + 1
        self.radius = 15.0                                       # my change <<<<<

    def addRotation(self, axis, amount):
        if axis == 0:
            self.verticalInclination += amount
        elif axis == 1:
            self.horizontalRotation += amount
 ...


I know, it is ridiculous in this way. But after it, it works on my box. I tried to reach the effect by setting fixedRadius to True (which is used as part of the code of the same procedure), but this does not work ... I tried hard for a few hours to find a better solution, in the end I gave up, because until now I'm not deep enough in the code. For me it was weird because I was not able to figure out why this works, but setting fixedRadius not ... :oops:

Jujube, I've no idea, if you are using Linux, Windows or a MAC. On my MAC I copied all to /Applications and changed the rights of the directory to be writeable so that the program is able to start faster than this "official" dmg (disk image format). And I made the directories containing the lib writeable. Python creates a camera.pyc file, control the dates after you started the program. This .pyc file must be "younger" than the .py file.
User avatar
punkduck
 
Posts: 1218
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Perspective is still available ...

Postby jujube » Tue Mar 28, 2017 2:00 am

punkduck wrote:Jujube: Did you also make the change in lib/camera.py (I wrote that in the other thread).


I did not! I somehow misread it as saying that you had to add that line to your plugin code to make it work... I'll try it and tell you how it goes.

(I'm using windows btw)

edit/update: Changing camera.py won't be nearly as simple as you made it sound, as not everyone knows how to build a program from source code :/
jujube
 
Posts: 404
Joined: Fri Aug 14, 2015 10:46 pm

Re: Perspective is still available ...

Postby blindsaypatten » Fri Apr 28, 2017 5:53 pm

So, is there an easy to install "perspective" add-on available now?
blindsaypatten
 
Posts: 586
Joined: Tue Mar 14, 2017 11:16 pm

Re: Perspective is still available ...

Postby punkduck » Fri Apr 28, 2017 9:08 pm

blindsaypatten wrote:So, is there an easy to install "perspective" add-on available now?


Yes, this was my original version:

https://github.com/makehumancommunity/community-plugins-perspective_view/blob/master/8_perspective_animation.py

The plugin works now without recompiling code for Windows. The reason for the weird effect before was, that internally Makehuman works with two cameras and changing only one was not okay ...

You must copy it to the plugin directory and activate it.

Aranuvir did a change on the version deleting the animation parts in his branch ... and you can switch to perspective with an icon as well.
But he accidentally threw out the initialization of self.humanPos and he also had to append after each G.app.selectedHuman.setPosition(self.humanPos) the command G.app.selectedHuman.refreshPose(). If you do that, the plugin also does what it should do, but the anination sliders etc. are no longer available.

Consider the master as a proposal and the branch as "at work" ;)
User avatar
punkduck
 
Posts: 1218
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Perspective is still available ...

Postby jujube » Fri Apr 28, 2017 9:58 pm

My current issue with the perspective is that the zoom is weird.. you have to set the focus all the way to the left to get medium-high closeness, and then when you switch back to orthographic it's ultra close again. But I want to look ultra close in perspective mode too. And/or better behaved zooming via the scroll wheel instead always of going to the tab and moving the slider.

(Many thanks for getting it working at all, though! Makehuman has sorely needed it for a long time. )
jujube
 
Posts: 404
Joined: Fri Aug 14, 2015 10:46 pm


Return to MHX2 and other plugins developed outside MakeHuman

Who is online

Users browsing this forum: No registered users and 1 guest