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

Feature request: initial cursor position in globals #4

Open
ajwood opened this issue Dec 4, 2015 · 7 comments
Open

Feature request: initial cursor position in globals #4

ajwood opened this issue Dec 4, 2015 · 7 comments
Assignees

Comments

@ajwood
Copy link

ajwood commented Dec 4, 2015

It'd be great to be able to control the initial cursor location from the globals file

@rdvincent
Copy link
Member

@ajwood take a look at this implementation and see if it does what you need.

@ajwood
Copy link
Author

ajwood commented Dec 8, 2015

@rdvincent this definitely gets the job done! Thanks! I noticed a couple things though:

  1. it only works if all three dimensions are specified
  2. IF Initial_volumes_synced=true
    AND Initial_volume_1_world_x/y/z are set
    AND Initial_volume_2_world_x/y/z are unspecified,
    THEN volume 2 internal defaults sync and destroy those specified for vol1 in the globals.

Probably not critical, but might be confusing for a naive user.

@rdvincent
Copy link
Member

I can certainly make it work if the user only specifies the Z direction, e.g. The other directions would just be set to the default.

The second case is more confusing. I will have to think about how that should be handled. Perhaps I was incorrect to create two different initial positions, and the initial position should automatically apply to both volumes.

@ajwood
Copy link
Author

ajwood commented Dec 8, 2015

  1. Is Z just an example? Would it also work if only X or only Y was specified? Leaving it the way you have it is probably fine too though; would it be possible to issue a warning if any of the three are missing?

  2. Agreed on messiness. I think this might work at the vol2.position initialization though:

IF synced AND vol2.position == FLT_MAX:
THEN vol2.position = vol1.position

Does that look right to you? Would it fit cleanly into the code?

@rdvincent
Copy link
Member

  1. We can absolutely make it possible to set only any one (or two!) of the axes and let the remaining axes use the defaults. I was just being paranoid in requiring all-or-nothing behavior, to avoid situations where a typo causes 2 of 3 to be correct. But we warn about unknown globals, so not a big deal.

  2. I'll give this some thought, but what you suggest should be an improvement, although I hope this is a rare edge case!

@ajwood
Copy link
Author

ajwood commented Dec 8, 2015

Whatever you like - thanks!

rdvincent pushed a commit that referenced this issue Dec 10, 2015
…re axes to set the initial position, and handle synced volumes in a reasonable way.
@rdvincent
Copy link
Member

@ajwood Try this version out - here's how it should behave:

  1. Specifying any axis will set the initial position. Unspecified axes default to world position zero.
  2. If Initial_volumes_synced is TRUE, the following behavior is used:
    a. If volume 1 position is set, use it for both volumes.
    b. Else if volume 2 position is set, use it for both volumes.

@rdvincent rdvincent self-assigned this Dec 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants