NotMyFault Posted March 7, 2021 Share Posted March 7, 2021 Hi Affinity team, can you please add logic functions that would allow to process if/select-clauses? i currently try to simulate by + and *, but could lead to complex formulas and wrong results 0 rated as false, all other values rated as true * means any other value (except those listed above) logic functions and, or, not should return only 0 or 1, normalizing all non-0 to 1 E.g. and(a,b) res 0 * 0 * 0 0 * * 1 or (a,b): res 0 0 0 * * 1 not (a) res 0 1 * 0 if (c,y,n) res 0 y n n * y n y Ifsign (c, n, z, p) res C=0 z c<0 n c>0 p Thank you in advance kirk23 1 Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 iPad Air Gen 5 (2022) A2589 Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps. Link to comment Share on other sites More sharing options...
dmstraker Posted March 7, 2021 Share Posted March 7, 2021 I do a fair amount of Procedural Texture programming and handle conditional statements by such as first deriving 0-1 for true-false and then multiplying by the result for condition a then adding multiplying by inverse for condition b. For comparing numbers, I typically subtract and do a roundup (scaling numbers as needed). eg (untested, so fingers crossed) a version of max(R,G) is: var ifrg=roundup(R-G); //is zero if green greater than red else 1 var mxrg=ifrg*R+(1-ifrg)*G; And yes, things get complex! NotMyFault 1 Quote Dave Straker Cameras: Sony A7R2, RX100V Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11" Favourite word: Aha. For me and for others. Link to comment Share on other sites More sharing options...
NotMyFault Posted March 7, 2021 Author Share Posted March 7, 2021 23 minutes ago, dmstraker said: I do a fair amount of Procedural Texture programming and handle conditional statements by such as first deriving 0-1 for true-false and then multiplying by the result for condition a then adding multiplying by inverse for condition b. For comparing numbers, I typically subtract and do a roundup (scaling numbers as needed). eg (untested, so fingers crossed) a version of max(R,G) is: var ifrg=roundup(R-G); //is zero if green greater than red else 1 var mxrg=ifrg*R+(1-ifrg)*G; And yes, things get complex! absolutely. Normally a+b can be used for "OR", but if you don't always normalize and have e.g. 1 + (-1) you get wrong results. Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 iPad Air Gen 5 (2022) A2589 Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps. Link to comment Share on other sites More sharing options...
dmstraker Posted March 7, 2021 Share Posted March 7, 2021 Ah yes. -ves of course. Another gotcha is calcs done as real numbers. So what should be 0 could be just out. Quote Dave Straker Cameras: Sony A7R2, RX100V Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11" Favourite word: Aha. For me and for others. Link to comment Share on other sites More sharing options...
spiderpod7d Posted March 9, 2021 Share Posted March 9, 2021 Hi Dave (dmstraker) Are your Procedural Texture macros cross platform compatible. I run on MAC and have had trouble with your macros in 1.9.1 I don't code but am really interested in getting your macros to work especially the Luminosity ones I have attached a screen capture of what they look like. (missing sliders) Thanks for any info Quote Link to comment Share on other sites More sharing options...
dmstraker Posted March 11, 2021 Share Posted March 11, 2021 On 3/9/2021 at 8:27 PM, spiderpod7d said: Hi Dave (dmstraker) Are your Procedural Texture macros cross platform compatible. I run on MAC and have had trouble with your macros in 1.9.1 I don't code but am really interested in getting your macros to work especially the Luminosity ones I have attached a screen capture of what they look like. (missing sliders) Thanks for any info Looks like you can scroll down to other sliders -- see the scroll bar to the right of sliders visible. Quote Dave Straker Cameras: Sony A7R2, RX100V Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11" Favourite word: Aha. For me and for others. Link to comment Share on other sites More sharing options...
BeauRX Posted March 11, 2021 Share Posted March 11, 2021 There is a bug (afp-4203) in the current Mac1.9.x versions of the procedural texture dialog where the input controls are not displayed and you only see blank space. Hoping this is fixed by end of 1.9.2 beta as I use Dave's (great) macros too, a significant enhancement to the attribute based selection of APh. Quote Link to comment Share on other sites More sharing options...
spiderpod7d Posted March 11, 2021 Share Posted March 11, 2021 Thanks Beau for the heads up I have downloaded the Beta 1.92 and will try it. Thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.