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

How to set props as sequenced by default #352

Open
benliq opened this issue Dec 12, 2022 · 4 comments
Open

How to set props as sequenced by default #352

benliq opened this issue Dec 12, 2022 · 4 comments

Comments

@benliq
Copy link

benliq commented Dec 12, 2022

Hi and thanks for this really great project.
I can't find anything about my issue in the documentation:
While adding programatically an object to a sheet in Studio, i would like to have some or all of the object's properties to be "sequenced" by default, without having to click right and select "sequence".
I can't figure out how i can do this.

Does anyone can help?

@cortot
Copy link

cortot commented Dec 15, 2022

Same for me.

@cortot
Copy link

cortot commented Dec 31, 2022

Hi benliq
I had some success with writing the json-file, which contains the project data, by a script. Sequenced objects are a separate json key and are imported properly. So there is no need to set objects programmatically to "sequenced".

@Johnly1986
Copy link

Which API can be used to load ?

@vimlesh1975
Copy link

vimlesh1975 commented Aug 9, 2024

`
import * as d from '@theatre/dataverse'

export const setPrimitivePropAsSequenced = (object, propsPrimitive) => {
const studioPrivate = window.__TheatreJS_StudioBundle._studio
studioPrivate.transaction(({ stateEditors }) => {
const pathToProp = d.getPointerParts(propsPrimitive).path
const propAddress = { ...object.address, pathToProp }
stateEditors.coreByProject.historic.sheetsById.sequence.setPrimitivePropAsSequenced(
propAddress
)
})
}
`

https://9fpfym.csb.app/

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

No branches or pull requests

4 participants