Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

GLOB_WORLD_ORIGO_OFFSET always returns Zero

runxel
Ace
Hey there, found another bug:
GLOB_WORLD_ORIGO_OFFSET_X (and _Y) always return 0 (zero).

Tested with AC 23 and 24.
AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»
1 ACCEPTED SOLUTION

Solution
Peter Baksa
Graphisoft
Graphisoft
I couldn't reproduce that in AC24 build 3022.
This offset is only recalculated when a file is opened, so it might look it isn't working with a moved object.
First move the object far away from the origin, save the file, re-open it, and the extra hotspot will be visible.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

View solution in original post

5 REPLIES 5

Barry Kelly
Moderator
runxel wrote:
Hey there, found another bug:
GLOB_WORLD_ORIGO_OFFSET_X (and _Y) always return 0 (zero).

Tested with AC 23 and 24.

Where are you using it?
It doesn't work in Parameter (Master) script.


Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

runxel
Ace
Hey Barry, I know. I'm using it in the 2D script.
There is even an example code in the reference manual:
add2 -GLOB_WORLD_ORIGO_OFFSET_X-SYMB_POS_X, -GLOB_WORLD_ORIGO_OFFSET_X-SYMB_POS_Y
line2 -0.1, 0.0, 0.1, 0.0
LINE2 0.0, -0.1, 0.0, 0.1
hotspot2 0.0, 0.0, 1
text2 0, 0, "( 0.00 ; 0.00 )"
text2 0, 0.5, "World Origin"
del top

if abs(GLOB_WORLD_ORIGO_OFFSET_X) > 0.01 or\
    abs(GLOB_WORLD_ORIGO_OFFSET_Y) > 0.01 then
   ! THIS WILL NEVER BE EXECUTED
    add2 - SYMB_POS_X, - SYMB_POS_Y
    line2 -0.1, 0.0, 0.1, 0.0
    line2 0.0, -0.1, 0.0, 0.1
    hotspot2 0.0, 0.0, 2
    text2 0, 0, "(" + str(GLOB_WORLD_ORIGO_OFFSET_X, 9, 4) + "; " + str(GLOB_WORLD_ORIGO_OFFSET_Y, 9, 4) + " )"
    text2 0, 0.5, "Virtual Origin"
    del top
endif

if abs(GLOB_WORLD_ORIGO_OFFSET_X + SYMB_POS_X) > 0.01 or\
    abs(GLOB_WORLD_ORIGO_OFFSET_Y + SYMB_POS_Y) > 0.01 then
    line2 -0.1, 0.0, 0.1, 0.0
    line2 0.0, -0.1, 0.0, 0.1
    hotspot2 0.0, 0.0, 3
    text2 0, 0, "(" + str(GLOB_WORLD_ORIGO_OFFSET_X + SYMB_POS_X, 9, 4) + "; " + str(GLOB_WORLD_ORIGO_OFFSET_Y + SYMB_POS_Y, 9, 4) + " )"
    text2 0, 0.5, "Object Placement"
endif
AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Barry Kelly
Moderator
I found that ....
if abs(GLOB_WORLD_ORIGO_OFFSET_X) > 0.01 or\
    abs(GLOB_WORLD_ORIGO_OFFSET_Y) > 0.01 then
needs to be ...
if abs(GLOB_WORLD_ORIGO_OFFSET_X) > 0.01 or abs(GLOB_WORLD_ORIGO_OFFSET_Y) > 0.01 then
All on one line and the "/" removed after the OR


Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Solution
Peter Baksa
Graphisoft
Graphisoft
I couldn't reproduce that in AC24 build 3022.
This offset is only recalculated when a file is opened, so it might look it isn't working with a moved object.
First move the object far away from the origin, save the file, re-open it, and the extra hotspot will be visible.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

runxel
Ace
Peter wrote:
This offset is only recalculated when a file is opened, so it might look it isn't working with a moved object.
First move the object far away from the origin, save the file, re-open it, and the extra hotspot will be visible.
THAT was the missing piece of information...
Sorry for the confusion and thanks to Péter!

It becomes quite obvious when you think about it, but man, sometimes the easiest things are the hardest.
AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!