Skip to content

Improve details of center/origin when a common object is created by the AI#8322

Merged
4ian merged 3 commits intomasterfrom
improve-create-object-tool-desc
Feb 25, 2026
Merged

Improve details of center/origin when a common object is created by the AI#8322
4ian merged 3 commits intomasterfrom
improve-create-object-tool-desc

Conversation

@ClementPasteau
Copy link
Collaborator

No description provided.

@ClementPasteau ClementPasteau requested a review from 4ian as a code owner February 25, 2026 09:20
@ClementPasteau ClementPasteau force-pushed the improve-create-object-tool-desc branch from f69edf0 to a223b60 Compare February 25, 2026 10:59
const height = maxY - minY;
return {
size: `${width}x${height}`,
origin: '0;0',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex This origin is false because it depends on min/max X/Y/Z (for example if minX = -10, the origin is actually at 10)

Can you also adapt this for 3D objects (IsRenderedIn3D)?
And adapt the tests to add a test case with a non 0;0 origin and another test case for 3D events based objects

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Fixed events-based object geometry reporting in getObjectSizeAndOriginInfo so origin is computed from area mins (-minX/-minY) instead of being hardcoded to 0;0, and center is now expressed from computed dimensions. Added 3D support when isRenderedIn3D() is true by including Z bounds in size, origin, and center. newIDE/app/src/EditorFunctions/Utils.jsL79-L101
  • Updated tests to cover:
  • Committed the changes on the current branch (2c017be) and created a follow-up PR via the make_pr tool.

Testing

  • ⚠️ CI=1 npm test -- --runInBand src/EditorFunctions/Utils.spec.js (fails in this environment because libGD.js-for-tests-only is missing from test setup).

View task →

@4ian 4ian merged commit ff4256a into master Feb 25, 2026
6 checks passed
@4ian 4ian deleted the improve-create-object-tool-desc branch February 25, 2026 12:58
NBForgeLab added a commit to NBForgeLab/GDevelop that referenced this pull request Feb 28, 2026
* Send context of the conversation to improve AI asset search

* Add a short description for all extensions and dimension field (2D, 3D, 2D/3D or n/a) (4ian#8303)

Only show in developer changelog

* Add missing support for short description/dimension

Don't show in changelog

* Fix being able to rename a layer with shortcut (4ian#8309)

* Fix opening the 3D editor not working after launching a preview first on the web (4ian#8310)

* Fix property group wrongly set when dragging a folder to the root (4ian#8312)

* Fix handling of instance/locked variables (4ian#8311)

- Removed the + button that was wrongly shown to add an instance variable (instance variables can only "override" the values of the variables defined in the object)
- Fix paste/delete a child of structure/array of a variable that is re-defined in instances variables. Previously it was not possible to paste a variable as a child of a instance variable that was a structure/array. This is now possible (and fully supported - you can't add new variables at the root, but items inside structures/arrays can be changed).

* Fix properties sometimes missing or duplicated when grouped in columns (4ian#8313)

* Fix keyboard shortcuts (copy/cut/paste/delete/undo/redo) not working when editing variables

* Replace old search bar by compact search bar in scene editor panels (4ian#8317)

* Improve robustness of AI events generation and asset swapping

* [Auto PR] Update translations (4ian#8304)

This updates the translations by downloading them from Crowdin and
compiling them for usage by the app.

Please double check the values in
`newIDE/app/src/locales/LocalesMetadata.js` to ensure the changes are
sensible.

Co-authored-by: 4ian <1280130+4ian@users.noreply.github.com>

* Add support for ordering For Each by an expression, with optional limit  (4ian#8319)

- For advanced use cases where it's important to run events on each instance of an object with an ordering, the For Each can now have an ordering: an expression can be written and will be evaluated for each instance separately. The For Each will then execute for each instance in the order of the result of the expression.
- It's possible to change the direction (ascending or descending)
- It's also possible to give a limit (for example, 1 will allow to pick just the instance with the highest/lowest value for the expression).
- Examples are provided in the UI for common use cases (maximum value of a variable, health points, ammo, distance to another object...)

* Update cordova config for new xcode/ios versions (4ian#8321)

Only show in developer changelog

* Fix tileset scrollbar area changing selection (4ian#8324)

Fix 4ian#8316

* Improve details of center/origin when an object is created by the AI (4ian#8322)

* Add a simplified version of the Anchor behavior editor (4ian#8325)

* [Auto PR] Update translations (4ian#8323)

* Bump newIDE version

* Fix size calculation for variants

Don't show in changelog

* [Auto PR] Update translations (4ian#8328)

* Fix new group name to ensure no usage of forbidden characters (4ian#8329)

* Add storybook stories for Anchor behavior editors (4ian#8330)

Do not show in changelog

* Fix brackets showing in the top right corner of the scene editor (4ian#8332)

Don't show in changelog

* Fix Scene Editor panels not resizing as small as possible (4ian#8331)

* Allow to import asset pack files (GDO) (4ian#8296)

* Explain the difference between built-in and external extensions in the documentation (4ian#8335)

- Don't show in changelog

* Fix to avoid objects to move when the gizmo dragging point is clicked (4ian#8334)

* Tweak the delay before moving an object with gizmo in the 3D editor

* Fix event generation errors not properly reported

* Allow multiple deletions in a single operation for generated events

* Persist properties panel scroll position for instances and objects (4ian#8337)

---------

Co-authored-by: Florian Rival <Florian.rival@gmail.com>
Co-authored-by: Florian Rival <florian@gdevelop.io>
Co-authored-by: Clément Pasteau <4895034+ClementPasteau@users.noreply.github.com>
Co-authored-by: D8H <Davy.Helard@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: 4ian <1280130+4ian@users.noreply.github.com>
Co-authored-by: LuniMoon <103995399+LuniMoon@users.noreply.github.com>
NBForgeLab added a commit to NBForgeLab/GDevelop that referenced this pull request Mar 2, 2026
* Send context of the conversation to improve AI asset search

* Add a short description for all extensions and dimension field (2D, 3D, 2D/3D or n/a) (4ian#8303)

Only show in developer changelog

* Add missing support for short description/dimension

Don't show in changelog

* Fix being able to rename a layer with shortcut (4ian#8309)

* Fix opening the 3D editor not working after launching a preview first on the web (4ian#8310)

* Fix property group wrongly set when dragging a folder to the root (4ian#8312)

* Fix handling of instance/locked variables (4ian#8311)

- Removed the + button that was wrongly shown to add an instance variable (instance variables can only "override" the values of the variables defined in the object)
- Fix paste/delete a child of structure/array of a variable that is re-defined in instances variables. Previously it was not possible to paste a variable as a child of a instance variable that was a structure/array. This is now possible (and fully supported - you can't add new variables at the root, but items inside structures/arrays can be changed).

* Fix properties sometimes missing or duplicated when grouped in columns (4ian#8313)

* Fix keyboard shortcuts (copy/cut/paste/delete/undo/redo) not working when editing variables

* Replace old search bar by compact search bar in scene editor panels (4ian#8317)

* Improve robustness of AI events generation and asset swapping

* [Auto PR] Update translations (4ian#8304)

This updates the translations by downloading them from Crowdin and
compiling them for usage by the app.

Please double check the values in
`newIDE/app/src/locales/LocalesMetadata.js` to ensure the changes are
sensible.

Co-authored-by: 4ian <1280130+4ian@users.noreply.github.com>

* Add support for ordering For Each by an expression, with optional limit  (4ian#8319)

- For advanced use cases where it's important to run events on each instance of an object with an ordering, the For Each can now have an ordering: an expression can be written and will be evaluated for each instance separately. The For Each will then execute for each instance in the order of the result of the expression.
- It's possible to change the direction (ascending or descending)
- It's also possible to give a limit (for example, 1 will allow to pick just the instance with the highest/lowest value for the expression).
- Examples are provided in the UI for common use cases (maximum value of a variable, health points, ammo, distance to another object...)

* Update cordova config for new xcode/ios versions (4ian#8321)

Only show in developer changelog

* Fix tileset scrollbar area changing selection (4ian#8324)

Fix 4ian#8316

* Improve details of center/origin when an object is created by the AI (4ian#8322)

* Add a simplified version of the Anchor behavior editor (4ian#8325)

* [Auto PR] Update translations (4ian#8323)

* Bump newIDE version

* Fix size calculation for variants

Don't show in changelog

* [Auto PR] Update translations (4ian#8328)

* Fix new group name to ensure no usage of forbidden characters (4ian#8329)

* Add storybook stories for Anchor behavior editors (4ian#8330)

Do not show in changelog

* Fix brackets showing in the top right corner of the scene editor (4ian#8332)

Don't show in changelog

* Fix Scene Editor panels not resizing as small as possible (4ian#8331)

* Allow to import asset pack files (GDO) (4ian#8296)

* Explain the difference between built-in and external extensions in the documentation (4ian#8335)

- Don't show in changelog

* Fix to avoid objects to move when the gizmo dragging point is clicked (4ian#8334)

* Tweak the delay before moving an object with gizmo in the 3D editor

* Fix event generation errors not properly reported

* Allow multiple deletions in a single operation for generated events

* Persist properties panel scroll position for instances and objects (4ian#8337)

* Fix For Each rendering when disabled and default values

* Rename "any order" to "default order" for For Each events

* Fix npm commands not working with projects on a different disk on Windows (4ian#8345)

* Improve events search UI with Match Case/Filters icon

---------

Co-authored-by: Florian Rival <Florian.rival@gmail.com>
Co-authored-by: Florian Rival <florian@gdevelop.io>
Co-authored-by: Clément Pasteau <4895034+ClementPasteau@users.noreply.github.com>
Co-authored-by: D8H <Davy.Helard@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: 4ian <1280130+4ian@users.noreply.github.com>
Co-authored-by: LuniMoon <103995399+LuniMoon@users.noreply.github.com>
Co-authored-by: opaldi <2235599+opaldi@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants