-
Notifications
You must be signed in to change notification settings - Fork 174
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
👼Script: OGRE bindings for editing scene, meshes and textures - with examples #3030
Commits on Mar 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 9ead066 - Browse repository at this point
Copy the full SHA 9ead066View commit details -
AngelScript: added OGRE
Node
+SceneNode
bindings.AngelScript API changes: + `ImGuiCond` enum + `ImGui::SetNextItemOpen()` func + `Ogre::Node` object + `Ogre::SceneNode` object Code changes: * CReadonlyScriptDictView moved to ScriptUtils.h * created CReadonlyScriptArrayView in ScriptUtils.h ogre_demo.as changes: * codechange: added class OgreInspector, draw funcs made methods. * ability to traverse scene node graph (using scenemanager.getRootSceneNode() and scenenode.getChildren())
Configuration menu - View commit details
-
Copy full SHA for e138464 - Browse repository at this point
Copy the full SHA e138464View commit details -
AngelScript: added
Ogre::MovableObject
bindings, updated 'ogre_demo…….as' New script API: + `Ogre::MovableObject` + `Ogre::MovableObjectArray` - returned by `SceneNode::getAttachedObjects()` Codechanges: * CReadonlyScriptDictView - removed Get() funcs - useless here, this object stores only 1 predetermined object type. * CReadonlyScriptDictView + CReadonlyScriptArrayView: removed static const char* VALUE_DECL; using just a parameter to Register*() * OgreAngelscript.cpp: major tidy-up, new funcs use same style as old funcs, helpers moved among older helpers, base class regs extracted to `register*Base()` methods because the duplicity was growing and growing. * ogre_demo.as - added MovableObject listing under SceneNodes, added checkboxes to set Visibility and CastShadows of the movables.
Configuration menu - View commit details
-
Copy full SHA for 7ddc31f - Browse repository at this point
Copy the full SHA 7ddc31fView commit details -
Codechange: grouped DustPool scene nodes for nicer Inspector view
See 'ogre_demo.as'
Configuration menu - View commit details
-
Copy full SHA for 8c829b8 - Browse repository at this point
Copy the full SHA 8c829b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 477844b - Browse repository at this point
Copy the full SHA 477844bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e05fdd0 - Browse repository at this point
Copy the full SHA e05fdd0View commit details -
AngelScript: added
Ogre::AnimationState
/Ogre::AnimationStateSet
Updated ogre_demo.as to use it - look for the 'Character#0' scene node.
Configuration menu - View commit details
-
Copy full SHA for 45f8bca - Browse repository at this point
Copy the full SHA 45f8bcaView commit details -
AngelScript: added
game.getSceneManager()
and ton of OGRE funcs.'ogre_demo.as' now has "Pose Demo" panel which loads up a character and draws anim controls.
Configuration menu - View commit details
-
Copy full SHA for 3d57d9a - Browse repository at this point
Copy the full SHA 3d57d9aView commit details -
Codechange: finishing touches in 'OgreAngelscript.cpp'
* added `assert(r>=0)` where missing. * `TexturePtr` and `TextureManager` regs unified with the others * function `registerOgreTextureManager()` separated out from `registerOgreTexture()`
Configuration menu - View commit details
-
Copy full SHA for c615620 - Browse repository at this point
Copy the full SHA c615620View commit details -
Doxygen docs: added all OGRE-AngelScript objects.
Added dummy namespace `AngelOgre` to avoid mixing up OGRE-AngelScript exports with actual C++ objects. * Doxyfile.conf.in upgraded using `doxygen -u` * MainPage.h - fixed warnings about "unknown command \My \Rigs" etc... unescaped slashes :)
Configuration menu - View commit details
-
Copy full SHA for fbdeee7 - Browse repository at this point
Copy the full SHA fbdeee7View commit details -
👼 Script: raw OGRE Overlay bindings (demo)
New script API: * `class Ogre::OverlayManager` * `class Ogre::Overlay` * `class Ogre::OverlayElement` * `enum Ogre::GuiMetricsMode` * `enum Ogre::GuiHorizontalAlignment` New example script: example_ogre_overlays.as - a test script I used while developing, creates 1 "Panel" overlay with material "tracks/wheelface" and some GUI controls. # Conflicts: # source/main/scripting/bindings/OgreAngelscript.cpp
Configuration menu - View commit details
-
Copy full SHA for 021185a - Browse repository at this point
Copy the full SHA 021185aView commit details -
Configuration menu - View commit details
-
Copy full SHA for bfab13d - Browse repository at this point
Copy the full SHA bfab13dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e6bfcc - Browse repository at this point
Copy the full SHA 4e6bfccView commit details -
overlay_editor.as: added buttons to destroy overlay/element.
multiple fixes: clashing name of new element, missing PushID in lists which broke buttons, typos in detail tooltips.
Configuration menu - View commit details
-
Copy full SHA for 2647411 - Browse repository at this point
Copy the full SHA 2647411View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce1b8c8 - Browse repository at this point
Copy the full SHA ce1b8c8View commit details -
Terrain: Grouped scene nodes together for nicer inspector view.
This has no effect on rendering, it just helps users to diagnose the scene graph.
Configuration menu - View commit details
-
Copy full SHA for 05b1c91 - Browse repository at this point
Copy the full SHA 05b1c91View commit details -
Actors: grouped/renamed scene nodes for nicer inspector view.
Prettier and more uniform object names - Helper func `ActorSpawner::ComposeName()` is now smarter, outputs nicer IDs and is used even more. This has no effect on rendering, it just helps users to diagnose the scene graph using the inspector script.
Configuration menu - View commit details
-
Copy full SHA for befcbb8 - Browse repository at this point
Copy the full SHA befcbb8View commit details -
👼Script:
Ogre::ManualObject
API - create manual mesh2 new example scripts. New script API: * `enum Ogre::RenderOperation` * `class Ogre::ManualObject` REF | NOCOUNT object type. This is castable to MovableObject. Official tutorial for Ogre::ManualObject: https://ogrecave.github.io/ogre/api/latest/manual-mesh-creation.html * Functions in OGRE SceneManager: `createManualObject()`, `getManualObject()`, `destroyManualObject()` * Extra feature: function `TerrainClass::getHeightAt()` for the MeshedConcrete example to work.
Configuration menu - View commit details
-
Copy full SHA for 702355d - Browse repository at this point
Copy the full SHA 702355dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4bdee41 - Browse repository at this point
Copy the full SHA 4bdee41View commit details -
Configuration menu - View commit details
-
Copy full SHA for b925a16 - Browse repository at this point
Copy the full SHA b925a16View commit details -
👼Script: Added texture blitting API 🎆
NOTE: the example script only blits to topmost mipmap, so to see the effect, you must be close to the object! This will be improved. New Angelscript API: * `game.loadImageResource(filename, rg)` - see GameScript.cpp & GameScriptAngelscript.cpp * `ImDrawList::AddImage()` - see ImGuiAngelscript.cpp * Ogre objects: `box; PixelBox; HardwarePixelBufferSharedPtr`, Texture functions `getBuffer(); getNumMipmaps()` Example code: ``` // src image Ogre::Image gSrcImg = game.loadImageResource("sign-roadnarrows.dds", "TexturesRG"); // dst texture Ogre::TexturePtr gDstTex = Ogre::TextureManager::getSingleton().load("character.dds", "TexturesRG"); // let the MAGIC happen Ogre::HardwarePixelBufferPtr pixbuf = gDstTex.getBuffer(/*cubemap face index:*/0, /*mipmap:*/0); Ogre::PixelBox srcPixbox = gSrcImg.getPixelBox(0,0); // getPixelBox(cubemapFaceIndex, mipmapIndex); box gDstBox; // where you want to put it. pixbuf.blitFromMemory(srcPixbox, gDstBox); ``` New/updated scripts: * new 'example_ogre_textureBlitting.as' - draws UI using GridViewer and lets user mouse-draw destination pixelbox. Hardcoded to use character.dds as destination. * 'gridviewer_utils.as' - added 'zoomMin' config, new func `screenToLocalPos()` to enable mouse-interactions with the viewed data.
Configuration menu - View commit details
-
Copy full SHA for 4e61b82 - Browse repository at this point
Copy the full SHA 4e61b82View commit details -
OTC fileformat: fixed typo causing early crash when 'normalheight' is…
… empty. The OGRE version we use (11.6) crashes anyway when normalheight parameter is blank, although for OGRE13+ it's supposed to be okay (regarding to Paroj @ GitterChat)
Configuration menu - View commit details
-
Copy full SHA for a6506a8 - Browse repository at this point
Copy the full SHA a6506a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cb624e - Browse repository at this point
Copy the full SHA 5cb624eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b8925c9 - Browse repository at this point
Copy the full SHA b8925c9View commit details -
👼Script: 'gridviewer_utils.as' - renamed func. for consistency.
There are now 2 funcs: * `localToScreenPos()` - originally `projectPos()`, renamed to align with the below. * `screenToLocalPos()` - added recently to make texture-blitting example work.
Configuration menu - View commit details
-
Copy full SHA for 6b1dcb1 - Browse repository at this point
Copy the full SHA 6b1dcb1View commit details -
👼Script: added reading verts and texcoords from Mesh.
Task 3/3 from RigsOfRods#3030. This means I can start writing a script to batch together terrain objects (meshes+textures) for performance - especially for Community Map New script API: * objects: `MeshPtr, SubMesh, MeshManager` * to get vert positions, use "array<vector3>@ __getVertexPositions()" on SubMesh * ditto for vert texcoords, note the extra index param because mesh can have more than 1 texcoord layer: "array<vector2>@ __getVertexTexcoords(uint index)" See example script "example_ogre_vertexData.as"
Configuration menu - View commit details
-
Copy full SHA for c762091 - Browse repository at this point
Copy the full SHA c762091View commit details -
👼Script: 'script_editor.as': fixed folded regions stuck at orig. len.
If you loaded a document with regions, their recorded character count would be stuck on the original value, so if you added/removed characters the folding would break. This was fixed. There is still a bug - orphan regions don't resurface as expected.
Configuration menu - View commit details
-
Copy full SHA for 15ae6f4 - Browse repository at this point
Copy the full SHA 15ae6f4View commit details -
👼Script: 'script_editor.as': Fixed folded regions missing in execution.
Problem: The `restoreRegionFoldStates()` didn't actually modify buffer, just restored the flag.
Configuration menu - View commit details
-
Copy full SHA for 97a9aa1 - Browse repository at this point
Copy the full SHA 97a9aa1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4be7d50 - Browse repository at this point
Copy the full SHA 4be7d50View commit details -
👼Script: ✨ OGRE Mesh/Material bindings + example
This introduces 'example_ogre_terrnBatcher.as' which shows how Mesh/Material API works and will evolve into a production tool. this will conclude RigsOfRods#3030. THE INTENDED USE of the future completed TERRN BATCHER: 1. You start with a list of OGRE SceneNodes - see green box. 2. you pick those you want to batch together - see orange box. 3. [WIP] The tool generates one mesh which contains all those picked (keeping position, scale and rotation) and cover them in single material containing all the textures. 4. [TBD] The tool remembers what batches were done as a 'schedule', and allows saving/loading the schedule as file. Modders can share and improve the schedules. 5. [TBD] Modders can launch the tool directly from .terrn2 and auto-execute a schedule on map load. 6. Profit
Configuration menu - View commit details
-
Copy full SHA for 0dba980 - Browse repository at this point
Copy the full SHA 0dba980View commit details -
👼Script: 'script_editor.as' fixed text sliding in folded regions
Problem: The character offsets weren't updated, so when you edited text above a folded region, it's content would come out corrupted after unfolding. This also factors out helper function `mergeCollectedFoldingRegionsWithExisting()` with extra commentary.
Configuration menu - View commit details
-
Copy full SHA for 96d843e - Browse repository at this point
Copy the full SHA 96d843eView commit details -
👼Script: added
Ogre::Timer
, profiled & optimized 'script_editor.as'I really suspected the `array<dictionary> bufferLinesMeta` to be the culprit. When that was disproved, I thought collecting regions or merging region info could be it. Both were disproved too. To my surprise it was the `isChar()` helper. Profiling results [in microseconds] opening 'example_ogre_terrnBatcher.as': * Before: PROFILING analyzeBuffer(): total 205834us (CPU 206000us) regions 324us (CPU 0us) dict 15805us (CPU 17000us) merging 151us (CPU 1000us) * After: PROFILING analyzeBuffer() : total 32313us (CPU 32000us) regions 280us (CPU 0us) dict 15653us (CPU 16000us) merging 146us (CPU 0us)
Configuration menu - View commit details
-
Copy full SHA for a2301a5 - Browse repository at this point
Copy the full SHA a2301a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for aee613f - Browse repository at this point
Copy the full SHA aee613fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0040cb2 - Browse repository at this point
Copy the full SHA 0040cb2View commit details -
👼Script: Added OGRE shader parameter bindings + example ✨
// New Script API: // -- `BeamClass.getManagedMaterialNames()` -> `array<string>@` // -- `BeamClass.getManagedMaterialInstance()` -> `Ogre::MaterialPtr` // -- `Ogre::Pass.__getNamedConstants()` -> `array<string>@` // -- `Ogre::Pass.getFragmentProgramParameters()` -> `Ogre::GpuProgramParametersPtr` New internal API, `class Actor`: - getManagedMaterialInstance(const std::string& orig_name); --> Ogre::MaterialPtr - getManagedMaterialNames(); --> std::vector<std::string>
Configuration menu - View commit details
-
Copy full SHA for b564add - Browse repository at this point
Copy the full SHA b564addView commit details -
👼Script: Added OGRE index buffer bindings.
The 'example_ogre_terrnBatcher.as' script was updated - Use the new indexBuffer bindings - Perform merging of selected meshes (buggy at the moment) - Display an inline control for scene node visibility - useful to compare original vs. generated meshes
Configuration menu - View commit details
-
Copy full SHA for ec5fcf0 - Browse repository at this point
Copy the full SHA ec5fcf0View commit details -
👼Script: Added
game.serializeMeshResource()
- dumps .mesh filesScript 'example_ogre_terrnBatcher.as' updates: - Added [dump] button to inspector scenegraph - tested to work also for ManualObjects - Fixed mesh generation (I forgot to offset indices for every new appended mesh) - Reduced debug outputs Code changes: - added RGN_LOGS, auto-created at startup (along with other resource groups) - the actor-dump code now uses RGN_LOGS - moved RGN_ defs from ResourceManager.h to Application.h
Configuration menu - View commit details
-
Copy full SHA for 98f448a - Browse repository at this point
Copy the full SHA 98f448aView commit details