• Welcome to World Machine Community. Please login or sign up.
 
May 20, 2019, 02:03:51 am

News:

Read the Development Diary for an inside look at World Machine's progress!


How to make a device that can tiled build?

Started by dagri, November 22, 2010, 04:56:13 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dagri

Hello,

I made a my device. and it works well.

I want to make the device for tiled build.

I changed below code.

   virtual bool isExporting(OUTPUT_MODE mode) { return false; }
to
   virtual bool isExporting(OUTPUT_MODE mode) { return true; }


and I found some problem.

doOutput(OutputSet& outset, OUTPUT_MODE output_mode)

output_mode value has OUTPUT_TILED.
but outset value has strange value.

How to make a device that can tiled build?

Stephen

The OutputSet encapsulates all of the data inputs that are active going into your Output device. Thus if your output takes many inputs and produces a single file, it will be provided with
all of those inputs which can be retrieved by iterating over outset.get(x) where x is in 0..outset.num()

OutputSet &outset should contain a reference to an OutputSet object (defined in IODevices.h)  that you can use to retrieve your data for saving, for example:


HField *hf = HF(outset.get(0)); // retrieve a heightfield type input


If your not seeing a valid OutputSet object on the outset parameter, we then have a different issue at hand!
-- Stephen Schmitt
- Creator of World Machine

dagri

November 22, 2010, 07:02:46 pm #2 Last Edit: November 22, 2010, 07:20:03 pm by dagri
I made simple logging code for test the outset value.


#include <fstream>
bool SimpleOutput::doOutput(OutputSet &outset, OUTPUT_MODE output_mode) {
assert(false && "TODO: doOutput() implementation!");
// TODO: DO YOUR OUTPUT!

std::ofstream of;
of.open("check outset value.txt", std::ios_base::out | std::ios_base::app);

if (output_mode == OUTPUT_TILED)
{
int n = outset.num();
of << "tiled outset num : " << n << std::endl;
}
else
{
int n = outset.num();
of << "normal outset num : " << n << std::endl;
}

return false;
};


and I built each way.

it's a result.
Quotenormal outset num : 1
tiled outset num : -10942447
tiled outset num : 525928465
tiled outset num : -10942447
tiled outset num : 525928465


I think outset value broken.

My computer spec is below
compiler : VS 2008, compile option release x64.
cpu : Intel Core2 Quad CPU Q8200
OS : windows 7 64bit
memory : 8GB



Could you send me sample code can tiled build device?

Stephen

hmm. I just performed a check by essentially copy-pasting your doOutput function and it works successfully for me using the 2.2 PDK and WM 2.2 Pro executable.

The only unaccounted for variable is that different versions of the MSVC compiler can break binary compatibility with libraries -- I've noticed this in particular with the STL implementation changing between editions. C++'s lack of a native ABI is what really hurts here.  If you can get your hands on the VC2005 compiler, my suspicion is that your code will work successfully.
-- Stephen Schmitt
- Creator of World Machine

dagri

I changed my compiler to 2005.

It works well. Thank you. :D

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S save/post or ALT+P preview