linking L-systems

   2537   3   0
User Avatar
Member
1694 posts
Joined: March 2020
Offline
Hi,

What I'd like to do is the following:

- I have an L-system that generates an L-system string, as usual
- I want to take this resulting string and use as a Premise in another L-system

Is this possible somehow?

Cheers,

imre
Imre Tuske
FX Supervisor | Senior FXTD @ Weta FX

qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
User Avatar
Member
127 posts
Joined: July 2005
Offline
While very dirty:

opinfo = hou.hscriptExpression('run(“opinfo /obj/geo1/lsystem1”)')
lsysStart = opinfo.find(“LSystem string:”)
lsysEnd = opinfo.find(“_______”, lsysStart)
return opinfo

this will grab the expanded string from one lsys and then you can have that in the premise parameter of the 2nd lsys. Remember to keyframe this since otherwise the python wont work in the string parm. Not sure if there is a cleaner way of doing this, maybe a custom expression function via the hdk could wrap this up nicer. There are some re-cooking issues so if you need it animated keyframe one of the rules on/off checkboxes in order to force string-reevaluation on the 2nd lsys.

Best of luck,
Fabian
User Avatar
Member
1694 posts
Joined: March 2020
Offline
Well… That's what I was afraid of… Anyhow, thanks (maybe I log this as an RFE)
Imre Tuske
FX Supervisor | Senior FXTD @ Weta FX

qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
User Avatar
Member
127 posts
Joined: July 2005
Offline
I suppose it might be a bit cleaner if you dumped the string into a spare parm on lsys1 and then just do a channel reference in lsys2. But yeah, nothing nice and in-built there. I think generally feeding lsys into each other via the additional inputs is a better way to go.
-Fabian
  • Quick Links