-
Notifications
You must be signed in to change notification settings - Fork 178
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
Terrain editor now edits *.tobj files in place #3199
Draft
ohlidalp
wants to merge
29
commits into
RigsOfRods:master
Choose a base branch
from
ohlidalp:terrn_export
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
changes made: * added `*_utils` namespaces (new convention for includes) * unified style of scripts: using global variables and functions instead of classes. * scripts auto-formatted by script_editor.as
This reverts a line from caf88e5 - I wanted to be purist and force users to do `engity.getSubEntities(0).setMaterial()` but since OGRE has this convenience method and the skeletal posing example already uses it, let's just roll with it.
Returns `array<Ogre::MovableObjects@>` in no particular order; works using bounding boxes so large/generated meshes like roads get matched all the time. comes with example script.
drawSelectableFileList() now Creates a child window with dynamic height (but clamped to hardcoded max value). const int MAX_CHILD_HEIGHT = 300; const int CHILD_WIDTH = 600;
Also fixed typos in `get/setCameraOrientation()` function bindings - parameter was declared as `vector3`, should have been `quaternion`. Also fixed weird binding of global `game` object, preventing use of AngelScript delegates. Fixed to bind as non-counting reference because that's the sensible choice.
Consistency++; Until now some document objects were named `^Document` (RigDef, GenericDocument), some `^File` (Odef, TObj) and some `^Def` (skin). Principal changes are in file 'ForwardDeclarations.h' - all document types and smart pointer typedefs are now here. The rest is pretty much all find&replace.
Consistency++;
Consistency++;
ohlidalp
force-pushed
the
terrn_export
branch
from
November 25, 2024 08:46
36eeb91
to
7ab0e2e
Compare
The 'logs/editor_out.log' file is history. The game now edits *.tobj files directly, but only if the terrain is unzipped in a directory (= a project). Exiting terrain editor at a zipped terrain will show a console warning "cannot export - not a project". Known issues: * preloaded actors rotations are off * procedural road bridge types are not preserved. * The "Terrain editor mode" doesn't inform about projects. TBD: add a button to import zipped terrain as project (internals already exist, only UI needs to be updated).
In this mode, the road will automatically switch between solid base and bridge depending on current height above ground. Internally, this mode already existed, but was only activated when importing legacy blocky-road into procedural road. This fixes the new TOBJ export from terrain editor.
When loaded with a terrain containing races, it detects them and generates race-def files for each of them, also modifying the .terrn2 file. These files can't be processed yet, but they contain all info normally present in the race definition scripts. Example from Auriga: ``` ; ~~ New 'race-def' format (file extension: .race). ~~ ; Each race file specifies a single race ; In .terrn2 file, list the race files under new section [Races] ; Filenames must include extension and end with = (like scripts do) ; Race system supports alternating paths! ; Checkpoint format: checkpointNum(1+), altpathNum(1+), x, y, z, rotX, rotY, rotZ, objName(override, optional) ; By convention, the checkpoint meshes are oriented sideways (facing X axis) race_name 1 kilometer drag race_laps 0.000000 race_checkpoint_object 31-checkpoint race_start_object 31-checkpoint race_finish_object 31-checkpoint begin_checkpoints 1.000000,1.000000,1010.000000,9.000000,505.000000,0.000000,90.000000,0.000000 2.000000,1.000000,10.000000,9.000000,505.000000,0.000000,90.000000,0.000000 end_checkpoints ```
Since adding INT/FLOAT and removing NUMBER token types from GenericDocument, all copypasted viewers/editors in scripts are broken. This is 1st step to creating an unified viewer/editor as include, but not yet there.
Implements `GenericDocEditor` which doesn't edit yet but has highlight+selection and can be shared by scripts. Currently only 'example_terrn2_raceConverter.as' was updated to use it.
* 'terrain_project_importer.as' - Launched automatically with terrain-editor mode with a read-only (ZIPped) terrain, provides info and import controls. * 'terrain_editor.as' - Launched automatically with terrain-editor mode with a terrain project, provides mouse+gizmo editing controls and hints. KNOWN ISSUE: main menu doesn't appear after unloading terrain from script...
How I could trigger it: 1. enter simple test Terrain (zipped) 2. load 'script_editor.as' script. 3. enter terrain-editor mode --> game launches 'terrain_project_importer.as' --> boom. May be related: There are 2 messages "cannot run function with ID -1" that seem to appear when the terrain import script starts, I dont know where they come from.
ohlidalp
force-pushed
the
terrn_export
branch
from
November 28, 2024 03:16
7ab0e2e
to
3281e2f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The 'logs/editor_out.log' file is history. The game now edits *.tobj files directly, but only if the terrain is unzipped in a directory (= a project). Exiting terrain editor at a zipped terrain will show a console/chatbox warning "cannot export - not a project".
Known issues:
Notes to code reviewers: