Skip to content
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

Added scriptable method to replace textures on-the-fly #2120

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

alex-w
Copy link
Member

@alex-w alex-w commented Dec 23, 2021

Description

I've added 2 scriptable methods for SolarSystem class to ability replacing planetary textures on-the-fly in scripts. The method setTextureForPlanet(planetName, texName); replace the texture for object with name planetName. The method resetTextures(planetName); loaded default texture for object with name planetName. In latest method parameter planetName can be empty - in this case default textures will be loaded for all solar system bodies.

Fixes #1060 (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update

How Has This Been Tested?

Please unpack archive texture_test.zip into scripts directory and run the script texture.ssc within Stellarium

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@alex-w alex-w added this to the 0.21.3 milestone Dec 23, 2021
@github-actions github-actions bot requested a review from gzotti December 23, 2021 13:59
@github-actions
Copy link

github-actions bot commented Dec 23, 2021

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files

@gzotti
Copy link
Member

gzotti commented Dec 23, 2021

Very nice!
I tried to exchange Venus clouds by the surface features. The texture path has to start in the scripting dir, right? Maybe we could (later!) add built-in alternative textures for Earth (cloudless), Mars (drawing?), Venus (surface features). This is a marvellous tool to put historical maps on the planets!
For me it seems to be OK.

@alex-w
Copy link
Member Author

alex-w commented Dec 23, 2021

Very nice! I tried to exchange Venus clouds by the surface features. The texture path has to start in the scripting dir, right?

Yes, this is correct

Maybe we could (later!) add built-in alternative textures for Earth (cloudless), Mars (drawing?), Venus (surface features). This is a marvellous tool to put historical maps on the planets! For me it seems to be OK.

In future maybe :) For example the process of changing the texture can be with fading effect.

OK, I'll merge it and prepare the second release candidate to version 0.21.3 :)

@alex-w alex-w merged commit 7829e4a into master Dec 23, 2021
@alex-w alex-w deleted the scripting/change-planetary-texture branch December 23, 2021 14:39
@github-actions
Copy link

Hello @alex-w! Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@github-actions
Copy link

Hello @alex-w! Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Scripting: Can we change the texture of an object dynamically within a script
2 participants