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

dont save street propery in JSON #355

Merged
merged 5 commits into from
Oct 30, 2023
Merged

dont save street propery in JSON #355

merged 5 commits into from
Oct 30, 2023

Conversation

Algorush
Copy link
Collaborator

No description provided.

@netlify
Copy link

netlify bot commented Sep 22, 2023

Deploy Preview for 3dstreet-core-builds ready!

Name Link
🔨 Latest commit 8fced24
🔍 Latest deploy log https://app.netlify.com/sites/3dstreet-core-builds/deploys/654027d9bb15060008f660e2
😎 Deploy Preview https://deploy-preview-355--3dstreet-core-builds.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kfarr
Copy link
Collaborator

kfarr commented Sep 26, 2023

Is this removeProps list used in saving new files? if we ignore all of street component properties, that means all those props cannot be changed by the user such as turning on/off showGround or showStriping or adjusting length? At the moment those can't be edited in realtime anyway, they have to be saved and then the scene reloaded for the scene to adjust and display the changes correctly. (or the street entity removed and a new one loaded in its place)

@Algorush
Copy link
Collaborator Author

Algorush commented Oct 7, 2023

Maybe I can add new boolean key 'loaded' to street property while saving JSON. And inside street component I can check it, if its equals true, then dont do nothing. And it will also help not reload all scene in other cases.
I will try to ignore only JSON property in street component. It will help in future

prevent reload street after change properties of street component
@Algorush
Copy link
Collaborator Author

Algorush commented Oct 17, 2023

I added commits, where I adjusted the work of the function that filters components. Now removing JSON string in street component works well. And now the size of the JSON file has decreased noticeably

@kfarr
Copy link
Collaborator

kfarr commented Oct 18, 2023

@Algorush I am confused by this -- why do we remove street parent?

const streetParent = this.el.querySelector('.street-parent');
const streetEl = streetmixParsers.processSegments(streetmixSegments.streetmixSegmentsFeet, data.showStriping, data.length, data.globalAnimated, data.showVehicles);
if (streetParent) {
  streetParent.remove();
}

@Algorush
Copy link
Collaborator Author

Algorush commented Oct 19, 2023

@Algorush I am confused by this -- why do we remove street parent?

const streetParent = this.el.querySelector('.street-parent');
const streetEl = streetmixParsers.processSegments(streetmixSegments.streetmixSegmentsFeet, data.showStriping, data.length, data.globalAnimated, data.showVehicles);
if (streetParent) {
  streetParent.remove();
}

Because .street-parent element is added here later in the code, inside the processSegments function:

var streetParentEl = createCenteredStreetElement(segments);

I did this to avoid the case when the street component is applied several times to an element and then an issue occurs that the scene elements are added again. This case arise, for example, when changing the street parameters in the editor on the right panel. You can check it out in 3dstreet.app:
image

and now we can change the parameters of the street component. But yes, it was better to create a new issue for this, so as not to confuse

@kfarr
Copy link
Collaborator

kfarr commented Oct 30, 2023

To merge:

  • remove unrelated parent entity changes in index.js from this PR
  • merge in main to test
  • test before / after for the other changes? (ie do x, y, z to generate extra JSON in current branch, do x, y, z with branch and observe something different?)

@kfarr
Copy link
Collaborator

kfarr commented Oct 30, 2023

Works as expected, and both old and new json files generated are able to be opened
image

@kfarr kfarr merged commit 016c5f1 into main Oct 30, 2023
6 checks passed
@kfarr kfarr deleted the dont-save-JSON-property branch October 30, 2023 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants