Advertisement
rsidwell

recurrenceplot-julian

Jan 4th, 2025
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.73 KB | None | 0 0
  1. import org.jwildfire.create.tina.base.Flame;
  2. import org.jwildfire.create.tina.base.XForm;
  3. import org.jwildfire.create.tina.script.ScriptRunnerEnvironment;
  4. import org.jwildfire.create.tina.transform.XFormTransformService;
  5. import org.jwildfire.create.tina.base.DrawMode;
  6. import org.jwildfire.create.tina.variation.VariationFunc;
  7. import org.jwildfire.create.tina.variation.VariationFuncList;
  8. import org.jwildfire.create.tina.mutagen.RandomGradientMutation;
  9.  
  10. public void run(ScriptRunnerEnvironment pEnv) throws Exception {
  11.   Flame currFlame = pEnv.getCurrFlame(true);
  12.   currFlame.getXForms().clear();
  13.   currFlame.getFinalXForms().clear();
  14.   new RandomGradientMutation().execute(pEnv.getCurrLayer());
  15.  
  16.   // create xform 1 (recurrenceplot)
  17.   {
  18.     XForm xForm = new XForm();
  19.     xForm.setWeight(0.5);
  20.     xForm.setColor(0);
  21.     xForm.setColorSymmetry(-1);
  22.     xForm.setDrawMode(DrawMode.HIDDEN);
  23.  
  24.     VariationFunc varFunc=VariationFuncList.getVariationFuncInstance("recurrenceplot", true);
  25.     varFunc.randomize();
  26.     xForm.addVariation(1, varFunc);
  27.     currFlame.getXForms().add(xForm);
  28.   }
  29.    
  30.   // create xform 2 (julian)
  31.   {
  32.     XForm xForm = new XForm();
  33.     xForm.setWeight(0.5);
  34.     xForm.setColor(1);
  35.     xForm.setCoeff20(Math.random() * 2.0 - 1.0);
  36.     xForm.setCoeff21(Math.random() * 2.0 - 1.0);
  37.  
  38.     VariationFunc varFunc=VariationFuncList.getVariationFuncInstance("julian", true);
  39.     varFunc.randomize();
  40.     xForm.addVariation(1, varFunc);
  41.     currFlame.getXForms().add(xForm);
  42. }
  43.  
  44.   currFlame.setCamRoll(0.0);
  45.   currFlame.setCamPitch(0.0);
  46.   currFlame.setCamYaw(0.0);
  47.   currFlame.setCamPerspective(0.0);
  48.   currFlame.setPixelsPerUnit(50);
  49.   currFlame.setCamZoom(5);
  50.  
  51.   // Refresh the UI
  52.   pEnv.refreshUI();
  53. }
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement