Jump to content
You must now use your email address to sign in [click for more info] ×

Add random rnd() as a mathematical function to the field input expressions


Recommended Posts

Now that we have the ability to transform each object in a selection independently, I would like the ability to do so by a random amount.

Example: select all instances of a screw head in my illustration and rotate by a random number of degrees between 0 and 360.

Function would be something like…

rnd(min value, max value)

Win10 Home x64   |   AMD Ryzen 7 2700X @ 3.7GHz   |   48 GB RAM   |   1TB SSD   |   nVidia GTX 1660   |   Wacom Intuos Pro

Link to comment
Share on other sites

1 hour ago, Aammppaa said:

Example: select all instances of a screw head in my illustration and rotate by a random number of degrees between 0 and 360.

Creating a mathematical function for random numbers would be a straightforward job for the for the developers. However your request to:

1 hour ago, Aammppaa said:

select all instances of a screw head in my illustration

would be problematic. Would you want all instances to have the same (random) value, or would you want a different random value for each instance? You are asking for a mechanism to process each of a list of objects. This is straightforward in many scripting languages, but we are nowhere near this for Affinity.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

@John Rostron Thinking about it again I see that you are right.

I guess that without the ability to parse the list of objects, the random() function would not be as helpful as I'd imagined :(

Win10 Home x64   |   AMD Ryzen 7 2700X @ 3.7GHz   |   48 GB RAM   |   1TB SSD   |   nVidia GTX 1660   |   Wacom Intuos Pro

Link to comment
Share on other sites

This highly depends on this statement here ...

11 hours ago, Aammppaa said:

Now that we have the ability to transform each object in a selection independently ...

... since that suggerates each & independently, which in turn would mean for my understanding here, performing a loop over all the objects and then applying a call to random for each object then.

And yes, no need to ask, would be a no-brainer in every better scripting language.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

7 hours ago, Aammppaa said:

I guess that without the ability to parse the list of objects, the random() function would not be as helpful as I'd imagined

But it could still be useful if you were willing (say) to select each object in turn and apply a macro to it. Or, in different circumstances, to use such a macro in a batch process on a number of files.

I would still support your original proposal for a random function in the field input expressions.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

  • 1 year later...

+1 for random( x, y) support ! I though the noise() function was supposed to do that but it doesn't seem to work in transform panel.

In transform panel, it should have a different results for each selected objects if Transform Independently is selected.

Link to comment
Share on other sites

  • 2 years later...

Another request for this. 

rnd() is glaring in its omission from the function list at Expressions for field input > Advanced mathematical expressions.

it says there that they should all be "For general use throughout the user interface."

I also tried noise in the transform > rotate field but it, as well as many other functions, does not work in at least the rotate field.

Or am I missing something?

Link to comment
Share on other sites

  • 4 weeks later...

+ 1

I think randomization is a feature that could help produce more interesting results from existing tools. It would be a useful option for functions like transform, rotate, color, etc. I would like to apply this effect to multiple elements in my design at the same time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.