• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: VWR-675
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: SuezanneC Baskerville
Votes: 27
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
1. Second Life Viewer - VWR

Ability to do simple math in numeric edit fields

Created: 05/May/07 10:13 PM   Updated: 23/Jul/09 04:34 PM
Return to search
Component/s: User Interface
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Text File VWR-675-MathsParser-v0.3.patch (30 kB)

Issue Links:
Duplicate
 
Relates
 


 Description  « Hide
It would be useful to be able to do simple math in numeric edit fields.

Example:
An object is at postion X = 10.254.

You want to move it by 2.358 meters in the x direction.

Type "+2.358" after "10.254" in the object's X positon field and press enter.

The sum of the two numbers appears in the edit field and the object moves to that postion.

We can do this in the design program I use at work and I use it a lot.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Lex Neva added a comment - 06/May/07 08:21 AM
I'd use this a lot. Currently I keep my ti-86 close to hand whenever building.

McCabe Maxsted added a comment - 09/May/07 09:19 PM
YES YES YES YES YEEEEEEEEEEESSSSS! I have been longing for this feature for AGES!

Ditto on the calculator.


Ashmuel Gould added a comment - 13/Jan/08 04:57 AM
Lightwave, and I guess many other 3D applications use this technique a lot and it's an absolute blessing. Another YES from this quarter

Lex Neva added a comment - 08/Jun/08 10:00 AM - edited
I'd like it if starting the field with an operator assumed that you wanted to apply the operator to the existing value.

Example:

1. Click the X position field.
2. The entire value hilights.
3. Type "+0.625", which will replace the existing value in the field.

The math system assumes you mean to add 0.625 to the existing value.

I guess this might collide with entering a negative value in the rotation boxes, though, won't it? :/


Aimee Trescothick added a comment - 08/Jun/08 02:02 PM
Could use X Y Z as shorthand for the existing values?

That way you could type X+0.625 in the X position field for example, or do things like typing X*1.5 in the Y scale box, to make it 1.5 times the current X dimension.


Aimee Trescothick added a comment - 02/Oct/08 07:47 PM
I'm working on this and expect to have a patch "soon".

Aimee Trescothick added a comment - 12/Nov/08 12:19 PM
Have had this working nicely for a while now, just need to find time to clean it up and make the patch, RL keeps getting in the way :S

SuezanneC Baskerville added a comment - 14/Nov/08 04:44 PM - edited
Thanks for the effort, Aimee, I hope you find time to make the patch.

One could use "=" at the start to mean take the current value and perform the rest of the expression to it.

current value: 5.6

=+2

value changes to 7.6

This would allow the same character to work for all fields, such as hole size, twist, etc., not just x, y, and z. It would also resemble the syntax used for assignment operators in some programming and scripting languages.


Aimee Trescothick added a comment - 17/Dec/08 08:56 AM - edited
OK, I'm attaching a patch of it in its current state I know some people are eager to play with it

It's working great, though I think there are a few things left to do to get the best out of it, and it still needs some tidying up, but I'm just not getting the time to work on it at the moment and it would be good to get it out there at let people beat on it a bit and see what breaks.

The main things still to do are:

1) Adding support for user variables, not a large amount of work, though needs a little UI consideration in how to manage them.

2) Right now the values for the system variables are pulled out from the build window when it updates, and the calculator is just active in any spin control. While this works well, I wasn't altogether comfortable with this hard coded approach as I was writing it, for log term manageability, and versatility in using it in other parts of the client.

Soft Linden suggested managing it using the XUI to choose which input fields have the maths parser enabled, and also for labelling them with variable names, using callbacks to update the values when they change. That seems a much better approach than how I'm doing it at the moment (and a really obvious way of doing it now I thing about it ), but I don't have the time to reimplement it that way at the moment.


Argent Stonecutter added a comment - 17/Dec/08 01:16 PM
If SL would support Mac OS X's Services API we'd get this for free on OS X.