sketchucation logo sketchucation
    • Login
    1. Home
    2. OricAtmos
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 37
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Webdialog position not preserved across session on MAC

      @thomthom said:

      Haven't checked it out, but on PC the position is stored between sessions, but not within sessions. If you make a webdialog, close it, then open it again it doesn't remember the last position - only the last position from last session.

      Hi,

      I know this is an old thread, but I think I found out what makes WebDialogs remember their position during one session on Windows. It seems the position is only ever saved when the WebDialog object is destroyed, not when the dialog is closed while the object still lives. That's it, I think.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: Is there a model exporter plugin that writes C++ files?

      Hey,

      I just wanted to say that I'm using the Open Asset Import Library (http://assimp.sourceforge.net/) now to load my two models. It can do a lot more than I need but it's not that hard to use.

      posted in Plugins
      OricAtmosO
      OricAtmos
    • RE: Is there a model exporter plugin that writes C++ files?

      @thomthom said:

      I'm sure there is a very simple light weight OBJ importers in C++. Such a common format.

      Thanks for the suggestion, I will have a look into the OBJ format. I don't know much about 3D file formats so I wasn't aware that OBJ is very common.

      posted in Plugins
      OricAtmosO
      OricAtmos
    • RE: Is there a model exporter plugin that writes C++ files?

      @chris fullmer said:

      You want the model to output as a text file that happens to be in C++ syntax, right?

      That was the idea, yes.

      @unknownuser said:

      That is simple enough if you know C++, and you have your own syntax your are trying to tie into. But no one else would be able to write it for you very well, sine no one else knows exactly how you would want to handle the C++ file structure.

      I don't want anyone to write anything for me. I just wanted to know if there already was an exporter like this. πŸ˜„

      @unknownuser said:

      OBJ is just a text file, for example. Why not just learn how to parse their structure instead of making up your own file structure?

      Basically I wanted to save me the step of parsing an input file and just let the compiler do it. I just want to have two 3D models in my program, no more.

      posted in Plugins
      OricAtmosO
      OricAtmos
    • RE: Is there a model exporter plugin that writes C++ files?

      @bigstick said:

      I'm told, by someone that knows a lot about this stuff, that C++ is 10x faster (or so) than Ruby for exporting geometry.

      I think there's a misunderstanding. I don't care whether the exporter is written in Ruby or in C++. I want the output to be C or C++ that I can compile in my C++ project. But since there doesn't seem to be an exporter like that, I'll have to write my own.

      posted in Plugins
      OricAtmosO
      OricAtmos
    • RE: Is there a model exporter plugin that writes C++ files?

      @tig said:

      Why do you need C++ ?

      Because it would be quick and easy.

      @unknownuser said:

      If you search for exporters there are several Ruby-based ones - for DXF, OBJ, STL, KML, CSV, TSV etc as well as the built-in ones...
      If you know the format you need and there isn't an existing one then see how it might be similar to an existing one and modify it... 'Binary' format files are NOT easy to write but 'text' based ones are... πŸ˜•

      I don't need any specific format, I just need to be able to use the models in my C++ program and render them with OpenGL. I could start looking for C++ libraries that import collada for example, because that's built-in. But experience tells me, getting to know my way around a new library can be a lot of work.

      posted in Plugins
      OricAtmosO
      OricAtmos
    • RE: Is there a model exporter plugin that writes C++ files?

      @thomthom said:

      I don't quite understand the request.
      You want a 3d model written as a C++ file?

      Yes. πŸ˜„

      @unknownuser said:

      If so, would it not then depend in the data structure you use in your C++ app?

      I would use the data structures the exporter gave me. All I really needed would be some arrays with vertex, face and normal data for the given model. Then I could easily render the models with OpenGL. Face colors would be nice, but not really neccessary.

      posted in Plugins
      OricAtmosO
      OricAtmos
    • Is there a model exporter plugin that writes C++ files?

      Hey,

      I'm looking for a model exporter plugin that writes C++ files I can just drop into my C++ projects to get the models into my program. Is there such a plugin?

      Thanks
      Ralf

      posted in Plugins
      OricAtmosO
      OricAtmos
    • RE: Tracking changes of component definitions with observers

      @thomthom said:

      @oricatmos said:

      This didn't work (I think I should have used the method initialize).

      Yes you do. Your variable was defined in the wrong scope.

      Where exactly did the variable end up anyway? did it exist only while the class definition was read from the file and executed?

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: Tracking changes of component definitions with observers

      @dan rathbun said:

      IF you are doing this inside a method, it's possible the references are being Garbage Collected.

      I think it's got something to do with the references. Inside my DefinitionsObserver class I was using an instance variable to hold a reference to my EntitiesObserver like this:

      
      # class definition inside module AC3D_Raven_Exporter
      class DefinitionsObserver < Sketchup;;DefinitionsObserver
      
          @entities_observer = AC3D_Raven_Exporter;;EntitiesObserver.new
          
          def onComponentAdded(definitions, definition)
              definition.entities.add_observer(@entities_observer)
          end
      end
      
      

      This didn't work (I think I should have used the method initialize). It works if I change it to a class variable. It also works if I just create a new EntitiesObserver every time I need to add one. But that's a waste of resources.

      Thanks for the help!

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • Tracking changes of component definitions with observers

      Hey,

      I'm trying to track changes of the model with observers. An EntitiesObserver added to active_model lets me see when faces are created outside any component. What do I have to do to see changes inside components? What I tried to do is add an EntitiesObserver to the entities object of each newly created ComponentDefinition but it doesn't seem to work.

      Thanks,
      Ralf

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: Want to avoid &quot;Endpoint Outside Active&quot; when moving vertex

      @gaieus said:

      What we meant here is this setting in the Model info dialog:

      Thanks for clearing that up! I've set up the same shortcuts for me now, too.

      @gaieus said:

      One uncomfortable thing however; even when the rest of the model (and all similar components) are hidden this way, the Orbit tool still behaves as if they were there (i.e. "weighing" the orbit tool when you do not use it exactly on the geometry you are editing).

      Using the orbit tool can get really aggravating anyway. I'm lucky I have a SpaceNavigator at work so I don't need the orbit tool. πŸ˜„

      posted in Newbie Forum
      OricAtmosO
      OricAtmos
    • RE: Want to avoid &quot;Endpoint Outside Active&quot; when moving vertex

      I tried hiding the layer the inactive component was on, but that didn't work. I suppose it's because the geometry inside all components is on the default layer. Hiding the actual component did help. Thanks a lot!

      posted in Newbie Forum
      OricAtmosO
      OricAtmos
    • Want to avoid &quot;Endpoint Outside Active&quot; when moving vertex

      I want to move single vertices (with the move tool) which are shared between different components (i guess they aren't really shared but exist once for each component, so I'm moving them separately in each component). My problem is that most of the time when I'm moving the mouse over the vertex it will pick the vertex from the inactive component (tooltip shows "Endpoint Outside Active") and doesn't allow moving it. Is there a remedy?

      posted in Newbie Forum sketchup
      OricAtmosO
      OricAtmos
    • RE: Camera independent flat shading (solved)

      Oh, sorry. I was logged in with an old account (that I didn't remember I had) on my home computer.

      posted in Newbie Forum
      OricAtmosO
      OricAtmos
    • RE: Camera independent flat shading (solved)

      @gaieus said:

      To me, it seems there is no difference between the colour of the faces this way.

      Thanks a lot, I didn't know that option! Unfortunately it doesn't seem to work for very dark or very light colors. But it's better than the view angle dependent shading.


      almost there, but not quite

      posted in Newbie Forum
      OricAtmosO
      OricAtmos
    • Camera independent flat shading (solved)

      Hi,

      is there a shading mode that doesn't change the brightness of faces when the camera moves or rotates but that displays the faces' colors? Hidden Line mode doesn't show colors, Shaded and Shaded With Textures changes the brightness with camera orientation. Turning on shadows makes the brightness independent from the camera but introduces shadows which I would like to avoid. Besides, rendering with shadows can get really slow with complex models.
      I'm partially color blind, so it's very hard for me to see whether all faces have the correct material applied when the brightness of the faces changes with the view angle.

      If all else fails, I'm probably going to write an OpenGL wrapper dll that hopefully can manipulate the calls to the OGL API in a way that gets me what I want, but I'm hoping there's a simpler solution.

      Any help appreciated!

      Edit (Solution):
      Setting Light to 0 and Dark to 80 in the Shadow Settings seems to preserve the material's color exactly.

      Edit 2:
      Here's the corresponding ruby code:

      shadow_info = Sketchup.active_model.shadow_info
      shadow_info["Light"] = 0
      shadow_info["Dark"]  = 80
      shadow_info["UseSunForAllShading"] = true
      shadow_info["DisplayShadows"]      = false
      
      posted in Newbie Forum sketchup
      OricAtmosO
      OricAtmos
    • 1
    • 2
    • 2 / 2