Jump to content

midora

Members
  • Posts

    1,782
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by midora

  1. Sorry, about this compact answer.

     

    PropertyBasedEffect provides the method OnCreatePropertyCollection() which allows you to return properties as IndirectUi objects plus rules how these objects depend on each other.

     

    There is nothing like this for filetype plugins. But maybe I'm wrong.Rick would say: Use Reflector to check ;-)

  2. Maybe this info safes a little bit time if you like to activate glass buttons in your EffectConfigDialog:

    public EffectConfigDialog()
    {
        IsGlassDesired = true; 
            // this sets IsGlassEffectivelyEnabled if IsGlassSupported is true
        GlassInset = new Padding(0,0,0,38);
            // define the inset to the client area of the dialog
        AutoHandleGlassRelatedOptimizations = true;
            // this activates the handling of the dirty tricks
            // needed to get optimized controls in the glass area
    
        InitializeComponent();
    }
    

    This is just a hint extracted from my test phase. So you should calculate the inset padding depending on your controls.

     

    Here is an example of a dialog, where I'm using this info:

     

    post-79572-0-43273300-1360615386_thumb.j

     

    The button area includes an additional command button containing a 'Reset All' command, commands to load and save the properties of the dialog, and 'About' information.

     

  3. v1.3 (24.1.2013)
    - Added some examples which can be used in the different modes
    - Output mode: Added folding markers to the net and removed the inner lines of the net
    - Output mode: Added 3D view of the folded model
    - Visualization mode: Added 3D rotation controls
    - Design mode: Added design based on a single triangle (mirroring or rotating of the triangle)
    - Design mode: Added information about the number of pyramids, faces, edges, and vertices
    - Design mode: Added the uncolered 3D model
    - Design & Example mode: Removed but added an template or example choice selector to design mode
     

    All the examples are based on stock images free for non-commercial usage. I.e.

     

    PaperKaleidocyclesSmileys.jpg

     

    PaperKaleidocyclesMetalPlate.jpg

  4. I'm not talking about any gdi extension. I'm just using GDI in the moment to get the region scans.

     

    I'm looking for a transformation function from a source to a destination surface which works on a polygon (or maybe just a triangle). You are providing GetBilinearPixel() already to make it easier for a plugin to get an interpolated pixel. A simular funtion for an area would allow plugins to profit from any speed enhancement in Paint.NET. I would expect that there is already such a funtion used in the layer rotate/zoom function.

  5. Even cloning failed in OnRender() and this should be a readonly action. And it is not possible to clone in SetRenderInfo because the number of WorkerThreads is unknown ;-)

     

    In the meantime I started to replace the Matrix class with my own one. Not because of this issue but Matrix.TransformPoints is really slow. Just replacing this function call improved the rendering speed of the animation in kaleidocycles from 10s to 1.1s...

     

    I'm still dreaming that 4.0 would provide a warping methode for polygons on source and dest surface so that I can get rid of this:

     

     

            /*---------------------------------------------------------------------------*\
            Function    GetBilinearPolygonSamples
            Purpose     Copies an polygonal area from <src> to <dst> respecting a matrix
                        transformation and a clipping rectangle.
            Remarks     The final method of src should not use g and src as parameters.
            \*---------------------------------------------------------------------------*/
    
            private void GetBilinearPolygonSamples(Graphics g, Surface src, Surface dst, PointF[] polygonDst, Rectangle clipRectDst, Matrix mDstToSrc)
            {
                GraphicsPath gpDst = new GraphicsPath();
                gpDst.AddPolygon(polygonDst);
    
                // Now get for all points in the dst triangle the bilinear samples of src
                Region region = new Region(gpDst);
                region.Intersect(clipRectDst);
                if (region.IsEmpty(g)) return;
    
                float[] m = mDstToSrc.Elements;
                    //! mDstToSrc.TransformPoints(point) is more than 10 times slower than to get the elements and do the multiplication yourself
    
                RectangleF[] rects = region.GetRegionScans(new Matrix());
                for (int ri = 0; ri < rects.Length; ri++)
                {
                    RectangleF rect = rects[ri];
                    for (int y = (int)rect.Top; y < rect.Bottom; y++)
                    {
                        for (int x = (int)rect.Left; x < rect.Right; x++)
                        {
                            float pointX = x * m[0] + y * m[2] + m[4];
                            float pointY = x * m[1] + y * m[3] + m[5];
    
                            dst[(int)x, (int)y] = src.GetBilinearSample(pointX, pointY);
                        }
                    }
                }
            } /* GetBilinearPolygonSamples */
    

     

    Any idea for an improvement in the moment?

  6. Auto-save would be great, but with PDN's architecture you would have to wait for it every time it did an autosave. It can't operate in the background, in other words. And that could get pretty obnoxious on large files.

     

    An improvement could be to rename the old file (maybe by appending the old date and time) before saving (controlled by an user option which tells how many old versions to keep).

  7. One issue which disturbs me using the PanAndSlider property is that if you are panning then it is not possible to drag back to the 0/0 center. You are getting values like 0.02 or -0.01 always.

     

    Second: I'm using the following code to setup the background of PanAndSlider:

    Bitmap bitmap = new Bitmap(100, 100); // Creates a transparent bitmap
    configUI.SetPropertyControlValue(PropertyNames.RotateXYDeg, ControlInfoPropertyNames.StaticImageUnderlay, ImageResource.FromImage(bitmap));
    

    This shows a nice checkerboard background which makes more sense for the plugin than the

    standard:

     

    Bitmap bitmap = this.EnvironmentParameters.SourceSurface.CreateAliasedBitmap();

    Is there a better way than to use these constant values 100,100?

     

  8. I believe these are taken care of already for 4.0.

     

    Rotate/Zoom's UI, in fact, uses IndirectUI in 4.0. Which means that control is available for plugins too.

    Great.

     

    In the moment the 3D angle chooser just allows angles between -90 and 90. It would be nice to allow -180 to 180. So it should not stop at 90 instead you could roll endless like the the 2D angle chooser does.

     

    For Rotate/Zoom this would mean you could see somehow the backside of the plane.

  9. v1.2 (12.1.2013)
    - New models: Star kaleidocycles (decagonal .. icosagonal)
    - New mode: 'Visualization': To show the effect of cycling (Top, front, right, and bottom side view)
    - Renamed 'Print' mode to 'Output' mode
    - Renamed 'Square' kaleidocycle to 'Octagonal' kaleidocycle
    - Changed property 'Outer diameter' to 'Outer radius'
     

  10. Ah. Now I understand! Great use of animation to explain what the plugin does.

    I know for this kind of plugin you have to spend a little bit more time for documentation.

    Great to see that it makes some sense.

    I have to say, the animation is not generated by the plugin. I hope there will be time to do this in the future.

    The next version will contain a simple 3D visualization mode to see the effect of cycling.

×
×
  • Create New...