Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Multi paragraph text in .str files

    SDK Help
    0
    13
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 24/10/2016 at 01:57, xxxxxxxx wrote:

      Hi,

      in your resource file you'd use a STRING with CUSTOMGUI MULTISTRING. Additionally add the READONLY flag to mimic the static text behavior.
      Like so:

      STRING MY_PARAGRAPH { ANIM OFF; CUSTOMGUI MULTISTRING; WORDWRAP; READONLY; }
      

      Inside of the string you can use the pipe symbol ("|") for newline.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 10/08/2017 at 18:53, xxxxxxxx wrote:

        Hi all,

        Andreas, is still valid the pipe symbol for the newline?

        Thanks in advance
        Renato

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 11/08/2017 at 02:17, xxxxxxxx wrote:

          Hi Renato,

          I'm not aware of any changes on our end. But as you are asking, you are probably having problems with it?

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 11/08/2017 at 09:21, xxxxxxxx wrote:

            Hi Andreas,

            yes, i'm trying to output some lines to:
            STRING MY_TEXT_INFO { ANIM OFF; CUSTOMGUI MULTISTRING; WORDWRAP; READONLY; }

            adding the Pipe Symbol.. but the output is with pipe instead a newline:

            here the example:
            Grid Name: density - Grid Class: unknown | Grid Name: temperature - Grid Class: unknown | Grid Name: v - Grid Class: unknown |

            would be good to have:
            Grid Name: density - Grid Class: unknown
            Grid Name: temperature - Grid Class: unknown
            Grid Name: v - Grid Class: unknown

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 11/08/2017 at 18:07, xxxxxxxx wrote:

              If you create the string in your code, you need to use
              actual newlines.

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 11/08/2017 at 19:49, xxxxxxxx wrote:

                Hi Niklas, what do you mean with "actual newline" ?
                I tried to construct my string with '\n' without luck.

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 12/08/2017 at 17:59, xxxxxxxx wrote:

                  I'm sorry... but maybe too hot in the brain.

                  Thanks all for your time 🙂

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    On 14/08/2017 at 08:49, xxxxxxxx wrote:

                    Hi,

                    just for future readers, as it might not be completely clear: When setting a multi-line string parameter via code, one needs to use newline '\n' to add additional lines. While in the string file it is the pipe symbol '|'.

                    I will add this information also to one of the code examples.

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      On 14/08/2017 at 09:57, xxxxxxxx wrote:

                      Thanks Andreas 🙂

                      1 Reply Last reply Reply Quote 0
                      • H
                        Helper
                        last edited by

                        On 25/08/2017 at 11:56, xxxxxxxx wrote:

                        I was just giving this a try in a c4d_strings.str stringtable. I get the string with the Pipe symbol still in
                        the text (using GeLoadString in Python), rather than it being replaced by a newline. Does this only work
                        in C++ or in description/dialog stringtables?

                        Thanks!

                        1 Reply Last reply Reply Quote 0
                        • H
                          Helper
                          last edited by

                          On 29/08/2017 at 08:20, xxxxxxxx wrote:

                          Hi Niklas,

                          indeed GeLoadString() does not care for line wraps, neither in C++ nor in Python.
                          A small helper function could look like this:

                          static String GeLoadStringUpd(Int32 id)
                          {
                          	Int32 i;
                          	String str = GeLoadString(id);
                          	for (i = str.GetLength() - 1; i >= 0; i--)
                          	{
                          		if (str[i] == '|')
                          		{
                          			str.Delete(i, 1);
                          			str.Insert(i, GeGetLineEnd());
                          		}
                          	}
                          	return str;
                          }
                          
                          1 Reply Last reply Reply Quote 0
                          • H
                            Helper
                            last edited by

                            On 30/08/2017 at 02:31, xxxxxxxx wrote:

                            for me, \u000d works to create a line break in a str file.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post