Final trueSpace 7.61 Beta 8 Unofficial Update

clintonman
Captain
Posts: 2618
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman » 23 Jul 2019, 22:26

trueBlue wrote:
23 Jul 2019, 22:06
Yep that works as you are running the command twice.
So do you think this should be incorporated into the update?
Thinking about adding a button to the Desktop panel that calls it.
Edit: It does -> D3DView.SetActiveCamera("", '{2C152F81-45A2-4035-8896-9E49D60C8A7A}')
Is that not working for you?
If you remove the first one it still works. It works because it's running last not because it's running twice.
Nope, that doesn't work for me. It would be better to not have it hard coded to the "{2C152F81-45A2-4035-8896-9E49D60C8A7A}" value if possible. I switched the main view to modelspace and have a smaller 3d view for workspace. Maybe you have the opposite or something different? In any case a computed value should work for all cases, assuming it's possible.
Just did a test copying the value I see on the D3dView/EyeCamera_{1C93CC97-5189-46E6-98FF-DDB3147F492F} node of "{1C93CC97-5189-46E6-98FF-DDB3147F492F}" and that works for me.
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 1867
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue » 23 Jul 2019, 22:50

Okay I will add the old command in addition to the one using the WinId
D3DView.SetActiveCamera('', '')
With this command you must have the Workspace window in focus.

User avatar
trueBlue
Captain
Posts: 1867
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue » 23 Jul 2019, 23:44

See if you like this setup.
Replace your System/Preferences with this one. Open up Settings and select the Synchronize Camera button on the Desktop panel.

File removed due to update.

clintonman
Captain
Posts: 2618
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman » 24 Jul 2019, 01:39

It didn't work for me. Here are my modifications to make it work with any 3d window.
I'm not so sure it should delete and replace itself in the scene. Maybe it should be a special camera instead, that way there can be more than one of them and they could be used as regular cameras as well.

Code: Select all

newcam = Node.Copy("/Preferences/Synchronize Camera", Space.CurrentScene())
UserInterface.OpenPreferencesPanelViewExWithFlag('', '', newcam, 4, 1, 0, 8)
There may be a bridge issue. When I was modifying the code the camera reverted to a modelspace camera. I had to turn off the bridge to make changes, so more testing may be needed to protect against modelspace. I don't know it could only happen when trying to make code changes.
Attachments
Synchronize Camera.RsObj
(83.92 KiB) Downloaded 10 times
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 1867
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue » 24 Jul 2019, 05:06

Thanks for fixing the Set Camera, works great!
I value your opinion. :worship:
Can you explain how using more then one of these could be used in a scene?
Really did not intend this to be used as a Camera. It was the only thing I could come up with to get the views to sync.
Tried using the Eye camera by Synchronizing it, but that did not work.
For me given that it does not work, if it is minimized could be an issue for a user.
I use the Link Editor's Minimize all of the time.

What I really would like to do is make this as transparent as possible.
My thought was since this males the Bridge work, having it included with the Bridge settings made sense.
Defiantly did not like having the panel show in the Settings aspect though.

clintonman
Captain
Posts: 2618
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman » 24 Jul 2019, 05:55

I agree with everything you said. I thought you wanted the camera because of the matching viewport. In that case I think the "false matching camera" should match the workspace view first instead of the view matching the camera and when deactivated set the workspace view or camera if it was previously a camera view to match the final fake camera position and delete the fake camera so it's only temporary. Just some thoughts, hope this makes sense.
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 1867
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue » 24 Jul 2019, 20:30

Not sure what you are saying but by all means show by an example.
Here is an update.
New name. Synchronize
New camera with no mesh nor material.
Upon load shows the Synchronize's Workspace aspect in Panel.
Deactivate, changes Model and Workspace to Perspective view and deletes itself. Only on the Workspace aspect button.

I notice with your set camera script it only works with two windows.
Try it in the 4View and or with the Default layout main view with two new windows, one with Model view. (The Default view window does not work.)

I could add the following code but there is a big lag in Model, even if I run the script before activating the other script.

Code: Select all

Cam = System.ThisOwner();	
Eye = Node.SubObject("/D3DView", 0);

