editModels.js Faulty


#1

The library version of editModels.js does not now seem to allow select, move and resize with two mouse button hold down and scroll up. And as far as I have been able to tell, its never allowed delete via backspace or the menu items added for Edit -> (Model) Delete.

http://highfidelity-public.s3-us-west-1.amazonaws.com/scripts/editModels.js

@Judas was in world testing today also though, and he said he thought the library editModels.js was broken. He pointed me to an improved version he uploaded for me to test at

http://www.danana.webspace.virginmedia.com/editmodels.js

With the library editModels.js stopped and the changed one loaded, I was then able to select, move and resize some FBX test meshes. The icons for the voxel editing functions to the left side of the Interface though don’t show with this version, though the buttons do function.

I still could not delete any in world model with backspace… I got a message in the console (Windows Build 677):

[2014-05-30T11:09:38] QAction::eventFilter: Ambiguous shortcut overload: Backspace

I see that the agenda for the May 30th meet up includes discussion of mesh model editing, so perhaps this can be raised there… its a bit late time zone wise for me to attend.


#2

Its not an improved one, its an older version from maybe 3 weeks ago @KevinMThomas gave me he was given it by Elvis in a dream :smile:


#3

I notice that even with obey gravity on and all collision options turned on my avatar can go straight through I world FBX meshes. There needs to be a collide with meshes option too, on by default. [Win Build 677]


#4

There seems to be code in the library editModels.js to select and delete mesh models, and I can see an Edit -> (Models) Delete Model new menu item added when the library editModels.js script is running. So maybe I just don’t understand when to hit backspace or when to use the Delete Model menu item. I select a model by clicking on it, then backspace or use of the delete model menu item does nothing … it reports this…

script print "Clicked on 661 true"
script print "menuItemEvent in JS… menuItem=Delete Model"
script print “Delete Model… not holding…”

script print "Clicked on 661 true"
QAction::eventFilter: Ambiguous shortcut overload: Backspace

[Mouse] Looking at: 6245.41 , 306.235 , 5578.23
script print "Checking properties: 657 true"
script print "Checking properties: 46 true"
script print "Checking properties: 660 true"
script print "Checking properties: 659 true"
script print "Checking properties: 45 true"
script print “Checking properties: 661 true”


#5

@Atlante45 Do you have any thoughts on this?


#6

Yep, that’s a known issue due to the fact that there is 2 existing menu item using the delete key as a short cut.
Not sure what we should change it to, but will do pretty soon.

From the look of the log you just posted, I’d also say that you’re probably not running the latest version of the script.
For now if you want to delete something, you can exploit a bug in the script that I think stil works, If the last click you made in the window was on a model, you can go up to the delete menu item and click it manually. I’ll delete the model.


#7

Thanks @Atlante45 I appreciate I am using variants of the editModels.js script in the example sent… as for me on Windows the library version does not work at all for scaling, moving, etc too.

As for the suggestion of exploiting the last click being on a model and using the menu models delete item, I tried that on ALL variants of the script I have seen, including the library version and for me on Windows its never worked. It just says I am not “holding” a model… this is what I got when clicking a model and then using the menu Edit -> (Models) Delete menu item…

script print "Clicked on 661 true"
script print "menuItemEvent in JS… menuItem=Delete Model"
script print “Delete Model… not holding…”

By the way, as you will appreciate, the delete key and the backspace key are different on full keyboards. If it says backspace it ought to be backspace.

A note too about the future trajectory of manipulating in world voxels and mesh models… what is in place now is fine for quick demos and approximate handling of models… but the future needs to look to a time when precision will be required both in terms of placement, rotation angles and scaling. Precise axis locked move and rotation, and metric (think precise type in boxes) ought to be part of the roadmap to make this properly usable in production.


#8

I stopped earlier versions of the editModels.js script I was using, loaded the latest version from…

http://highfidelity-public.s3-us-west-1.amazonaws.com/scripts/editModels.js

and tested things again. Scaling, movement and rotation now do work in the latest version for me. And I see the glow effects when a model is clicked. But clicking on a model with it glowing still does not let me do Edit -> (Models) Delete Model

[Mouse] Looking at: 6243.49 , 306.221 , 5569.72
script print<< "Checking properties: 2 true"
script print<< "Clicked on 2 true"
script print<< “menuItemEvent in JS… menuItem=Delete Model"
script print<< " Delete Model… not holding…”

Trace above has some punctuation removed to avoid smilies in the forum post.

By the way, the date on the script is I assume the date when it was originally written…

// Created by Clement Brisset on 4/24/14.

It would be very helpful for discussions and future references to have an Updated: dd-Mon-yyyy on that. The awful dd/dd/dd format is seriously defective in international contexts. 04/05/2014 is 4th May in Europe and 5th April in US! It ought to be policy never to use that in coding contexts. Spacecraft have been lost for less :wink: Also yyyy would be much better than assuming code and historical material related to early programming cannot span centuries too. Try 31-May-2014


#9

This is due to a conflict between the menu items added by editModels and editVoxels that uses the same shortcut.
Running editModels alone will do the trick.
Will eventually work on a controls menu to handle all of that more easily and give users the ability to easily reassign controls.

For the date, this is the standard we are using through our entire code base, this could eventually change but since all those informations are already stored on the repo there is no need for that.
Those headers are mainly for the license.
If you go to github.com/highfidelity/hifi you can inspect any file and each modifications to it are registered and timestamped in an history.


#10

Noted @Atlante45

I am using the editModels.js version loaded by defaultScripts.js now. I can resize and move a new model after its added. But it seems that once I have resized it once, when I do the double click and drag up again it no longer is scalable or movable or rotatable). Even after a relog. Something is odd about the way editModels.js works.

Rotation is something I have always found very hit and miss. I can never be sure when it will work, if at all.

A clear description of what the various combinations of keys/mouse clicks, drags, and so on do would be helpful maybe its already in the wiki somewhere?


#11

it wasn’t really anywhere no.
Made a few modifications recently that should make it easier to use.
First, there is a description of the functionalities and keys to use at the top of the script

Since it wasn’t easy to rotate correctly, on 2 axis at the time, it now only rotate by default on Y with 2 key modifiers (x and z) to rotate on X and on Z.
Rotations also work by 15 degrees increment unless SHIFT is pressed for finer control.
A little window display now shows the basic informations about the model.