Jump to content
Aammppaa

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)


Win7 Ultimate x64   |   i5-3570K @ 3.4GHz   |   16 GB RAM   |   120 GB SSD   |   nVidia GTX 660 Ti   |   Huion 1060 Plus

 

ScreenToGIF (Open Source, Portable, ~610kB)

Share this post


Link to post
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.6.5.123 and Designer 1.6.5.123, (mainly Photo), now ex-Adobe CC

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

Share this post


Link to post
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 :(


Win7 Ultimate x64   |   i5-3570K @ 3.4GHz   |   16 GB RAM   |   120 GB SSD   |   nVidia GTX 660 Ti   |   Huion 1060 Plus

 

ScreenToGIF (Open Source, Portable, ~610kB)

Share this post


Link to post
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.6.1 ◆ Affinity Photo 1.6.7 ◆ OSX El Capitan

Share this post


Link to post
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.6.5.123 and Designer 1.6.5.123, (mainly Photo), now ex-Adobe CC

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×