How to modify a RIB sequence?


#1

I want to change some attributes in a long RIB sequence but I’m too lazy to write a script for this purpose(in really I forgot how to open search and replace text :p)

I’ve downloaded a copy of Python but never got the chance to try it.

Anyway, if someone can just help in to find a fast way to modify a automate modifying a RIB file, I’d really appreciate that. Thanks.

-lazhar


#2

i really dont think if there’s any other way than to write a small script that finds and replaces whatever u want to replace in your very long rib. there are ways (TCL Boxes/RIB Boxes) to modify the contents of the rib while generation thru *tor but once the rib is there, it’s simply text parsing, finding and replacement. cant do anything abt it :slight_smile:


#3

If you use Perl then you can run:

perl -pi ‘.old’ -e “s/old text/new text/g;” *.rib

Which will do a substitute (which is what s/// does) on every RIB file and create a backup with .old as the extension . (although try it out on a copy first… just in case).

Perl is a little better than Python at these sort of things. Once your script gets big though Python has more advantages.

Simon


#4

There’s always AutoRIB. It is Java based, and has a lot of functionality for modifying various things in RIBs.

Cheers

PaulG


#5

This is the one thing that I do quite like Perl for - the only times I’ve actually used Perl was when I was having to go through web logs and create some simple web-pages from them…


#6

Don’t forget about include files …

Maybe you can put the dynamic parts in “include” files.

I’f my recollection is accuate … RIB does support an include syntax.

In this way … you might have a scene composed of many static parts and maybe a few dynamic ones ?

It might be easier or nice to limit the scope of your search replaces.


#7

Well, I forget to come back here after I didnt see a quick replies :slight_smile:
I wished I could write some scripts because last month I opened 300 rib files with Note Pad to change some paramerters :smiley:

Thanks a lot for helps.


#8

Funnily enough I have done qute a few Perl scripts and none of them has been website related. It seems to be what everyone else uses it for though.

String handling and regular expressions are a lot nicer in Perl, but Python does objects a lot nicer.

Simon


#9

RIB “Procedural” might be what you’re looking for: ReadArchive and DelayedReadArchive are kind of like include files…also Procedural “RunProgram” would let you use a “helper program” (Python or Perl script, for instance)…

Out of curiosity, Lazzhar, what types of things are you modifying in your RIB?

don


#10

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.