Node.Value(Cam,"Matrix") = Node.Value("/D3DView/" + Eye,"WldMatrix");
Node.Value(Cam + "/Camera","ClippingFar") = Node.Value("/D3DView/" + Eye,"ClippingFar");
Node.Value(Cam + "/Camera","ClippingNear") = Node.Value("/D3DView/" + Eye,"ClippingNear");
Node.Value(Cam + "/Camera","Focus") = Node.Value("/D3DView/" + Eye,"Focus");
Node.Value(Cam,"FOV") = Node.Value("/D3DView/" + Eye,"FOV");
Node.Value(Cam + "/Camera","Perspective") = Node.Value("/D3DView/" + Eye,"Perspective"); 
File removed due to update.

clintonman
Captain
Posts: 2618
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman » 25 Jul 2019, 05:44

trueBlue wrote:
24 Jul 2019, 20:30
Not sure what you are saying but by all means show by an example.
Here is an update.
New name. Synchronize
New camera with no mesh nor material.
Upon load shows the Synchronize's Workspace aspect in Panel.
Deactivate, changes Model and Workspace to Perspective view and deletes itself. Only on the Workspace aspect button.

I notice with your set camera script it only works with two windows.
Try it in the 4View and or with the Default layout main view with two new windows, one with Model view. (The Default view window does not work.)

I could add the following code but there is a big lag in Model, even if I run the script before activating the other script.

Code: Select all

Cam = System.ThisOwner();	
Eye = Node.SubObject("/D3DView", 0);

Node.Value(Cam,"Matrix") = Node.Value("/D3DView/" + Eye,"WldMatrix");
Node.Value(Cam + "/Camera","ClippingFar") = Node.Value("/D3DView/" + Eye,"ClippingFar");
Node.Value(Cam + "/Camera","ClippingNear") = Node.Value("/D3DView/" + Eye,"ClippingNear");
Node.Value(Cam + "/Camera","Focus") = Node.Value("/D3DView/" + Eye,"Focus");
Node.Value(Cam,"FOV") = Node.Value("/D3DView/" + Eye,"FOV");
Node.Value(Cam + "/Camera","Perspective") = Node.Value("/D3DView/" + Eye,"Perspective"); 
It works by looking at the current active window, so if you click the button in the link editor, the link editor becomes the active window. If you click the button in the panel view, the panel view becomes the active window. Only place I know to press the button and not change the active window is to use a floating panel or a toolbar button. If the active window is not a 3d view it chooses the last 3d view opened.

Can't image why you're getting the big lag in that code.

The way I picture it working is
1. save the state and id of the active 3d view
2. make the synchro cam match the 3d view settings
3. when done delete the synchro cam and restore the state of the 3d view

It looks like you're already headed in that direction. Only instead of setting the 3d view to perspective it would be set back to it's original state.
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 1867
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue » 25 Jul 2019, 17:55

Thank You!
Found out the issue with the lag was that you needed to use your mouse in 3D Space.
Added Activity.Run(System.ThisOwner() + "/Synchronize Scene") to the Connect script fixes that.
Added WindowsManager.ActivateFrame(1) to the Activate script seems to help setting the cam in the main view.

Getting strange results in the 4View layout. Lower right gets changed to perspective/wireframe. :o Mostly does not sync with Model.
Isometric view does not work at all.


I am going to suggest that other layouts and or other views are not supported as well as more then 3 views in the Default layout.

I do not think that I accomplished all of your suggestions, but this is the best I can come up with so far.
Also noticing that 'sometimes' this script needs to run twice (after the first time) in order for it to work properly.
Seems that Model reverts to a previous or saved state on first Activate and on Deactivate.

File removed due to update.

clintonman
Captain
Posts: 2618
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman » 25 Jul 2019, 22:14

Changes:

Saves the state of the workspace window and restores it after deactivation.
Removed the hard coded window id. Will use the first 3d view found instead of the last one when the active view is not a 3d view. I think choosing the first is closer to the hard coded window id behavior.
Removed the exported Perspective connection since it was giving me some trouble.
Started to make changes to restore model view and then realized it wasn't possible to read the model space view state.

Should work in any layout. Only big thing missing is that it live in a floating panel so the active window can be selected properly.

I shrank the workview aspect button only because of editing issues here on my end.
Attachments
Synchronize.RsObj
(146.64 KiB) Downloaded 8 times
Clinton Reese

http://clintons3d.com

Post Reply