(Solved)parameter references not liking special characters

   4676   7   2
User Avatar
Member
40 posts
Joined: Oct. 2012
Offline
Hey Guys,
I am in the process of creating the UI for my Tree tool which requires me to reference the rules from my L-System. When I do that I have issues where the L-system doesn't transfer special characters(like `,$). I have attached the file to help you understand what I mean. Is there a solution or a way around this.
Thanks,
Regards,
Soumitra
Edited by - Nov. 1, 2012 08:59:00

Attachments:
TreeToolTest.hipnc (859.6 KB)

User Avatar
Member
40 posts
Joined: Oct. 2012
Offline
Anyone? I can't figure out a workaround. Any ideas would really help. Thank you
Regards,
Soumitra
User Avatar
Member
57 posts
Joined: Feb. 2011
Offline
hi Soumitra,

I took a quick look at your file and the first thing I noticed was that expression `strdup()` is not correct in the parameter: lsystem4_rule1, or perhaps I do not understand what you are trying to do:

A= T(d)`strdup(“~©F”,b)`B

in exhelp it says strdup(float count, string s2), so it wants a float and then the string to repeat/duplicate. I looked at your other example without special characters and modified the expression:

A= T(d)`strdup(4,“~©F”)`B

this worked, but I'm not sure if that is what you want. It does look like the node in the subnetwork references it correctly with this update.

hth
z
User Avatar
Member
40 posts
Joined: Oct. 2012
Offline
Hey Zephyr,
Great to hear from ya. Have you tried using special characters such as the ‘$’ sign. It works great in lsystem directly, but doesn't translate from my node. Thanks for the strdup update. I will look into it. It worked when I put it on the lsystem directly but freaked out when I referenced it in. I guess I was doing it wrong all along. But, do check into the characters such as $ sign pls.
Thanks and hope everything is alright at the internship,
Regards,
Soumitra
User Avatar
Member
57 posts
Joined: Feb. 2011
Offline
hey Soumitra,

I'm actually not familiar with l-systems, but I just noticed that you have a $A for lsystem4_rule2:

B= T(d)~©F~©F~©F~©FA

From what I can gather from the help docs, the only use for the ‘$’ char in l-system rules is for the construction $(x,y,z), but maybe you mean to use variables in the expression. I think $A won't work b/c you haven't declared anything for “A.” If I use something like $F in the strdup expression it works, but I think you want to use ${F} out side the backticks, that worked for me.

Perhaps this is not what you want to accomplish, though, I'm sorry I haven't quite studied the syntax of l-systems.

Not sure what you mean about the internship…
User Avatar
Member
40 posts
Joined: Oct. 2012
Offline
Well ‘$’ will work when you write it in the lsystem rule directly but does not translate to the lsystem inside the subnet even though I am relatively referencing what's written in the subnet into the lsystem3(present inside the subnet).
For example
I use this in the subnet rule
B= T(d)~©F~©F~©F~©FA
or
A= T(d)`strdup(b,“~©F”)`B
However, the lsystem3 inside the subnet translates this as,

B= T(d)~©F~©F~©F~©FA
and
A= T(d)B
respectively if you can follow what I am trying to say.
It's as though when passing any value by reference it ignores the special characters such as $ and `.
I just need to know if this is a limitation or if I am doing something wrong and if there is a workaround it. It could be the problem with the houdini version I am using. I am using 12.1.77 at home and 12.0.8 at school.

To answer your earlier question,
With the strdup I am duplicating the string ~©F ‘b’ number of times. Its the same as writing ~©F~©F~©F~©F but it only is duplicated the number of times I write it, instead of it being controlled by a variable. Hope this is more clear.
User Avatar
Member
57 posts
Joined: Feb. 2011
Offline
ok, I'm still a little confused as to what you expect the output to be after the reference/translate, but from what I gather from your latest post I think you want it to be essentially the same with regards to characters?

Try using the “\” escape character:

B= T(d)~©F~©F~©F~©FA

A= T(d)\`strdup(b,“~©F”)\`B

that should preserve the $ and ` symbols along with the expression and not expand it out. Is that what you are looking for? If not, maybe you can post what you type in on the subnetwork param and what you expect to be filled for the lsystem inside the subnet that is referencing this param.
User Avatar
Member
40 posts
Joined: Oct. 2012
Offline
The escape sequence worked like a charm. I was hesitant to use escape sequences since ‘\’ is a part of L-System as well. Thank you for all your help.
  • Quick Links