Jump to content

Carles Olle

Member
  • Content Count

    42
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Carles Olle

  • Rank
    Greenhorn

Personal Information

  • Location
    United States

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Carles Olle

    Automated creation of Color Shader Textures

    Hi, I'm in the situation that I need to create around 1000 objects with a mapped texture each. Now I'm doing it manually and, as you can imagine it takes a long time. I've tried to automate the process by creating a python script but it just happens that python doesn't have the functions to load an image file (png, jpg, etc.), create a texture/material and set up the correct aspect ratio for a right object mapping. My question is: Is there a way to archive the functionality described above using the VW SDK? Thanks in advance. Carles
  2. Carles Olle

    Change the aspect ratio of a color texture image

    I guess not.
  3. Hi, I have an object with an assigned color texture image ( see "How to assign a texture to a 3d object"). I need to change the the associated texture image aspect ratio to adapt to the dimensions of the object. I don't seem to be able to find the function to archive this. Would it be possible to use some sort of vs.GetTexBitPaintNode() / vs.SetTexBitPaintNode() / vs.CreatePaintFromImgN() combination in order to manipulate and reassign the bitmap bits? Those functions seem to be deprecated. Is there new, equivalent functions to archive this? Thanks
  4. Carles Olle

    How to assign a texture to a 3D object (Solved)

    That's exactly right. Thanks (I have another question but I'll open a new topic)
  5. This is a question that probably has a simple answer but that, for some reason I cannot manage to get right. So far I have this code but it does not seem to produce the expected results (the 3D poly-line does not show any texture at all): vs.BeginPoly3D() vs.Add3DPt((-5, 0, -5)) vs.Add3DPt(( 5, 0, -5)) vs.Add3DPt(( 5, 0, 5)) vs.Add3DPt((-5, 0, 5)) vs.Add3DPt((-5, 0, -5)) vs.EndPoly3D() image = vs.LNewObj() textureRef = vs.Name2Index("Test texture") vs.SetObjExpandTexture(image, 0) vs.SetTextureRef(image, textureRef, 1) vs.SetDefaultTexMap(image) vs.SetTexMapBool(image, 3, 3, True) # repeat horizontally vs.SetTexMapBool(image, 3, 4, True) # repeat vertically vs.SetTexMapInt(image, 3, 1, 0) # plane projection vs.SetTexMapReal(image, 3, 1, 0) # offset x vs.SetTexMapReal(image, 3, 2, 0) # offset y vs.SetTexMapReal(image, 3, 3, 10) # scale vs.SetTexMapReal(image, 3, 4, 0) # rotation Why this doesn't work? Any hint will be appreciated. --Carles
  6. Carles Olle

    Dialog control to select textures

    Yes, that works. Thanks. Now I need to find ways to implements "search" and "new texture..."
  7. Hi, I need to allow user to select a texture from one of our dialogs. I've been looking around and I don't seem to find the function to create the control to se select textures. Thanks for the help.
  8. Carles Olle

    Exception Thrown when calling TXResStr()

    I assume that asking for a debug version of VW2019 is out of the question ūüėŹ Anyway, Thanks Nicolas.
  9. Carles Olle

    Exception Thrown when calling TXResStr()

    Thanks for the reply Nicolas, I'm using VW SDK 2019 which I downloaded from https://www.vectorworks.net/support/custom/sdk/sdkdown I decided to use Visual Studio 2017 as it is indicated in http://developer.vectorworks.net/index.php/SDK:Vectorworks_2019_Development but it seems they forgot to mention not to use the toolset that comes with VS2017 (is this the right source for the VW SDK documentation?) If I open DefaultTools.vcxproj from the VW SDK 2019 samples folder I see they are using the 2017 toolset (v141): <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <PlatformToolset>v141</PlatformToolset> </PropertyGroup> It compiles ok using 2017 toolset (v141) but when running the debug version (release version is ok) I get the Exception described above. When I change to 2012 toolset (v110) I get these errors: 1>------ Build started: Project: DefaultTools, Configuration: Debug x64 ------ 1>StdAfx.cpp 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\GSString.X.h(682): error C2143: syntax error : missing ';' before '{' 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\GSString.X.h(682): error C2275: 'std::hash<_Kty>' : illegal use of this type as an expression 1> with 1> [ 1> _Kty=std::u16string 1> ] 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(267): error C2065: 'FP_NORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(267): error C2065: 'FP_SUBNORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(267): error C2065: 'FP_ZERO' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(268): error C2065: 'FP_NORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(268): error C2065: 'FP_SUBNORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(268): error C2065: 'FP_ZERO' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(269): error C2065: 'FP_ZERO' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(269): error C2065: 'FP_SUBNORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MiniCadCallBacks.h(2561): error C2065: 'default' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MiniCadCallBacks.h(2561): error C2253: 'TransferImageEffects' : pure specifier or abstract override specifier only allowed on virtual function 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MiniCadCallBacks.h(4001): error C2614: 'SymbolImgInfo' : illegal member initialization: 'SymbolImgInfo' is not a base or member 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MiniCadCallBacks.h(4002): error C2614: 'SymbolImgInfo' : illegal member initialization: 'SymbolImgInfo' is not a base or member 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\interfaces\VectorWorks/Extension/IResourceManagerContent.h(29): error C2864: 'VectorWorks::Extension::SSearchProperties::fOnlyCurrentDoc' : only static const integral data members can be initialized within a class 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\interfaces\VectorWorks/Extension/IResourceManagerContent.h(30): error C2864: 'VectorWorks::Extension::SSearchProperties::fSearchOnline' : only static const integral data members can be initialized within a class 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\interfaces\VectorWorks/Extension/IResourceManagerContent.h(31): error C2864: 'VectorWorks::Extension::SSearchProperties::fSkipCurrentDoc' : only static const integral data members can be initialized within a class 1>Done building project "DefaultTools.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  10. Carles Olle

    Exception Thrown when calling TXResStr()

    I'm compiling DeafultsTools SDK sample but when running the debug version of the plug-in in VectorWorks 2017 an exception is thrown. Windows SDK Version: 10.0.17134.0 Platform Toolset: Visual Studio 2017 (v141) No compilation error or warnings. The exception is thrown when inside the VWExtensionTool constructor (VWExtensionTool.cpp): fstrTitle = TXResStr( toolDef.fTitle.fResNameWithoutPathOrExtension, toolDef.fTitle.fStringIdentifier, eAllowEmptyResult ); toolDef.fTitle.fResNameWithoutPathOrExtension = "ExtObjThePoint" toolDef.fTitle.fStringIdentifier = "tool_title" eAllowEmptyResult = 1 This is the stack trace DefaultTools.vlb!std::_Container_base12::_Orphan_all() Line 256 C++ DefaultTools.vlb!std::_String_alloc<std::_String_base_types<wchar_t,TXAlloc<wchar_t> > >::_Orphan_all() Line 1803 C++ DefaultTools.vlb!std::basic_string<wchar_t,std::char_traits<wchar_t>,TXAlloc<wchar_t> >::_Tidy_deallocate() Line 3693 C++ DefaultTools.vlb!std::basic_string<wchar_t,std::char_traits<wchar_t>,TXAlloc<wchar_t> >::~basic_string<wchar_t,std::char_traits<wchar_t>,TXAlloc<wchar_t> >() Line 2231 C++ > DefaultTools.vlb!TXString::~TXString() Line 376 C++ [External Code] DefaultTools.vlb!VWFC::PluginSupport::VWExtensionTool::VWExtensionTool(CallBackBlock * cbp, const VWFC::PluginSupport::SToolDef & toolDef) Line 49 C++ DefaultTools.vlb!DefaultTools::CExtObjThePointDefTool::CExtObjThePointDefTool(CallBackBlock * cbp) Line 112 C++ DefaultTools.vlb!VWFC::PluginSupport::REGISTER_Extension<DefaultTools::CExtObjThePointDefTool>(const VWIID & groupID, int action, void * moduleInfo, const VWIID & inInterfaceID, IVWUnknown * & inOutInterface, CallBackBlock * cbp, int & reply) Line 349 C++ DefaultTools.vlb!plugin_module_main(int action, void * moduleInfo, const VWIID & iid, IVWUnknown * & inOutInterface, CallBackBlock * cbp) Line 41 C++ [External Code] Do you know if I need to change something in the sample code? Thanks.
  11. Carles Olle

    General attributes in the document

    Thanks Patrick, this works great! Cheers --Carlos
  12. Carles Olle

    General attributes in the document

    I'm not sure which is the best way to do this so I will ask. I have a relatively complex dialog that requires entering a number of settings. The dialog and its settings are not attached to a specific object but rather allow to create a number of objects. Most of the time parameters are the same but the user has to enter them again every time the dialog opens. Is there a way to attach to the document a set of attributes that ban be used so save and reload the settings for the dialog controls? Thanks --Carlos
  13. Carles Olle

    Create a Texture with Color shader with imported Image

    Thanks DomC, I do have a menu option "Import Arroway Textures" with I assume is the one you mention above. Let me see if I understand the tip. The first script above will convert a directory with images (in PNG format?) to a format that the Import command will understand. After that script in step 1 is executed, then, manually select the "Import Arroway Textures" command in order to automatically create all the textures. Optionally run the second script in order to rename the created textures during step 2 Is that correct? Cheers --Carlos
  14. Hi, I don't seem to find the way to create a texture color shader that will use a bitmap imported from the file system. Looking at the documentation I found this possible sequence: texture = vs.CreateTexture() vs.SetName(texture, "Test Texture") shader = vs.CreateShaderRecord(texture, 1, 41) bitmap = vs.CreateTextureBitmap() image = vs.ImportImageFile("E:\IMG_8509.JPG", importPt) paint = vs.CreatePaintFromImage(image) vs.SetTexBitPaintNode(bitmap, paint) vs.SetTextureBitmap(shader, bitmap) There seems to be some problems with this sequence: vs.CreateTextureBitmap() is not doing what the documentation says; Instead of creating an empty bitmap object, it opens a dialog to pick an image. It seems to be deprecated also. For some reason vs.CreatePaintFromImage(image) returns always 0 when an a Type 14 (Bitmap Image ‚Äď BITMAP) coming from vs.ImportImageFile() is used as parameter. Some help will be appreciated Thanks --Carlos
  15. Carles Olle

    Duplicate symbols sharing internal object instance

    Hi Josh, Yes, the code is part of a menu command. Yes, your understanding is correct. I take some actions when the PIO instance is duplicated; Change a contained Image Prop, change the ID, etc. The PIO entry function is called when I duplicate the PIO manually (not as part of a symbol duplication) but the PIO entry function does not seem to be called when the duplication happens as part of a symbol duplication and the two PIOs end up containing the same Image Prop. This is the snipped I use for the kObjOnInitXProperties event handling: if theEvent == vs.kObjOnInitXProperties: # Enable custom shape pane _ = vs.SetObjPropVS( vs.kObjXPropHasUIOverride, True ) _ = vs.SetObjPropVS( vs.kObjXHasCustomWidgetVisibilities, True ) vs.SetPrefInt(vs.varParametricEnableStateEventing, 1) _ = vs.SetObjPropVS( vs.kObjXPropAcceptStates, True ) _ = vs.SetObjPropVS( vs.kObjXPropAcceptStatesInternal, True ) InitParameters() Cheers --Carlos

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

√ó