# Pasting long strings into the script parameters for Add 3D Function Surface?

I'm trying to use the script Add 3D Function Surface (specifically the Add X,Y,Z Function Surface feature) to produce some mathematical models for 3d printing. The formulas for my paraemtrized surfaces are very long --- one of the simpler ones has over 4,000 characters. Unfortunately, it appears that I can only paste 400 characters into each of the script parameter boxes.

Is there a way to get Blender to accept longer strings for each formula parameter? I'd be willing to run the script from the command line, but I haven't figured out how to do this.

I'm running Blender 2.70 on a mac. I'm also completely new to Blender, so let me know if there's additional information I can provide that will help. Thanks in advance :-)

Bug report: https://developer.blender.org/T39924

I can't see any maxlen parameters in the script:

And on Windows using Blender 2.70, I can store at least 1,000,000,000 characters in a StringProperty():

>>> C.scene.p = "x"*1000000000
>>> len(C.scene.p)
1000000000


The problem here is that there's a limit at layout level of 399 chars. You can actually type 400 and more letters into a text field, but you won't see the characters appear!

If you paste from clipboard, only the first 399 characters are taken. You can circumvent it by using python:

• Go to Scripting screen
• Call the XYZ Math Surface operator (parameter fields appear in Redo panel)
• Create a new text datablock in the Text Editor
• Add the following (substitute x_eq for the other equation fields):
import bpy
bpy.context.active_operator.x_eq = ""
• Place the cursor between the two "" quote marks and paste your formula
• Click Run Script or hit AltP - it will assign the formula text to the operator's parameter field.
• Click e.g. the handle of the U min property in the Redo to panel to force an update (it will not change the mesh based on the manually set equation automatically!). Don't activate any of the equation fields, it may truncate them again!
• Thanks! Have you had success actually pasting your 10^9 (or perhaps a little shorter...) length string into the Add 3D Function Surface parameter window? Apr 27 '14 at 17:56
• I'm also trying to hunt down the script on my system to compare with the one you linked, but this is proving difficult. Apr 27 '14 at 17:56
• It's pretty odd: it let's you type more than 399 chars, but you won't see it happening (in the operator log you do). If you paste from clipboard, only the first 399 chars are used. The only workaround is to set it via python (See my updated answer). Apr 27 '14 at 18:30
• I'm trying to implement your fix by opening the python console (same as scripting screen?) and typing the commands you gave. For short x_eq, this successfully puts my equation into the appropriate parameter window, but for long x_eq it again truncates my equation. A couple of comment/questions: (1) I'm just hitting enter from the python command line. That's not different from "Run Script", is it? (2) On my machine, I cannot type more characters into a parameter window that already contains 400 pasted characters.... Thanks so much for your thoughts on all this! Apr 27 '14 at 19:02
• Just to be clear: the full equation pastes into the python console, but when I execute the command the input gets truncated to 400 characters in the 3D view window. Apr 27 '14 at 19:04