-
Notifications
You must be signed in to change notification settings - Fork 23
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
Scripted object, "still mode"? #242
Comments
And of course I can use the What if there were two toggles on the scripted object editor: Still / Animating and Preview / Final? -- Then there should probably be something to detect if |
Do you mean 'changes based on location in scene' or something else? If this really is a static object, or one that only changes at a few specific points on the timeline, the script should cache the completed CSG model, and perhaps a converted TriangleMesh. Just use the cached object unless the time/location/whatever invalidates the current shape. |
Yes, basically so. The changing dimensions happen in local space and the scripted object actually reads some dimensions from a hand sketched curve on the scene.
Now that you say it, I think I may have tried something like that before. -- I think I used a separate script to reset the scripted object (= set the object in memory to The content of the scripted object is actually 50 CSGObjects × 2
1 Cylinder × 50
1 Cylinder × 1
1 Sphere × 1
12 parameters to control the build. So to cache it I'd have to cache the parameters, the vertex positions of the curve and each object with the list of coordinate systems where to add it. Then the script should check the if any of the parameters or the extra boolean or the control curve have changed to make the decision if it should recreate the objects or use the ones in the memory... So far I have used @field and/or declared each variable, because undeclared variables that float in the memory tend to ... well ... be remembered even when they have become obsolete and then the next time I open the scene the script may not work. Something like that? |
While doing a little digging to make sure I understood the question in #241, I found that
That's a lot going on in a single scripted object. How many of these objects:
Of those 12 parameters, how many vary based on time? (IE, have a track) |
I see... None of them depend on time in any way or have tracks or depend on the location of the object. The 50 CSGs depend of a curve on the scene. The curve is not moving and the location of the curve is not a factor, only vertex positions are used. What is done, is that the scripted object gets a duplicate of the curve, subdivides it a few times, get vertex vectors into an array and then finds (by linear interpolation) the corresponding x-value for each of the 50 y-values that define the CSGs. So the way to tame it down would be to extract It's a kind of pity I can't show the thing (not until it's public anyway) but I'm doing it for somebody else. |
This doesn't sound like it should be re-building on every frame. By default, each object does have a position & rotation track, even if there are no keyframes. Maybe that's enough? Try manually deleting these tracks from the curve object, and see if that makes a difference.
I don't know if that would help, and shouldn't be necessary. Would it be possible to share a "Anonymized" version of the script? I'm thinking:
What I'm really interested in is:
|
I said parameters but what I mean is just typed in values of variables (that are in essense parameters of the process of creating the objects) -- so no script parameters involved. Like I'll come back to with example script. |
Hi!
I have been constructing a visualization of a piece that has a repetitive pattern that changes along distance. Now the object that is repeated is a
CSGObject
that has 7 operations in it's history. I think it will go up to 11 eventually. The object vith small variations is repeated some 50 times, two instances of each. It may actually turn into making every one of them individual, I don't know yet.Running the script (only one thread) takes currently close to half a minute with relatively coarse surface error setting -- you can see one or two corners on a long arch that really should appear smooth.
So far so good but, when I try to make a camera drive around the object and pull the time marker on the score the script starts to recreate the object every time though nothing is changing. Hiding the scripted object does not help, so obviously building a camera drive does not happen any time soon with this scene.
I could copy the script into the script editor and create a still model, but as I'm still working on it, then I'd have to delete all the parts of the old model, every time I make a change. Keeping it scripted would have some advantages.
So do you see a reasonable way of adding a "still mode" to scripted objects so that they would not have to be constantly recalculated when nothing is changing? -- Even better if this would be extended to loading RaytratcerRenderer.
The text was updated successfully, but these errors were encountered: