home
StrataCafe Forums
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Older Forums
 Strata Design 3D CX: Lua Scripting
 Importing animation Sequence Into Strata
 Forum Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

jbh4934
A Regular

USA
135 Posts

Posted - 07/15/2009 :  16:40:51  Show Profile  Visit jbh4934's Homepage
Guys,
I exported a sequence of 250 individual .obj files from blender into a folder. How do I import them as a readable sequence within Strata? FYI: I know absolutely nothing about scripting. Any help in the most laymens terms would be a HUGE HELP!

I was redirected to this forum after this response:
"I suspect you will need a Lua Script to perform object replacements. I would recommend you communicate the problem on the Strata Scripting forum. There are some new materials on scripting being generated now. And you might be able to pry loose a sample script that does replacements based on distance, and then convert that to replace based on time.

I am curious that if the meshes are different sizes, how they will be registered to keep the positioning in the proper place, as Strata positions most things based on their center point."

Thanks
Joel H.

Ken Bringhurst
A Regular

USA
238 Posts

Posted - 07/21/2009 :  00:58:47  Show Profile  Visit Ken Bringhurst's Homepage
Hi Joel.

We're working on a documentation for our Lua scripting. I can't say that the answer is there, but you can look through it, post comments and possibly make requests. You can find it here:
https://sites.google.com/site/stratausersupport/Home/strata-design-3d-cx-scripting
Good luck!
Go to Top of Page

strata_geek
Infrequent Poster

USA
21 Posts

Posted - 07/22/2009 :  21:23:11  Show Profile  Visit strata_geek's Homepage
Are the 250 different files representing an animation? What do you want to do with each file's content after importing it into Strata? A little more detail would help me come up with a better answer.

-strata_geek
Go to Top of Page

tbgriswold
Regularly Educational

USA
1369 Posts

Posted - 07/23/2009 :  21:55:27  Show Profile  Visit tbgriswold's Homepage
I am not jbh4934, but am interested in the answer as well. Yes these are an animation sequence of a water mesh-OBJs I think, There is a thread in the Strata 3D forum with more detail. http://www.stratacafe.com/forum/topic.asp?TOPIC_ID=8112

I would thing they need to register properly and retain the texture applied to the initial mesh.

Britt
Go to Top of Page

jbh4934
A Regular

USA
135 Posts

Posted - 07/24/2009 :  11:55:51  Show Profile  Visit jbh4934's Homepage
"Are the 250 different files representing an animation? What do you want to do with each file's content after importing it into Strata? A little more detail would help me come up with a better answer."


Yes, they are representing an animation. I would like each files content after to function as meshes that I can apply textures to etc. The long and short is I'm running a fluid simulation in Blender 3d, then exporting them out into Strata. From Strata I'd like to set up a scene and texture and render everything.
Go to Top of Page

eg
A Regular

132 Posts

Posted - 08/11/2009 :  11:36:13  Show Profile
I'm in the same boat as-well (still)

I've been asking around trying to get help and info. with no luck

the basic need
Import .obj stack (frame based ...not time based)

1. Select folder
2. Import obj scale field (default 100.0) [same as import option window]
3. Select frames of life field (default 2 frames) [add life attribute]
4. Import button [runs import script]


example 2 frame setting
i.e. DropA_00001.obj (life attribute frame 0 life frame 2 ends)
DropA_00002.obj (life attribute frame 2 life frame 4 ends)
DropA_00003.obj (life attribute frame 4 life frame 6 ends)
DropA_00004.obj (life attribute frame 6 life frame 8 ends)

is this doable in Lua?
peace
eg
Go to Top of Page

strata_geek
Infrequent Poster

USA
21 Posts

Posted - 08/11/2009 :  15:43:55  Show Profile  Visit strata_geek's Homepage
I'll see if I can come up with something clever to Lua to accomplish this once I get a folder full of job files, the objs and any other info such as the desired frame rate.

-strata_geek
Go to Top of Page

eg
A Regular

132 Posts

Posted - 08/11/2009 :  19:15:13  Show Profile
maybe the frame rate fallows the frame rate set in the project window

this is what the project window looked like when i did it manually



Image Insert:

25.36 KB

thanks
eg
Go to Top of Page

jpro
A Fountain of Information

USA
4991 Posts

Posted - 08/12/2009 :  00:05:20  Show Profile  Visit jpro's Homepage
Now, give him a folder full of OBJs to use to work the script up. You are conversing with The Big strata_geek. He wants to work this up for you. Give him something to work with.

Jean
Go to Top of Page

eg
A Regular

132 Posts

Posted - 08/12/2009 :  10:16:46  Show Profile
done...
emailed samples from blender and poser

thanks in advance
peace
eg
Go to Top of Page

jpro
A Fountain of Information

USA
4991 Posts

Posted - 08/12/2009 :  11:26:19  Show Profile  Visit jpro's Homepage
who did you email them to?

Jean
Go to Top of Page

eg
A Regular

132 Posts

Posted - 08/12/2009 :  11:38:01  Show Profile
the neighborly strata_geek

eg
Go to Top of Page

jpro
A Fountain of Information

USA
4991 Posts

Posted - 08/12/2009 :  12:01:35  Show Profile  Visit jpro's Homepage
cool.

Jean
Go to Top of Page

strata_geek
Infrequent Poster

USA
21 Posts

Posted - 08/21/2009 :  03:45:18  Show Profile  Visit strata_geek's Homepage
I've got a model file with the Poser walk cycle sent to me by eg scripted to automate the animation, but my emails all bounce. eg, is it okay to post the model file here or is that model data restricted in some way? Otherwise I guess I'll just post the script without sample data.

-strata_geek
Go to Top of Page

eg
A Regular

132 Posts

Posted - 08/21/2009 :  13:18:30  Show Profile
Hello super -strata_geek

Yes you can upload the model. I'll email you a new obj stack sample with more then 6 frames

so so glad to here from you

can't wait to take the script for a spin

thanks

peace
eg
Go to Top of Page

strata_geek
Infrequent Poster

USA
21 Posts

Posted - 08/22/2009 :  21:24:57  Show Profile  Visit strata_geek's Homepage
This script will work with any sequence of imported shapes named "<prefix>_0", "<prefix>_1", ... etc. Just import all the obj files, delete all those new instances from the modeling view except for the one numbered _0, and apply a Script FX with the following script in it to that first shape.

Initialization: http://sites.google.com/site/stratausersupport/Home/strata-design-3d-cx-scripting/more-scripting-examples/AnimatedModels_Init.txt?attredirects=0
Script Body: http://sites.google.com/site/stratausersupport/Home/strata-design-3d-cx-scripting/more-scripting-examples/AnimatedModels_Body.txt?attredirects=0

The "init" text goes into the initialization section of the new Script FX while the "body" text goes into the main script source section. The number at the end of the object names will determine where that model comes in the sequence of animation frames. Set the desired frame rate in that initialization section.

If that's too hard then here's a resource library file for the Script FX shader you can import or put into your resource library folder:
http://sites.google.com/site/stratausersupport/Home/strata-design-3d-cx-scripting/more-scripting-examples/SelectAnimationFrame.sfx.zip?attredirects=0

Finally here's a full model file with an imported Poser walk cycle. I created the Script FX shader and attached it to an instance of the first shape named "Walk_0". The script replaces that first frame geometry with the other frames of geometry based on the "framesPerSecond" variable you set in the script. Hit the preview button in the project window and you should see the walk cycle.

Model file: http://sites.google.com/site/stratausersupport/Home/strata-design-3d-cx-scripting/more-scripting-examples/WalkCycle.s3d.zip?attredirects=0

Cheers,

-strata_geek
Go to Top of Page

eg
A Regular

132 Posts

Posted - 08/24/2009 :  20:25:27  Show Profile
Hello strata_geek
Thanks for the script

I wish i could get it going
.... i can't get to work for me : (

was wondering if u can post the .s3d in a CX 5.5.1 to see what im doing wrong?

this is how far i got


Image Insert:

87.71 KB

tried different renders
tried with Flatten When Raytracing button on

thanks

peace
eg
Go to Top of Page

strata_geek
Infrequent Poster

USA
21 Posts

Posted - 08/25/2009 :  02:43:20  Show Profile  Visit strata_geek's Homepage
Sorry about that, but I think this script depends on features in the 6.0 release. I was just assuming you had the latest. I should have asked.

-strata_geek
Go to Top of Page

eg
A Regular

132 Posts

Posted - 09/12/2009 :  01:08:04  Show Profile
Hello strata_geek
hope you are well and still out there
so I finally upgraded to CX 6.0.1 today (look great, and it renders like the wind.)
one of the firsts thing i tried was your script. tried all 3 ways posted. but nothing worked
keep getting this in the Script Console

Lua result: [string "do..."]:70: attempt to call field `match' (a nil value)

running mac OSX 10.5.8 (also tried on 10.5.6)

thanks

peace
eg

Go to Top of Page

strata_geek
Infrequent Poster

USA
21 Posts

Posted - 09/12/2009 :  15:22:57  Show Profile  Visit strata_geek's Homepage
Sorry about that but somehow I let some newer Lua 5.1 stuff sneak into the script.

I've updated everything to actually work correctly with CX 6.0.1 now so please try again.

-strata_geek
Go to Top of Page

eg
A Regular

132 Posts

Posted - 09/12/2009 :  17:23:42  Show Profile
very cool works now

thank you very much

from what I've tried the obj have to be imported so they are part of the project. then the script is applied.

is there an easy way to import multiple files or can they only be imported one at a time.

I've noticed Strata doesn't like having lots of large .obj
a few times i was not able to get past 200 obj(s) when it would not allow me to save (not enough memory) still had 12GB of ram unused

is there a way to purge the ram in strata

peace
eg
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 Forum Locked
 Printer Friendly
Jump To:
StrataCafe Forums © 2009 StrataCafe Go To Top Of Page
Snitz Forums 2000