News:

 

Topic: Samardac Bridges.  (Read 21820 times)

0 Members and 1 Guest are viewing this topic.

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
February 16, 2015, 04:46:14 pm
IStonia,
I have a little problem, after sending Windows Message NVil starts export and my plugin starts to monitor if .obj appears. Plugin waits about 2 seconds and if .obj does not appear plugin stop export and back to idle, if .obj appears plugin waits until it stop to increase its size and go to KeayShot for other actions.

I need this check to know if nothing was selected when Export starts and also to know when to go to KeyShot.


The problem is that NVil does not create .obj straight after export was started. So now if I have big project .obj can appears after 3, 4 and more seconds, so Plugin think that .obj was not created and stop its work. It would be greate if .obj appears stright after export was started.
No metter if it will have 0 bite, it will be enough to handle it.

For example MoI when exports .obj creates it immediately and then starts to increase its size, so I have smooth workaround here. I thought that NVil do the same thing but today tested Plugin with big project and found this problem.



Portfolio: www.samardac.com

  • No avatar
  • Posts: 3760
  • Developer
  • Administrator
  • Polygon
February 17, 2015, 08:55:01 am
You should be able to write a loop for file waiting in your plugin. Something like this

while(true)
{
    // check file
    ...

    if(fileFound)
    {
        break;
    }
    else
    {
        Thread.Sleep(100). // This is a good practice to reduce cpu usage.
    }
}
« Last Edit: February 17, 2015, 08:57:21 am by IStonia »

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
February 17, 2015, 09:14:57 am
I have already use loop like this, but the things is that if for example user select nothing and run export, .obj will never appears so loop will goes infinitely. So that is why my loop waits only about 2 secs and if obj does not appears it exits thread.
« Last Edit: February 17, 2015, 12:44:18 pm by samardac »
Portfolio: www.samardac.com

  • No avatar
  • Posts: 2103
  • Polygon
February 17, 2015, 07:49:01 pm
For example MoI when exports .obj creates it immediately and then starts to increase its size, so I have smooth workaround here.
All the other 3d application I use work in a similar way. To save system resources, on export, they will first create/open a file on disk, then convert/export each object separately to that file. Once last object exported, file on disk is closed.
 
Quote
I thought that NVil do the same thing but today tested Plugin with big project and found this problem.
Voidworld exported an .obj file as a single vertex object, so would copy geometry in memory, convert to .obj format in memory, then export to disk (the export options available to split the objects, was to create face groups within the exported file).
After I posted about an .obj file being able to have multiple objects(rather that a single vertex object) IStonia did make change, but did not change the behavior of first copying/converting everything in memory before exporting.
I have mentioned it before, it is a poor way to work, as it can use a lot of system memory for large scenes.(certainly not good if using 32bit version).

It may be a lot of work to change how the exporter works?. So why not make your plugin wait longer.

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
February 18, 2015, 07:25:33 am
Quote
It may be a lot of work to change how the exporter works?. So why not make your plugin wait longer.
I can make it, but...
For example I will make it wait 5 or 4 secs, I have powerful PC and it can be enough but for people with weak PC it can be not enough.
So if it will wait 5 secs and user run export and select nothing .obj will not creates and user must wait those five seconds before starting export again, it because AHK is Single Thread Execution and it does not run the same thread if it does not exit.
Portfolio: www.samardac.com

  • No avatar
  • Posts: 3760
  • Developer
  • Administrator
  • Polygon

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
February 18, 2015, 10:54:01 am
Thank you, works!
Portfolio: www.samardac.com

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
December 09, 2015, 06:23:48 pm
Hay IStonia,
I try to use this in instruction.txt but it does not work:
TID View Navigation Tools >> Best Fit (All Views)



I have this error with all best fit commands.
Portfolio: www.samardac.com

  • Posts: 514
  • Polygon
December 10, 2015, 07:38:04 am
Have you tried

View > Viewport Framing > Best Fit All

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
December 10, 2015, 07:45:20 am
I try to use this command with - NVil Instructions.txt and looks like it does not work.
This NVil Instructions.txt is used to control NVil from another application.
Portfolio: www.samardac.com

  • No avatar
  • Posts: 3760
  • Developer
  • Administrator
  • Polygon
December 15, 2015, 09:03:20 am
Fixed
http://www.digitalfossils.com/Download/NVil-Dec-15-15.rar

Also, Edit > Customize > Tools > Common Modeling Tools > P_SaveToFile.

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
December 15, 2015, 12:02:53 pm
Works great!
It do not support .vws is it how it should be?
Portfolio: www.samardac.com

  • Posts: 1697
  • Administrator
  • Polygon
    • http://samardac.com/
December 16, 2015, 08:53:07 am
IStonia,
This tool P_SaveToFile do not exit composite tool when nothing is selected. It shows message - There is no available object to save to obj and then continue to execute composite tool.
Pleas make this tool to stop execution of composite tool in this situation because after this P_SaveToFile I have Launch App command that runs external .exe that activates MoI and starts import operation.
So if nothing selected I see message(no file to save) than MoI activates and imports nothing.


This tool have to work this way if nothing is selected it will show dialog - Nothing is selected and than cancel current composite tool.
« Last Edit: December 16, 2015, 09:22:25 am by samardac »
Portfolio: www.samardac.com

  • No avatar
  • Posts: 3760
  • Developer
  • Administrator
  • Polygon

  • No avatar
  • Posts: 3760
  • Developer
  • Administrator
  • Polygon
December 16, 2015, 10:47:03 am